interpolation-0.1.1.2: piecewise linear and cubic Hermite interpolation
Safe HaskellSafe-Inferred
LanguageHaskell98

Numeric.Interpolation.NodeList

Synopsis

Documentation

data T x y Source #

Constructors

Interval 
Node (x, y) (T x y) (T x y) 

Instances

Instances details
Functor (T x) Source #
\xs -> map (mapSnd ord) xs == Nodes.toList (fmap ord (Nodes.fromList (xs::[(Integer,Char)])))
Instance details

Defined in Numeric.Interpolation.NodeList

Methods

fmap :: (a -> b) -> T x a -> T x b #

(<$) :: a -> T x b -> T x a #

Foldable (T x) Source #
\xs -> map snd xs == Fold.toList (Nodes.fromList (xs::[(Integer,Char)]))
Instance details

Defined in Numeric.Interpolation.NodeList

Methods

fold :: Monoid m => T x m -> m #

foldMap :: Monoid m => (a -> m) -> T x a -> m #

foldMap' :: Monoid m => (a -> m) -> T x a -> m #

foldr :: (a -> b -> b) -> b -> T x a -> b #

foldr' :: (a -> b -> b) -> b -> T x a -> b #

foldl :: (b -> a -> b) -> b -> T x a -> b #

foldl' :: (b -> a -> b) -> b -> T x a -> b #

foldr1 :: (a -> a -> a) -> T x a -> a #

foldl1 :: (a -> a -> a) -> T x a -> a #

toList :: T x a -> [a] #

null :: T x a -> Bool #

length :: T x a -> Int #

elem :: Eq a => a -> T x a -> Bool #

maximum :: Ord a => T x a -> a #

minimum :: Ord a => T x a -> a #

sum :: Num a => T x a -> a #

product :: Num a => T x a -> a #

Traversable (T x) Source #
\x xs -> let f acc y = (acc+y,acc) in List.mapAccumL f x (map snd xs) == mapSnd Fold.toList (Trav.mapAccumL f x (Nodes.fromList (xs::[(Int,Integer)])))
Instance details

Defined in Numeric.Interpolation.NodeList

Methods

traverse :: Applicative f => (a -> f b) -> T x a -> f (T x b) #

sequenceA :: Applicative f => T x (f a) -> f (T x a) #

mapM :: Monad m => (a -> m b) -> T x a -> m (T x b) #

sequence :: Monad m => T x (m a) -> m (T x a) #

(Eq x, Eq y) => Eq (T x y) Source # 
Instance details

Defined in Numeric.Interpolation.NodeList

Methods

(==) :: T x y -> T x y -> Bool #

(/=) :: T x y -> T x y -> Bool #

(Ord x, Ord y) => Ord (T x y) Source # 
Instance details

Defined in Numeric.Interpolation.NodeList

Methods

compare :: T x y -> T x y -> Ordering #

(<) :: T x y -> T x y -> Bool #

(<=) :: T x y -> T x y -> Bool #

(>) :: T x y -> T x y -> Bool #

(>=) :: T x y -> T x y -> Bool #

max :: T x y -> T x y -> T x y #

min :: T x y -> T x y -> T x y #

(Show x, Show y) => Show (T x y) Source # 
Instance details

Defined in Numeric.Interpolation.NodeList

Methods

showsPrec :: Int -> T x y -> ShowS #

show :: T x y -> String #

showList :: [T x y] -> ShowS #

fromList :: [(x, y)] -> T x y Source #

list must be sorted with respect to first element

toList :: T x y -> [(x, y)] Source #

\xs -> xs == Nodes.toList (Nodes.fromList (xs::[(Integer,Char)]))

singleton :: x -> y -> T x y Source #

\x y -> Nodes.singleton x y == Nodes.fromList [(x,y)::(Integer,Char)]

lookup :: Ord x => T x y -> x -> (Maybe (x, y), Maybe (x, y)) Source #

>>> Nodes.lookup (Nodes.fromList ([(0,'a'),(2::Int,'b')])) (-1)
(Nothing,Just (0,'a'))
>>> Nodes.lookup (Nodes.fromList ([(0,'a'),(2::Int,'b')])) 0
(Just (0,'a'),Just (2,'b'))
>>> Nodes.lookup (Nodes.fromList ([(0,'a'),(2::Int,'b')])) 1
(Just (0,'a'),Just (2,'b'))
>>> Nodes.lookup (Nodes.fromList ([(0,'a'),(2::Int,'b')])) 2
(Just (2,'b'),Nothing)
>>> Nodes.lookup (Nodes.fromList ([(0,'a'),(2::Int,'b')])) 3
(Just (2,'b'),Nothing)
>>> Nodes.lookup (Nodes.fromList ([(0,'a'),(2,'b'),(5::Int,'c')])) 3
(Just (2,'b'),Just (5,'c'))