OpenSim::NaturalCubicSpline Class Reference

#include <NaturalCubicSpline.h>

Inheritance diagram for OpenSim::NaturalCubicSpline:
OpenSim::Function OpenSim::Object

List of all members.

Public Member Functions

 NaturalCubicSpline ()
 Default constructor.
 NaturalCubicSpline (int aN, const double *aTimes, const double *aValues, const std::string &aName="")
 NaturalCubicSpline (const NaturalCubicSpline &aSpline)
 Copy constructor.
virtual ~NaturalCubicSpline ()
 Destructor.
virtual Objectcopy () const
 Copy this object.
virtual void init (Function *aFunction)
 Initialize the spline with X and Y values.
NaturalCubicSplineoperator= (const NaturalCubicSpline &aSpline)
 Assignment operator.
int getSize () const
 Get size or number of independent data points (or number of coefficients) used to construct the spline.
const Array< double > & getX () const
 Get the array of independent variables used to construct the spline.
const Array< double > & getY () const
 Get the array of Y values for the spline.
virtual const double * getXValues () const
 Get the array of independent variables used to construct the spline.
virtual const double * getYValues () const
 Get the array of dependent variables used to construct the spline.
virtual int getNumberOfPoints () const
virtual double getX (int aIndex) const
virtual double getY (int aIndex) const
virtual double getZ (int aIndex) const
virtual void setX (int aIndex, double aValue)
virtual void setY (int aIndex, double aValue)
virtual bool deletePoint (int aIndex)
virtual bool deletePoints (const Array< int > &indices)
virtual int addPoint (double aX, double aY)
double calcValue (const SimTK::Vector &x) const
 Calculate the value of this function at a particular point.
double calcDerivative (const std::vector< int > &derivComponents, const SimTK::Vector &x) const
 Calculate a partial derivative of this function at a particular point.
int getArgumentSize () const
 Get the number of components expected in the input vector.
int getMaxDerivativeOrder () const
 Get the maximum derivative order this Function object can calculate.
SimTK::Function * createSimTKFunction () const
virtual void updateFromXMLNode ()
 Update this object based on its XML node.

Protected Attributes

PropertyDblArray _propX
 Array of values for the independent variables (i.e., the spline knot sequence).
Array< double > & _x
PropertyDblArray _propY
 Y values.
Array< double > & _y

Constructor & Destructor Documentation

NaturalCubicSpline::NaturalCubicSpline (  ) 

Default constructor.

OpenSim::NaturalCubicSpline::NaturalCubicSpline ( int  aN,
const double *  aTimes,
const double *  aValues,
const std::string &  aName = "" 
)
NaturalCubicSpline::NaturalCubicSpline ( const NaturalCubicSpline aSpline  ) 

Copy constructor.

All data members of the specified spline are copied.

Parameters:
aSpline NaturalCubicSpline object to be copied.
NaturalCubicSpline::~NaturalCubicSpline (  )  [virtual]

Destructor.


Member Function Documentation

int NaturalCubicSpline::addPoint ( double  aX,
double  aY 
) [virtual]
double OpenSim::NaturalCubicSpline::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.

Parameters:
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 from OpenSim::Function.

double OpenSim::NaturalCubicSpline::calcValue ( const SimTK::Vector &  x  )  const [virtual]

Calculate the value of this function at a particular point.

Parameters:
x the Vector of input arguments. Its size must equal the value returned by getArgumentSize().

Reimplemented from OpenSim::Function.

Object * NaturalCubicSpline::copy (  )  const [virtual]

Copy this object.

Returns:
Pointer to a copy of this object.

Implements OpenSim::Function.

SimTK::Function * NaturalCubicSpline::createSimTKFunction (  )  const [virtual]

Implements OpenSim::Function.

bool NaturalCubicSpline::deletePoint ( int  aIndex  )  [virtual]
bool NaturalCubicSpline::deletePoints ( const Array< int > &  indices  )  [virtual]
int NaturalCubicSpline::getArgumentSize (  )  const [virtual]

Get the number of components expected in the input vector.

Reimplemented from OpenSim::Function.

int NaturalCubicSpline::getMaxDerivativeOrder (  )  const [virtual]

Get the maximum derivative order this Function object can calculate.

Reimplemented from OpenSim::Function.

virtual int OpenSim::NaturalCubicSpline::getNumberOfPoints (  )  const [inline, virtual]
int NaturalCubicSpline::getSize (  )  const

Get size or number of independent data points (or number of coefficients) used to construct the spline.

Returns:
Number of data points (or number of coefficients).
double NaturalCubicSpline::getX ( int  aIndex  )  const [virtual]
const Array< double > & NaturalCubicSpline::getX (  )  const

Get the array of independent variables used to construct the spline.

For the number of independent variable data points use getN().

Returns:
Pointer to the independent variable data points.
See also:
getN();
const double * NaturalCubicSpline::getXValues (  )  const [virtual]

Get the array of independent variables used to construct the spline.

For the number of independent variable data points use getN().

Returns:
Pointer to the independent variable data points.
See also:
getN();
double NaturalCubicSpline::getY ( int  aIndex  )  const [virtual]
const Array< double > & NaturalCubicSpline::getY (  )  const

Get the array of Y values for the spline.

For the number of Y values use getNX().

Returns:
Pointer to the coefficients.
See also:
getCoefficients();
const double * NaturalCubicSpline::getYValues (  )  const [virtual]

Get the array of dependent variables used to construct the spline.

Returns:
Pointer to the independent variable data points.
virtual double OpenSim::NaturalCubicSpline::getZ ( int  aIndex  )  const [inline, virtual]
void NaturalCubicSpline::init ( Function aFunction  )  [virtual]

Initialize the spline with X and Y values.

Parameters:
aN the number of X and Y values
aXValues the X values
aYValues the Y values
NaturalCubicSpline & NaturalCubicSpline::operator= ( const NaturalCubicSpline aSpline  ) 

Assignment operator.

Note that data members of the base class are also assigned.

Returns:
Reference to this object.

Reimplemented from OpenSim::Function.

void NaturalCubicSpline::setX ( int  aIndex,
double  aValue 
) [virtual]
void NaturalCubicSpline::setY ( int  aIndex,
double  aValue 
) [virtual]
void NaturalCubicSpline::updateFromXMLNode (  )  [virtual]

Update this object based on its XML node.

Reimplemented from OpenSim::Object.


Member Data Documentation

Array of values for the independent variables (i.e., the spline knot sequence).

This array must be monotonically increasing.

Y values.

Array<double>& OpenSim::NaturalCubicSpline::_x [protected]
Array<double>& OpenSim::NaturalCubicSpline::_y [protected]

The documentation for this class was generated from the following files:

Generated on Sun Sep 25 00:19:49 2011 for OpenSim by  doxygen 1.6.1