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

Portability portable experimental Aleksey Khudyakov

Numeric.Tools.Interpolation

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

Instances

 Typeable1 LinearInterp Interpolation LinearInterp Eq a => Eq (LinearInterp a) Data a => Data (LinearInterp a) Show a => Show (LinearInterp a) Mesh a => Indexable (LinearInterp a)

Function used to fix types

# Cubic splines

data CubicSpline a Source

Natural cubic splines

Instances

 Typeable1 CubicSpline Interpolation CubicSpline Eq a => Eq (CubicSpline a) Data a => Data (CubicSpline a) Show a => Show (CubicSpline a)

Function used to fix types