Portability | portable |
---|---|
Stability | experimental |
Maintainer | Aleksey Khudyakov <alexey.skladnoy@gmail.com> |
Function interpolation.
Sine interpolation using cubic splines:
>>>
let tbl = cubicSpline $ tabulateFun (uniformMesh (0,10) 100) sin
>>>
tbl `at` 1.786
0.9769239849844867
- class Interpolation a where
- tabulate :: (Interpolation a, IndexVal m ~ Double, Mesh m, Vector v Double) => m -> v Double -> a m
- data LinearInterp a
- linearInterp :: LinearInterp a -> LinearInterp a
- data CubicSpline a
- cubicSpline :: CubicSpline a -> CubicSpline a
- module Numeric.Tools.Mesh
Type class
class Interpolation a whereSource
Interpolation for arbitraty meshes
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
Typeable1 LinearInterp | |
Interpolation LinearInterp | |
Eq a => Eq (LinearInterp a) | |
Data a => Data (LinearInterp a) | |
Show a => Show (LinearInterp a) | |
Mesh a => Indexable (LinearInterp a) |
linearInterp :: LinearInterp a -> LinearInterp aSource
Function used to fix types
Cubic splines
data CubicSpline a Source
Natural cubic splines
Typeable1 CubicSpline | |
Interpolation CubicSpline | |
Eq a => Eq (CubicSpline a) | |
Data a => Data (CubicSpline a) | |
Show a => Show (CubicSpline a) |
cubicSpline :: CubicSpline a -> CubicSpline aSource
Function used to fix types
module Numeric.Tools.Mesh