A simple class for forward-mode automatic differentiation. More...
#include <AutoDiff.hpp>
Public Member Functions | |
void | operator+= (const Scalar &rhs) |
void | operator+= (const AutoDiff &rhs) |
void | operator-= (const Scalar &rhs) |
void | operator-= (const AutoDiff &rhs) |
void | operator*= (const Scalar &rhs) |
void | operator*= (const AutoDiff &rhs) |
void | operator/= (const Scalar &rhs) |
void | operator/= (const AutoDiff &rhs) |
template<class Ostream > | |
Ostream & | print (Ostream &os) const |
const Scalar | val () const |
const Scalar | der () const |
Static Public Member Functions | |
static AutoDiff | constant (const Scalar x) |
Create an AutoDiff object representing a constant, that is, its derivative is zero. More... | |
static AutoDiff | variable (const Scalar x) |
Create an AutoDiff object representing a primary variable, that is, its derivative is one. More... | |
static AutoDiff | function (const Scalar x, const Scalar dx) |
Create an AutoDiff object representing a function value and its derivative. More... | |
A simple class for forward-mode automatic differentiation.
The class represents a single value and a single derivative. Only basic arithmetic operators and a few functions are implemented for it, it is mostly intended for simple experimentation.
|
inlinestatic |
Create an AutoDiff object representing a constant, that is, its derivative is zero.
|
inlinestatic |
Create an AutoDiff object representing a function value and its derivative.
|
inlinestatic |
Create an AutoDiff object representing a primary variable, that is, its derivative is one.