Public Member Functions |
| cSpline () |
virtual tY | evalue (const tX &x) const |
virtual void | print (ostream &outputStream) const |
virtual pair< unsigned long, tY > | evalueError (const vector< cDataPoint< tX, tY > > &vecInputData) const |
virtual tY | evalueErrorMax (const vector< cDataPoint< tX, tY > > &vecData, const tY maxYError) const |
virtual pair< unsigned long, tY > | evalueError (const vector< cDataPointRange< tX, tY > > &vecInputData) const |
virtual tY | evalueErrorMax (const vector< cDataPointRange< tX, tY > > &vecData, const tY maxYError) const |
virtual cUnderFunction * | toFibUnderFunction (cFibVariable *pVariable) const |
virtual bool | evalue (const vector< cDataPoint< tX, tY > > &vecData) |
virtual unsigned long | evalueSpline (const vector< cDataPointRange< tX, tY > > &vecInputData, unsigned int uiMaxNumberOfParameters=4, const unsigned int uiMinBitsToStoreMantissa=1, const tY maxValue=1E+36, const tY maxError=0, const unsigned long ulMaxMemoryCost=0) |
virtual bool | operator== (const cSpline< tX, tY > &spline) const |
virtual bool | operator!= (const cSpline< tX, tY > &spline) const |
const vector< cPolynom< tX, tY > > * | getPolynoms () const |
const vector< tY > * | getBorders () const |
template<class tX, class tY>
class fib::algorithms::nD1::cSpline< tX, tY >
Definition at line 67 of file cSpline.h.
template<class tX, class tY>
This method evalues the error of the given datapoints to the values this spline evalues to.
The evaluation of the spline will be done by evalue(). The error will just be counted, if it is greater than the SAVE_BOUNDERY.
- See also:
- evalue()
- Parameters:
-
vecInputData | the data for wich the error is to evalue |
- Returns:
- a pair with two values:
- the first value is the number of datapoints evalued wrong
- the second value is the sum of the error of all datapoints
Implements fib::algorithms::nD1::cOneAryFunction< tX, tY >.
template<class tX, class tY>
This method evalues the error of the given range datapoints to the values this spline evalues to.
The evaluation of the spline will be done by evalue(). A datapoint has an error, if it lay outside the datpoint range. The error is it's distance to the neares datapoint boundery. The error will just be counted, if it is greater than the SAVE_BOUNDERY.
- See also:
- evalue()
- Parameters:
-
vecInputData | the data for wich the error is to evalue |
- Returns:
- a pair with two values:
- the first value is the number of datapoints evalued wrong
- the second value is the sum of the error of all datapoints
Implements fib::algorithms::nD1::cOneAryFunction< tX, tY >.
template<class tX, class tY>
This method evalues the error of the given datapoints to the values this spline evalues to. This function will stop the evaluation, if the maximum error maxYError was reached.
The evaluation of the spline will be done by evalue(). The error will just be counted, if it is greater than the SAVE_BOUNDERY.
- See also:
- evalue()
- Parameters:
-
vecInputData | the data for wich the error is to evalue |
maxYError | the maximum error, at which the evaluation should stop; if maxYError is 0 the maximum error is unlimeted |
- Returns:
- the sum of the error of all datapoints, but maximal maxYError
Implements fib::algorithms::nD1::cOneAryFunction< tX, tY >.
template<class tX, class tY>
This method evalues the error of the given datapoints to the values this spline evalues to. This function will stop the evaluation, if the maximum error maxYError was reached.
The evaluation of the spline will be done by evalue(). A datapoint has an error, if it lay outside the datpoint range. The error is it's distance to the neares datapoint boundery. The error will just be counted, if it is greater than the SAVE_BOUNDERY.
- See also:
- evalue()
- Parameters:
-
vecInputData | the data for wich the error is to evalue |
maxYError | the maximum error, at which the evaluation should stop; if maxYError is 0 the maximum error is unlimeted |
- Returns:
- the sum of the error of all datapoints, but maximal maxYError
Implements fib::algorithms::nD1::cOneAryFunction< tX, tY >.
template<class tX, class tY>
virtual unsigned long fib::algorithms::nD1::cSpline< tX, tY >::evalueSpline |
( |
const vector< cDataPointRange< tX, tY > > & |
vecInputData, |
|
|
unsigned int |
uiMaxNumberOfParameters = 4 , |
|
|
const unsigned int |
uiMinBitsToStoreMantissa = 1 , |
|
|
const tY |
maxValue = 1E+36 , |
|
|
const tY |
maxError = 0 , |
|
|
const unsigned long |
ulMaxMemoryCost = 0 |
|
) |
| |
|
virtual |
This functions evalues a spline, which matches all points of the given range data vecData (if possible). The y value, to wich the spline evalues the x value, will be in the bound of the range data point, so that: vecData[i].minY <= spline( vecData[i].x ) + error_i <= vecData[i].maxY, with maxError <= sum error_i for i = 0 till vecData.size()
The evalued spline (this spline) consists of a number of polynoms seperated by border points. The evalued polynoms (
- See also:
- cPolynom) will have the form: y = vecFactors[ 0 ] + vecFactors[ 1 ] * x + vecFactors[ 2 ] * x^2 + ... + vecFactors[ uiNumberOfParameters - 1 ] * x^(uiNumberOfParameters - 1) The upper border point of a polynom is the first point at wich the polynom dosn't match the given data vecData anymore.
The method will iterativ increase the number of parameters for the polynoms (from 1 to uiMaxNumberOfParameters) and will try to not use all of the given range points to find the polynoms.
- See also:
- evalue()
-
cPolynom::evalueSplineIterativFast()
- Parameters:
-
vecInputData | the data which the returend spline should match |
uiMaxNumberOfParameters | the number of parameters for the spline; Don't choose this number to big, because the evaluation time will grow exponentialy with this number. Even splines with 8 parameters will take some time. |
uiMinBitsToStoreMantissa | the minimal number of bits to store the mantissa of the parameters, when the parameter is in the form: mantissa * 2^exponent ; the method will try to reduce the bits, to store a parameter of the returned vector, to the uiMinBitsToStoreMantissa value; if uiMinBitsToStoreMantissa is 0, no optimization for the mantissa bits will be done |
maxValue | the maximum possible value in all parameters the evalued spline will allways have parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size() |
maxError | the maximal error for the spline to find; the error on the interpolated spline for vecData will be equal or less than maxError |
ulMaxMemoryCost | a number for the maximum memory cost this method is allowed to use; if 0 the maximum memory cost is unbounded |
- Returns:
- the number n of data points vecData, which the spline matches; the data points vecData[0] to vecData[ return - 1 ] will be matched by the spline