numeric-tools-0.2.0.0: Collection of numerical tools for integration, differentiation etc.

Portabilityportable
Stabilityexperimental
MaintainerAleksey Khudyakov <alexey.skladnoy@gmail.com>

Numeric.Tools.Interpolation

Contents

Description

Function interpolation.

Sine interpolation using cubic splines:

>>> let tbl = cubicSpline $ tabulateFun (uniformMesh (0,10) 100) sin
>>> tbl `at` 1.786
0.9769239849844867

Synopsis

Type class

class Interpolation a whereSource

Interpolation for arbitraty meshes

Methods

at :: (IndexVal m ~ Double, Mesh m) => a m -> Double -> DoubleSource

Interpolate function at some point. Function should not fail outside of mesh however it may and most likely will give nonsensical results

tabulateFun :: (IndexVal m ~ Double, Mesh m) => m -> (Double -> Double) -> a mSource

Tabulate function

unsafeTabulate :: (IndexVal m ~ Double, Mesh m, Vector v Double) => m -> v Double -> a mSource

Use table of already evaluated function and mesh. Sizes of mesh and table must coincide but it's not checked. Do not use this function use tabulate instead.

interpolationMesh :: a m -> mSource

Get mesh.

interpolationTable :: a m -> Vector DoubleSource

Get table of function values

tabulate :: (Interpolation a, IndexVal m ~ Double, Mesh m, Vector v Double) => m -> v Double -> a mSource

Use table of already evaluated function and mesh. Sizes of mesh and table must coincide.

Linear interpolation

data LinearInterp a Source

Data for linear interpolation

linearInterp :: LinearInterp a -> LinearInterp aSource

Function used to fix types

Cubic splines

data CubicSpline a Source

Natural cubic splines

cubicSpline :: CubicSpline a -> CubicSpline aSource

Function used to fix types