| Copyright | (c) Edward Kmett 2010-2021 | 
|---|---|
| License | BSD3 | 
| Maintainer | ekmett@gmail.com | 
| Stability | experimental | 
| Portability | GHC only | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
Numeric.AD.Mode
Contents
Description
Synopsis
- class (Num t, Num (Scalar t)) => Mode t where
- type Scalar t
 - isKnownConstant :: t -> Bool
 - asKnownConstant :: t -> Maybe (Scalar t)
 - isKnownZero :: t -> Bool
 - auto :: Scalar t -> t
 - (*^) :: Scalar t -> t -> t
 - (^*) :: t -> Scalar t -> t
 - (^/) :: Fractional (Scalar t) => t -> Scalar t -> t
 - zero :: t
 
 - pattern KnownZero :: Mode s => s
 - pattern Auto :: Mode s => Scalar s -> s
 
AD modes
class (Num t, Num (Scalar t)) => Mode t where Source #
Minimal complete definition
Nothing
Methods
isKnownConstant :: t -> Bool Source #
allowed to return False for items with a zero derivative, but we'll give more NaNs than strictly necessary
asKnownConstant :: t -> Maybe (Scalar t) Source #
isKnownZero :: t -> Bool Source #
allowed to return False for zero, but we give more NaN's than strictly necessary
auto :: Scalar t -> t Source #
Embed a constant
(*^) :: Scalar t -> t -> t infixr 7 Source #
Scalar-vector multiplication
(^*) :: t -> Scalar t -> t infixl 7 Source #
Vector-scalar multiplication
(^/) :: Fractional (Scalar t) => t -> Scalar t -> t infixr 7 Source #
Scalar division
zero=lift0