1 #ifndef SimTK_DIFFERENTIATOR_H_
2 #define SimTK_DIFFERENTIATOR_H_
86 class OpNotAllowedForFunctionOfThisShape;
87 class UserFunctionThrewAnException;
88 class UserFunctionReturnedNonzeroStatus;
89 class UnknownMethodSpecified;
97 static bool isValidMethod(Method);
98 static const char* getMethodName(Method);
99 static int getMethodOrder(Method);
103 Method defaultMethod=UnspecifiedMethod);
108 Method getDefaultMethod()
const;
113 Method=UnspecifiedMethod)
const;
115 Method=UnspecifiedMethod)
const;
117 Method=UnspecifiedMethod)
const;
122 Real calcDerivative(
Real y0, Method=UnspecifiedMethod)
const;
123 Vector calcGradient (
const Vector& y0, Method=UnspecifiedMethod)
const;
124 Matrix calcJacobian (
const Vector& y0, Method=UnspecifiedMethod)
const;
127 void resetAllStatistics();
128 int getNumDifferentiations()
const;
129 int getNumDifferentiationFailures()
const;
130 int getNumCallsToUserFunction()
const;
133 class DifferentiatorRep;
136 DifferentiatorRep* rep;
159 int getNumFunctions()
const;
160 int getNumParameters()
const;
161 Real getEstimatedAccuracy()
const;
164 void resetAllStatistics();
165 int getNumCalls()
const;
166 int getNumFailures()
const;
191 virtual int f(
Real x,
Real& fx)
const=0;
210 virtual int f(
const Vector& y,
Real& fy)
const=0;
243 #endif // SimTK_DIFFERENTIATOR_H_
FunctionRep * rep
Definition: Differentiator.h:175
Given a function f(y), where f, y or both can be vectors, calculate the derivative (gradient...
Definition: Differentiator.h:77
Derive a concrete class from this one if you have a scalar function of a single scalar variable that ...
Definition: Differentiator.h:189
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:577
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
This abstract class defines a function to be differentiated (repeatedly) by a Differentiator object...
Definition: Differentiator.h:152
Method
Definition: Differentiator.h:92
virtual ~GradientFunction()
Definition: Differentiator.h:214
This is the header file that every Simmath compilation unit should include first. ...
virtual ~ScalarFunction()
Definition: Differentiator.h:195
Derive a concrete class from this one if you have a scalar function of multiple variables that you wa...
Definition: Differentiator.h:208
Function_< Real > Function
This typedef is used for the very common case that the return type of the Function object is Real...
Definition: Function.h:106
#define SimTK_SIMMATH_EXPORT
Definition: SimTKmath/include/simmath/internal/common.h:64
Derive a concrete class from this one if you have a set of functions (i.e., a vector-valued function)...
Definition: Differentiator.h:227
virtual ~JacobianFunction()
Definition: Differentiator.h:233