#include <Function.h>
Public Member Functions | |
Function () | |
Default constructor. | |
Function (const Function &aFunction) | |
Copy constructor. | |
virtual | ~Function () |
Destructor. | |
virtual Object * | copy () const =0 |
Construct and return a copy of this object. | |
virtual void | init (Function *aFunction) |
Function & | operator= (const Function &aFunction) |
Assignment operator. | |
virtual double | calcValue (const SimTK::Vector &x) const |
Calculate the value of this function at a particular point. | |
virtual double | calcDerivative (const std::vector< int > &derivComponents, const SimTK::Vector &x) const |
Calculate a partial derivative of this function at a particular point. | |
virtual int | getArgumentSize () const |
Get the number of components expected in the input vector. | |
virtual int | getMaxDerivativeOrder () const |
Get the maximum derivative order this Function object can calculate. | |
virtual SimTK::Function * | createSimTKFunction () const =0 |
OPENSIM_DECLARE_DERIVED (Function, Object) | |
Static Public Member Functions | |
static Function * | makeFunctionOfType (Function *aFunction, const std::string &aNewTypeName) |
Protected Member Functions | |
void | resetFunction () |
This should be called whenever this object has been modified. | |
Protected Attributes | |
SimTK::Function * | _function |
Function::Function | ( | ) |
Default constructor.
Function::Function | ( | const Function & | aFunction | ) |
Copy constructor.
aFunction | Function to copy. |
Function::~Function | ( | ) | [virtual] |
Destructor.
virtual double OpenSim::Function::calcDerivative | ( | const std::vector< int > & | derivComponents, | |
const SimTK::Vector & | x | |||
) | const [virtual] |
Calculate a partial derivative of this function at a particular point.
Which derivative to take is specified by listing the input components with which to take it. For example, if derivComponents=={0}, that indicates a first derivative with respective to component 0. If derivComponents=={0, 0, 0}, that indicates a third derivative with respective to component 0. If derivComponents=={4, 7}, that indicates a partial second derivative with respect to components 4 and 7.
derivComponents | the input components with respect to which the derivative should be taken. Its size must be less than or equal to the value returned by getMaxDerivativeOrder(). | |
x | the Vector of input arguments. Its size must equal the value returned by getArgumentSize(). |
Reimplemented in OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::PiecewiseLinearFunction, OpenSim::StepFunction, MultidimensionalFunction, and MultidimensionalFunction.
virtual double OpenSim::Function::calcValue | ( | const SimTK::Vector & | x | ) | const [virtual] |
Calculate the value of this function at a particular point.
x | the Vector of input arguments. Its size must equal the value returned by getArgumentSize(). |
Reimplemented in OpenSim::Constant, OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::PiecewiseLinearFunction, OpenSim::StepFunction, MultidimensionalFunction, and MultidimensionalFunction.
virtual Object* OpenSim::Function::copy | ( | ) | const [pure virtual] |
Construct and return a copy of this object.
The object is allocated using the new operator, so the caller is responsible for deleting the returned object.
Reimplemented from OpenSim::Object.
Implemented in OpenSim::Constant, OpenSim::GCVSpline, OpenSim::LinearFunction, OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::PiecewiseLinearFunction, OpenSim::StepFunction, MultidimensionalFunction, and MultidimensionalFunction.
virtual SimTK::Function* OpenSim::Function::createSimTKFunction | ( | ) | const [pure virtual] |
int Function::getArgumentSize | ( | ) | const [virtual] |
Get the number of components expected in the input vector.
Reimplemented in OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::PiecewiseLinearFunction, OpenSim::StepFunction, MultidimensionalFunction, and MultidimensionalFunction.
int Function::getMaxDerivativeOrder | ( | ) | const [virtual] |
Get the maximum derivative order this Function object can calculate.
Reimplemented in OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::PiecewiseLinearFunction, OpenSim::StepFunction, MultidimensionalFunction, and MultidimensionalFunction.
virtual void OpenSim::Function::init | ( | Function * | aFunction | ) | [inline, virtual] |
static Function* OpenSim::Function::makeFunctionOfType | ( | Function * | aFunction, | |
const std::string & | aNewTypeName | |||
) | [static] |
Assignment operator.
Reimplemented from OpenSim::Object.
Reimplemented in OpenSim::Constant, OpenSim::GCVSpline, OpenSim::LinearFunction, OpenSim::MultiplierFunction, OpenSim::NaturalCubicSpline, OpenSim::PiecewiseLinearFunction, and OpenSim::StepFunction.
void Function::resetFunction | ( | ) | [protected] |
This should be called whenever this object has been modified.
It clears the internal SimTK::Function object used to evaluate it.
SimTK::Function* OpenSim::Function::_function [mutable, protected] |