Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype Index = Index (IntMap Int)
- emptyIndex :: Index
- addToIndex :: Int -> Index -> Index
- indices :: Index -> [Int]
- data Sparse a
- apply :: (Traversable f, Num a) => (f (Sparse a) -> b) -> f a -> b
- vars :: (Traversable f, Num a) => f a -> f (Sparse a)
- d :: (Traversable f, Num a) => f b -> Sparse a -> f a
- d' :: (Traversable f, Num a) => f a -> Sparse a -> (a, f a)
- ds :: (Traversable f, Num a) => f b -> Sparse a -> Cofree f a
- skeleton :: Traversable f => f a -> f Int
- spartial :: Num a => [Int] -> Sparse a -> Maybe a
- partial :: Num a => [Int] -> Sparse a -> a
- vgrad :: Grad i o o' a => i -> o
- vgrad' :: Grad i o o' a => i -> o'
- vgrads :: Grads i o a => i -> o
- class Num a => Grad i o o' a | i -> a o o', o -> a i o', o' -> a i o where
- class Num a => Grads i o a | i -> a o, o -> a i where
Documentation
addToIndex :: Int -> Index -> Index Source
We only store partials in sorted order, so the map contained in a partial will only contain partials with equal or greater keys to that of the map in which it was found. This should be key for efficiently computing sparse hessians. there are only (n + k - 1) choose k distinct nth partial derivatives of a function with k inputs.
(Num a, Bounded a) => Bounded (Sparse a) | |
(Num a, Enum a) => Enum (Sparse a) | |
(Num a, Eq a) => Eq (Sparse a) | |
Floating a => Floating (Sparse a) | |
Fractional a => Fractional (Sparse a) | |
Data a => Data (Sparse a) | |
Num a => Num (Sparse a) | |
(Num a, Ord a) => Ord (Sparse a) | |
Real a => Real (Sparse a) | |
RealFloat a => RealFloat (Sparse a) | |
RealFrac a => RealFrac (Sparse a) | |
Show a => Show (Sparse a) | |
Erf a => Erf (Sparse a) | |
InvErf a => InvErf (Sparse a) | |
Num a => Mode (Sparse a) | |
Num a => Jacobian (Sparse a) | |
Num a => Grad (Sparse a) [a] (a, [a]) a | |
Num a => Grads (Sparse a) (Cofree [] a) a | |
Typeable (* -> *) Sparse | |
Grads i o a => Grads (Sparse a -> i) (a -> o) a | |
Grad i o o' a => Grad (Sparse a -> i) (a -> o) (a -> o') a | |
type Scalar (Sparse a) = a | |
type D (Sparse a) = Sparse a |
apply :: (Traversable f, Num a) => (f (Sparse a) -> b) -> f a -> b Source
vars :: (Traversable f, Num a) => f a -> f (Sparse a) Source
d :: (Traversable f, Num a) => f b -> Sparse a -> f a Source
d' :: (Traversable f, Num a) => f a -> Sparse a -> (a, f a) Source
skeleton :: Traversable f => f a -> f Int Source