Synopsis

Documentation

newtype Index Source

Constructors

 Index (IntMap Int)

data Sparse a 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.

Constructors

 Sparse !a (IntMap (Sparse a)) Zero

Instances

 Typeable1 Sparse (Mode Sparse, Mode (D Sparse), Lifted Sparse) => Jacobian Sparse Primal Sparse Lifted Sparse => Mode Sparse Lifted Sparse (Typeable (Sparse a), Data a) => Data (Sparse a) Show a => Show (Sparse a) Num a => Grad (AD Sparse a) [a] (a, [a]) a (Num a, Grads i o a) => Grads (AD Sparse a -> i) (a -> o) a Num a => Grads (AD Sparse a) (Cofree [] a) a (Num a, Grad i o o' a) => Grad (AD Sparse a -> i) (a -> o) (a -> o') a

apply :: (Traversable f, Num a) => (f (AD Sparse a) -> b) -> f a -> bSource

vars :: (Traversable f, Num a) => f a -> f (AD Sparse a)Source

d :: (Traversable f, Num a) => f b -> AD Sparse a -> f aSource

d' :: (Traversable f, Num a) => f a -> AD Sparse a -> (a, f a)Source

ds :: (Traversable f, Num a) => f b -> AD Sparse a -> Cofree f aSource

skeleton :: Traversable f => f a -> f IntSource

spartial :: Num a => [Int] -> Sparse a -> Maybe aSource

partial :: Num a => [Int] -> Sparse a -> aSource

class Num a => Grad i o o' a | i -> a o o', o -> a i o', o' -> a i o whereSource

Methods

unpack :: ([a] -> [a]) -> oSource

unpack' :: ([a] -> (a, [a])) -> o'Source

Instances

 Num a => Grad (AD Sparse a) [a] (a, [a]) a (Num a, Grad i o o' a) => Grad (AD Sparse a -> i) (a -> o) (a -> o') a

class Num a => Grads i o a | i -> a o, o -> a i whereSource

Methods