#include <Differentiator.h>
Calculation is done using numerical differencing, which should be considered a last resort for cases in which the analytic derivative is unavailable. (Note that you can obtain an analytic gradient automatically from the source code for f using complex step derivatives, ADIFOR, etc.)
Public Types | |
enum | Method { UnspecifiedMethod = 0, ForwardDifference = 1, CentralDifference = 2 } |
Public Member Functions | |
virtual | ~Differentiator () |
Differentiator (const Function &f, Method defaultMethod=UnspecifiedMethod) | |
Differentiator & | setDefaultMethod (Method) |
Method | getDefaultMethod () const |
void | calcDerivative (Real y0, Real fy0, Real &dfdy, Method=UnspecifiedMethod) const |
void | calcGradient (const Vector &y0, Real fy0, Vector &gf, Method=UnspecifiedMethod) const |
void | calcJacobian (const Vector &y0, const Vector &fy0, Matrix &dfdy, Method=UnspecifiedMethod) const |
Real | calcDerivative (Real y0, Method=UnspecifiedMethod) const |
Vector | calcGradient (const Vector &y0, Method=UnspecifiedMethod) const |
Matrix | calcJacobian (const Vector &y0, Method=UnspecifiedMethod) const |
void | resetAllStatistics () |
long | getNDifferentiations () const |
long | getNDifferentiationFailures () const |
long | getNCallsToUserFunction () const |
Static Public Member Functions | |
static bool | isValidMethod (Method) |
static const char * | getMethodName (Method) |
static int | getMethodOrder (Method) |
Friends | |
class | DifferentiatorRep |
Classes | |
class | Function |
This abstract class defines a function to be differentiated (repeatedly) by a Differentiator object. More... | |
class | GradientFunction |
Derive a concrete class from this one if you have a scalar function of multiple variables that you want to differentiate. More... | |
class | JacobianFunction |
Derive a concrete class from this one if you have a set of functions (i.e., a vector-valued function) of multiple variables that you want to differentiate. More... | |
class | ScalarFunction |
Derive a concrete class from this one if you have a scalar function of a single scalar variable that you want to differentiate. More... |
enum Method |
virtual ~Differentiator | ( | ) | [virtual] |
Differentiator | ( | const Function & | f, | |
Method | defaultMethod = UnspecifiedMethod | |||
) | [explicit] |
static bool isValidMethod | ( | Method | ) | [static] |
static const char* getMethodName | ( | Method | ) | [static] |
static int getMethodOrder | ( | Method | ) | [static] |
Differentiator& setDefaultMethod | ( | Method | ) |
Referenced by main().
void calcDerivative | ( | Real | y0, | |
Real | fy0, | |||
Real & | dfdy, | |||
Method | = UnspecifiedMethod | |||
) | const |
Referenced by main().
Referenced by main().
void calcJacobian | ( | const Vector & | y0, | |
const Vector & | fy0, | |||
Matrix & | dfdy, | |||
Method | = UnspecifiedMethod | |||
) | const |
Referenced by main().
Real calcDerivative | ( | Real | y0, | |
Method | = UnspecifiedMethod | |||
) | const |
void resetAllStatistics | ( | ) |
long getNDifferentiations | ( | ) | const |
Referenced by main().
long getNDifferentiationFailures | ( | ) | const |
Referenced by main().
long getNCallsToUserFunction | ( | ) | const |
Referenced by main().
friend class DifferentiatorRep [friend] |