OpenSim::GCVSpline Class Reference

#include <GCVSpline.h>

Inheritance diagram for OpenSim::GCVSpline:
OpenSim::Function OpenSim::Object

List of all members.

Public Member Functions

 GCVSpline ()
 Default constructor.
 GCVSpline (int aDegree, int aN, const double *aTimes, const double *aValues, const std::string &aName="", double aErrorVariance=0.0)
 GCVSpline (const GCVSpline &aSpline)
 Copy constructor.
virtual ~GCVSpline ()
 Destructor.
virtual Objectcopy () const
 Copy this object.
virtual void updateFromXMLNode ()
 Update this object based on its XML node.
GCVSplineoperator= (const GCVSpline &aSpline)
 Assignment operator.
void setDegree (int aDegree)
 Set the degree of this spline.
int getDegree () const
 Get the degree of this spline.
int getOrder () const
 Get the order of this spline.
int getHalfOrder () const
 Get the half order of this spline.
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.
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.
const Array< double > & getCoefficients () const
 Get the array of coefficients for 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 double getMinX () const
 Get the minimum value of the independent variable.
virtual double getMaxX () const
 Get the maximum value of the independent variable.
virtual bool deletePoint (int aIndex)
virtual bool deletePoints (const Array< int > &indices)
virtual int addPoint (double aX, double aY)
SimTK::Function * createSimTKFunction () const
 OPENSIM_DECLARE_DERIVED (GCVSpline, Function)

Protected Attributes

PropertyInt _propHalfOrder
 Half order of the spline (degree+1)/2.
PropertyDbl _propErrorVariance
 Error variance for the data and spline fit.
PropertyDblArray _propX
 Array of values for the independent variables (i.e., the spline knot sequence).
PropertyDblArray _propWeights
 Array of weight values, one for each data point.
PropertyDblArray _propCoefficients
 Spline coefficients.
PropertyDblArray _propY
 Spline Y values.
int & _halfOrder
 Reference to the value of the HalfOrder property.
double & _errorVariance
 Reference to the value of the ErrorVariance property.
Array< double > & _x
 Reference to the value of the X property.
Array< double > & _weights
 Reference to the value of the Weights property.
Array< double > & _coefficients
 Reference to the value of the Coefficients property.
Array< double > & _y
 Y (dependent) values of the function.
std::vector< int > _workDeriv
 A workspace used when calculating derivatives of the spline.

Constructor & Destructor Documentation

GCVSpline::GCVSpline (  ) 

Default constructor.

OpenSim::GCVSpline::GCVSpline ( int  aDegree,
int  aN,
const double *  aTimes,
const double *  aValues,
const std::string &  aName = "",
double  aErrorVariance = 0.0 
)
GCVSpline::GCVSpline ( const GCVSpline aSpline  ) 

Copy constructor.

All data members of the specified spline are copied.

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

Destructor.


Member Function Documentation

int GCVSpline::addPoint ( double  aX,
double  aY 
) [virtual]
Object * GCVSpline::copy (  )  const [virtual]

Copy this object.

Returns:
Pointer to a copy of this object.

Implements OpenSim::Function.

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

Implements OpenSim::Function.

bool GCVSpline::deletePoint ( int  aIndex  )  [virtual]
bool GCVSpline::deletePoints ( const Array< int > &  indices  )  [virtual]
const Array< double > & GCVSpline::getCoefficients (  )  const

Get the array of coefficients for the spline.

For the number of coefficients use getNX().

Returns:
Pointer to the coefficients.
See also:
getCoefficients();
int GCVSpline::getDegree (  )  const

Get the degree of this spline.

Returns:
Degree of spline: 1 = linear, 3 = cubic, 5 = quintic, 7 = heptic.
int GCVSpline::getHalfOrder (  )  const

Get the half order of this spline.

Returns:
Half order of spline: 1 = linear, 2 = cubic, 3 = quintic, 4 = heptic.
double GCVSpline::getMaxX (  )  const [virtual]

Get the maximum value of the independent variable.

Returns:
Maximum value of the independent variable.
double GCVSpline::getMinX (  )  const [virtual]

Get the minimum value of the independent variable.

Returns:
Minimum value of the independent variable.
virtual int OpenSim::GCVSpline::getNumberOfPoints (  )  const [inline, virtual]
int GCVSpline::getOrder (  )  const

Get the order of this spline.

Returns:
Order of spline: 2 = linear, 4 = cubic, 6 = quintic, 8 = heptic.
int GCVSpline::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 GCVSpline::getX ( int  aIndex  )  const [virtual]
const Array< double > & GCVSpline::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 * GCVSpline::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 GCVSpline::getY ( int  aIndex  )  const [virtual]
const double * GCVSpline::getYValues (  )  const [virtual]

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

Returns:
Pointer to the dependent variable data points.
virtual double OpenSim::GCVSpline::getZ ( int  aIndex  )  const [inline, virtual]
OpenSim::GCVSpline::OPENSIM_DECLARE_DERIVED ( GCVSpline  ,
Function   
)
GCVSpline & GCVSpline::operator= ( const GCVSpline aSpline  ) 

Assignment operator.

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

Returns:
Reference to this object.

Reimplemented from OpenSim::Function.

void GCVSpline::setDegree ( int  aDegree  ) 

Set the degree of this spline.

Parameters:
aDegree Degree of spline. Legal values: 1 = linear, 3 = cubic, 5 = quintic, 7 = heptic.
void GCVSpline::setX ( int  aIndex,
double  aValue 
) [virtual]
void GCVSpline::setY ( int  aIndex,
double  aValue 
) [virtual]
void GCVSpline::updateFromXMLNode (  )  [virtual]

Update this object based on its XML node.

Reimplemented from OpenSim::Object.


Member Data Documentation

Reference to the value of the Coefficients property.

Reference to the value of the ErrorVariance property.

Reference to the value of the HalfOrder property.

Spline coefficients.

Error variance for the data and spline fit.

The smoothing factor p is computed based on the error variance.

Half order of the spline (degree+1)/2.

Array of weight values, one for each data point.

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

This array must be monotonically increasing.

Spline Y values.

Array<double>& OpenSim::GCVSpline::_weights [protected]

Reference to the value of the Weights property.

std::vector<int> OpenSim::GCVSpline::_workDeriv [mutable, protected]

A workspace used when calculating derivatives of the spline.

Array<double>& OpenSim::GCVSpline::_x [protected]

Reference to the value of the X property.

Array<double>& OpenSim::GCVSpline::_y [protected]

Y (dependent) values of the function.

These are called aF in the constructor and are stored here so that the function can be scaled later on.


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

Generated on Wed Dec 16 15:03:40 2009 for OpenSim by  doxygen 1.6.1