-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | piecewise linear and cubic Hermite interpolation
--
-- Represent real functions by linear or cubic segments. The package
-- provides both data structures for efficient lookup of interpolation
-- intervals, and computation of basis functions.
--
-- There are two examples that can be built with
--
--
-- cabal install -fbuildExamples
--
--
--
-- - example/Plot.hs: Interpolate a sinus curve using
-- piecewise linear interpolation and piecewise Hermite cubic
-- interpolation. For the latter one we provide the derivatives of the
-- sinus function at the interpolation nodes.
-- - example/Fit.hs: Demonstrates how to use the basis
-- functions for fitting an interpolation function to a given function
-- using a linear least squares solver like \ from
-- hmatrix. We use a distorted sinus as target.
--
--
-- The package needs only Haskell 98.
@package interpolation
@version 0.0
module Numeric.Interpolation.Piece
type T x y ny = (x, ny) -> (x, ny) -> x -> y
linear :: Fractional a => T a a a
-- | Hermite interpolation with one derivative per node. That is, the
-- interpolating polynomial is cubic.
hermite1 :: Fractional a => T a a (a, a)
module Numeric.Interpolation.NodeList
data T x y
Interval :: T x y
Node :: (x, y) -> (T x y) -> (T x y) -> T x y
-- | list must be sorted with respect to first element
fromList :: [(x, y)] -> T x y
toList :: T x y -> [(x, y)]
singleton :: x -> y -> T x y
lookup :: Ord x => T x y -> x -> (Maybe (x, y), Maybe (x, y))
instance (Eq x, Eq y) => Eq (T x y)
instance (Ord x, Ord y) => Ord (T x y)
instance (Show x, Show y) => Show (T x y)
module Numeric.Interpolation.Basis.Compact
linear :: Num b => [a] -> [T a b]
hermite1 :: Num b => [a] -> [T a (b, b)]
-- | Cubic interpolation where the derivative at a node is set to the slope
-- of the two adjacent nodes.
cubicLinear :: Fractional a => [a] -> [T a (a, a)]
-- | Cubic interpolation where the derivative at a node is set to the slope
-- of the parabola through the current and the two adjacent nodes.
cubicParabola :: Fractional a => [a] -> [T a (a, a)]
module Numeric.Interpolation.Basis
linear :: Num b => [a] -> [T a b]
hermite1 :: Num b => [a] -> [T a (b, b)]
-- | Cubic interpolation where the derivative at a node is set to the slope
-- of the two adjacent nodes.
cubicLinear :: Fractional a => [a] -> [T a (a, a)]
-- | Cubic interpolation where the derivative at a node is set to the slope
-- of the parabola through the current and the two adjacent nodes.
cubicParabola :: Fractional a => [a] -> [T a (a, a)]
-- | coefficientsToLinear nodes coefficients creates an
-- interpolation function for nodes, where the
-- coefficients correspond to the basis functions constructed
-- with Basis.linear nodes.
coefficientsToLinear :: [a] -> [b] -> T a b
-- | Cf. coefficientsToLinear
coefficientsToHermite1 :: [a] -> [b] -> T a (b, b)
-- | Cf. coefficientsToLinear
coefficientsToCubicLinear :: Fractional a => [a] -> [a] -> T a (a, a)
-- | Cf. coefficientsToLinear
coefficientsToCubicParabola :: Fractional a => [a] -> [a] -> T a (a, a)
module Numeric.Interpolation.Type
data T x y ny
Cons :: ([x] -> [y] -> String) -> T x y ny -> ([x] -> [T x ny]) -> ([x] -> [y] -> T x ny) -> (ny -> y) -> T x y ny
ssvFromNodes :: T x y ny -> [x] -> [y] -> String
interpolatePiece :: T x y ny -> T x y ny
basisFunctions :: T x y ny -> [x] -> [T x ny]
coefficientsToInterpolator :: T x y ny -> [x] -> [y] -> T x ny
valueFromNode :: T x y ny -> ny -> y
linear :: T Double Double Double
cubic :: T Double Double (Double, Double)
cubicLinear :: T Double Double (Double, Double)
cubicParabola :: T Double Double (Double, Double)
module Numeric.Interpolation.Piecewise
-- | It is a checked error to interpolate outside of the range of nodes.
interpolate :: Ord x => T x y ny -> T x ny -> x -> y
-- | Outside the range of nodes the interpolation function takes the value
-- of the respective border.
interpolateConstantExt :: Ord x => T x y ny -> T x ny -> x -> y
module Numeric.Interpolation.Basis.Full
linear :: Num b => [a] -> [T a b]
hermite1 :: Num b => [a] -> [T a (b, b)]