#include <CATCurveFit.h>
Fits a curve of the specified degree to a set of data. Based off the algorithm presented in "Introduction to Algorithms" Second Edition, by Cormen, Leiserson, Rivest, and Stein (MIT press)
Definition at line 28 of file CATCurveFit.h.
Public Member Functions | |
CATCurveFit (CATUInt32 curveDegree=3) | |
virtual | ~CATCurveFit () |
bool | AddPoint (CATFloat64 x, CATFloat64 y) |
Add a point to the interpolation data. | |
bool | Clear () |
Clear out all current data. | |
bool | GetDegree (CATUInt32 °ree) |
Get the polynomial degree. | |
bool | GetCoefficient (CATUInt32 deg, CATFloat64 &coef) |
Get a specific coefficient. | |
CATUInt32 | GetNumPoints () |
Get the number of data points acquired. | |
bool | GetDataPoint (CATUInt32 n, CATFloat64 &x, CATFloat64 &y) |
Get an individual data point. | |
bool | CalcYVal (CATFloat64 x, CATFloat64 &y) |
Calculate the Y val from a specified x val. | |
bool | GetCurrentErr (CATFloat64 &err) |
Get error value. | |
bool | GetMinMax (CATFloat64 &minX, CATFloat64 &minY, CATFloat64 &maxX, CATFloat64 &maxY) |
bool | LangrangianCalcY (CATFloat64 x, CATFloat64 &y) |
Protected Member Functions | |
bool | CalcFit () |
Protected Attributes | |
std::vector< CATPoint > | fPointList |
list of X points | |
std::vector< CATFloat64 > | fCoef |
list of coefficients (double's) | |
CATFloat64 | fLastErr |
last calculated err | |
CATUInt32 | fDegree |
Degree of coefficient to calculate with fit. | |
bool | fDirty |
Are the coefficients dirty? (i.e. need to call CalcFit?). |