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. | |
static AutoDiff | variable (const Scalar x) |
Create an AutoDiff object representing a primary variable, that is, its derivative is one. | |
static AutoDiff | function (const Scalar x, const Scalar dx) |
Create an AutoDiff object representing a function value and its derivative. |
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.
static AutoDiff Opm::AutoDiff< Scalar >::constant | ( | const Scalar | x | ) | [inline, static] |
Create an AutoDiff object representing a constant, that is, its derivative is zero.
static AutoDiff Opm::AutoDiff< Scalar >::function | ( | const Scalar | x, | |
const Scalar | dx | |||
) | [inline, static] |
Create an AutoDiff object representing a function value and its derivative.
static AutoDiff Opm::AutoDiff< Scalar >::variable | ( | const Scalar | x | ) | [inline, static] |
Create an AutoDiff object representing a primary variable, that is, its derivative is one.