#include <GCVSpline.h>
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 Object * | copy () const |
Copy this object. | |
virtual void | updateFromXMLNode () |
Update this object based on its XML node. | |
GCVSpline & | operator= (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. |
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.
aSpline | GCVSpline object to be copied. |
GCVSpline::~GCVSpline | ( | ) | [virtual] |
Destructor.
int GCVSpline::addPoint | ( | double | aX, | |
double | aY | |||
) | [virtual] |
Object * GCVSpline::copy | ( | ) | const [virtual] |
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().
int GCVSpline::getDegree | ( | ) | const |
Get the degree of this spline.
int GCVSpline::getHalfOrder | ( | ) | const |
Get the half order of this spline.
double GCVSpline::getMaxX | ( | ) | const [virtual] |
Get the maximum value of the independent variable.
double GCVSpline::getMinX | ( | ) | const [virtual] |
Get the minimum value of the independent variable.
virtual int OpenSim::GCVSpline::getNumberOfPoints | ( | ) | const [inline, virtual] |
int GCVSpline::getOrder | ( | ) | const |
Get the order of this spline.
int GCVSpline::getSize | ( | ) | const |
Get size or number of independent data points (or number of coefficients) used to construct the spline.
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().
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().
double GCVSpline::getY | ( | int | aIndex | ) | const [virtual] |
const double * GCVSpline::getYValues | ( | ) | const [virtual] |
Get the array of dependent variables used to construct the spline.
virtual double OpenSim::GCVSpline::getZ | ( | int | aIndex | ) | const [inline, virtual] |
Assignment operator.
Note that data members of the base class are also assigned.
Reimplemented from OpenSim::Function.
void GCVSpline::setDegree | ( | int | aDegree | ) |
Set the degree of this spline.
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.
Array<double>& OpenSim::GCVSpline::_coefficients [protected] |
Reference to the value of the Coefficients property.
double& OpenSim::GCVSpline::_errorVariance [protected] |
Reference to the value of the ErrorVariance property.
int& OpenSim::GCVSpline::_halfOrder [protected] |
Reference to the value of the HalfOrder property.
Spline coefficients.
PropertyDbl OpenSim::GCVSpline::_propErrorVariance [protected] |
Error variance for the data and spline fit.
The smoothing factor p is computed based on the error variance.
PropertyInt OpenSim::GCVSpline::_propHalfOrder [protected] |
Half order of the spline (degree+1)/2.
PropertyDblArray OpenSim::GCVSpline::_propWeights [protected] |
Array of weight values, one for each data point.
PropertyDblArray OpenSim::GCVSpline::_propX [protected] |
Array of values for the independent variables (i.e., the spline knot sequence).
This array must be monotonically increasing.
PropertyDblArray OpenSim::GCVSpline::_propY [protected] |
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.