Copyright (c) Edward Kmett 2010-2015 BSD3 ekmett@gmail.com experimental GHC only None Haskell2010

Description

Dense Forward AD. Useful when the result involves the majority of the input elements. Do not use for hessian and beyond, since they only contain a small number of unique nth derivatives -- (n + k - 1) choose k for functions of k inputs rather than the k^n that would be generated by using Dense, not to mention the redundant intermediate derivatives that would be calculated over and over during that process!

Assumes all instances of f have the same number of elements.

NB: We don't need the full power of Traversable here, we could get by with a notion of zippable that can plug in 0's for the missing entries. This might allow for gradients where f has exponentials like ((->) a)

# Documentation

data Dense f a Source #

Constructors

 Lift !a Dense !a (f a) Zero
Instances