#include <rdGCVSpline.h>
Inheritance diagram for rdGCVSpline:

Public Member Functions | |
| rdGCVSpline () | |
| Default constructor. | |
| rdGCVSpline (int aDegree, int aN, const double *aTimes, const double *aValues, const char *aName=NULL, double aErrorVariance=0.0) | |
| Construct a spline of a specified degree given arrays of paired data points (x,f(x)). | |
| rdGCVSpline (IDOM_Element *aElement) | |
| Construct a function from an XML Element. | |
| rdGCVSpline (const rdGCVSpline &aSpline) | |
| Copy constructor. | |
| virtual | ~rdGCVSpline () |
| Destructor. | |
| virtual rdFunction * | copy () const |
| Copy this object. | |
| virtual rdFunction * | copy (IDOM_Element *aElement) const |
| Copy this object and modify the copy so that it is consistent with a specified XML element node. | |
| rdGCVSpline & | operator= (const rdGCVSpline &aSpline) |
| Assignment operator. | |
| void | setDegree (int aDegree) |
| Set the degree of this spline. | |
| int | getDegree () |
| Get the degree of this spline. | |
| int | getOrder () |
| Get the order of this spline. | |
| int | getHalfOrder () |
| Get the half order of this spline. | |
| int | getN () |
| Get the number of data points (or number of coefficients) used to construct the spline. | |
| double | getMinX () |
| Get the minimum value of the independent variable. | |
| double | getMaxX () |
| Get the maximum value of the independent variable. | |
| const double * | getX () |
| Get the array of independent variables used to construct the spline. | |
| int | getNW () |
| const double * | getWorkArray () |
| const double * | getCoefficients () |
| Get the array of coefficients for the spline. | |
| virtual void | updateBoundingBox () |
| Update the bounding box for this function. | |
| virtual double | evaluate (int aDerivOrder, double aX=0.0, double aY=0.0, double aZ=0.0) |
| Evaluate this function or a derivative of this function given a set of independent variables. | |
| virtual void | updateObject (bool aDeep=true) |
| Update this object based on its XML node. | |
| virtual void | updateNode (bool aDeep=true) |
| Update the XML node representing this object. | |
| virtual void | generateNode (IDOM_Element *aParent) |
| Generate an XML node representing this object. | |
| void | updateData () |
| Update the member data of this object based on its XML node. | |
Static Public Attributes | |
| const char | PROP_HALF_ORDER [] = "half_order" |
| const char | PROP_ERROR_VARIANCE [] = "error_variance" |
| const char | PROP_X [] = "x" |
| const char | PROP_COEFF [] = "coefficents" |
| const char | PROP_WEIGHTS [] = "weights" |
| const char | PROP_WK [] = "wk" |
Protected Attributes | |
| int | _halfOrder |
| Half order of the spline (degree+1)/2. | |
| int | _n |
| Number of data points. | |
| double * | _x |
| Array of values for the independent variables (i.e., the spline knot sequence). | |
| double * | _weights |
| Array of weight values, one for each data point. | |
| double * | _coefficients |
| Spline coefficients. | |
| double | _errorVariance |
| Error variance for the data and spline fit. | |
| int | _knotIndex |
| Knot index used to fascilitate finding the appropriate knot during an evaluation. | |
| int | _nw |
| Size of the work array for contructing the spline. | |
| double * | _wk |
| Work array for construction of the spline. | |
| double * | _workEval |
| Work array for evaluating the spline. | |
Private Member Functions | |
| void | setNull () |
| Set all member variables to their NULL or default values. | |
| void | setEqual (const rdGCVSpline &aSpline) |
| Set all member variables equal to the members of another object. | |
Linear, cubic, qunitic, and heptic splines are supported:
m (half-order) order degree description 1 2 1 linear 2 4 3 cubic 3 6 5 quintic 4 8 7 heptic
This class wraps the gcvspl.c source code written by D. Twisk in 1994, which is based on the GCVSPL code written in Fortran by Woltring in 1985_07_04. This class was initially based on a spline class authored by Darryl Thelen and Victor Ng; it has been rewritten to fit into the Realistic Dynamics, Inc. software framework.
See the following source for details on how the GCV spline is fit: Woltring, H.J. (1986). A Fortran package for generalized, cross-validatory spline smoothing and differentiation. Advances in Engineering Software, Vol. 8, No. 2, 104-113.
This class inherits from rdFunction and so can be used as input to any class requiring an rdFuction as input.
|
||||||||||||||||||||||||||||
|
Construct a spline of a specified degree given arrays of paired data points (x,f(x)). A name for the spline may be specified.
|
|
|
Construct a function from an XML Element.
|
|
|
Copy constructor. All data members of the specified spline are copied.
|
|
|
Copy this object and modify the copy so that it is consistent with a specified XML element node. The copy is constructed by first using rdGCVSpline::rdGCVSpline(IDOM_Element*) in order to establish the XML node. Then, the assignment operator is used to set all data members of the copy to the values of this object. Finally, the data members of the copy are updated using rdGCVSpline::updateObject().
Implements rdFunction. |
|
|
Copy this object.
Implements rdFunction. |
|
||||||||||||||||||||
|
Evaluate this function or a derivative of this function given a set of independent variables. Only splines of one dimension are supported by this class, so values of independent variables y and z are ignored.
Implements rdFunction. |
|
|
Generate an XML node representing this object.
Reimplemented from rdFunction. |
|
|
Get the array of coefficients for the spline. For the number of coefficients use getNX().
|
|
|
Get the degree of this spline.
|
|
|
Get the half order of this spline.
|
|
|
Get the maximum value of the independent variable.
|
|
|
Get the minimum value of the independent variable.
|
|
|
Get the number of data points (or number of coefficients) used to construct the spline.
|
|
|
Get the order of this spline.
|
|
|
Get the array of independent variables used to construct the spline. For the number of independent variable data points use getN().
|
|
|
Assignment operator. Note that data members of the base class are also assigned.
|
|
|
Set the degree of this spline.
|
|
|
Set all member variables equal to the members of another object. Note that this method is private. It is only meant for copying the data members defined in this class. It does not, for example, make any changes to data members of base classes. |
|
|
Update the bounding box for this function. For an rdGCVSpline, there is only one indepdendent variable x, so the minimum and maximum values of indepdent variables y and z is 0.0. When this method is called, the minimum and maximum x of the bounding box is simply set to the minimum and maximum values of the x data points that were used to construct the spline, that is, min x = x[0] and max x = x[getN()-1].
Implements rdFunction. |
|
|
Update the member data of this object based on its XML node. Member objects (children) are not updated. Reimplemented from rdFunction. |
|
|
Update the XML node representing this object.
Reimplemented from rdFunction. |
|
|
Update this object based on its XML node.
Reimplemented from rdFunction. |
|
|
Error variance for the data and spline fit. The smoothing factor p is computed based on the error variance. |
|
|
Array of values for the independent variables (i.e., the spline knot sequence). This array must be monotonically increasing. |
1.3