Public Member Functions |
| cPolynom () |
virtual tY | evalue (const tX &x) const |
virtual void | print (ostream &outputStream) const |
virtual pair< unsigned long, tY > | evalueError (const vector< cDataPoint< tX, tY > > &vecInput) 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 > > &vecInput) const |
virtual tY | evalueErrorMax (const vector< cDataPointRange< tX, tY > > &vecData, const tY maxYError) const |
virtual vector
< cLinearEquation< tY > > | createLinearEquations (const vector< cDataPoint< tX, tY > > &vecData, unsigned int uiMaxPolynomOrder) const |
pair< cInequation< tY >
, cInequation< tY > > | createInequiationsForRangePoint (const cDataPointRange< tX, tY > &dataPoint, unsigned int uiPolynomOrder) const |
long | getLastFactorIndexNotNull () const |
virtual cUnderFunction * | toFibUnderFunction (cFibVariable *pVariable) const |
virtual bool | evalue (const vector< cDataPoint< tX, tY > > &vecInputData) |
virtual tY | findFunctionRand (const vector< cDataPointRange< tX, tY > > &vecInputData, unsigned long ulMaxIterations=256 *256 *256) |
virtual tY | evalueGoodPolynom (const vector< cDataPointRange< tX, tY > > &vecInputData, unsigned long ulTimeNeed=1024) |
virtual unsigned long | evalueSpline (const vector< cDataPointRange< tX, tY > > &vecInputData, unsigned int uiNumberOfParameters=4, const unsigned int uiMinBitsToStoreMantissa=1, const tY maxValue=1E+36, const unsigned long ulMaxMemoryCost=0) |
virtual unsigned long | evalueSplineIterativFast (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 cPolynom< tX, tY > &polynom) const |
virtual bool | operator!= (const cPolynom< tX, tY > &polynom) const |
template<class tX, class tY>
class fib::algorithms::nD1::cPolynom< tX, tY >
Definition at line 70 of file cPolynom.h.
template<class tX, class tY>
This method evalues the error of the given datapoints to the values this polynom evalues to.
The evaluation of the polynom will be done by evalue(). The error will just be counted, if it is greater than the SAVE_BOUNDERY.
- See also:
- evalue()
- Parameters:
-
vecInput | 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 polynom evalues to.
The evaluation of the polynom 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:
-
vecInput | 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 polynom evalues to. This function will stop the evaluation, if the maximum error maxYError was reached.
The evaluation of the polynom will be done by evalue(). The error will just be counted, if it is greater than the SAVE_BOUNDERY.
- See also:
- evalue()
- Parameters:
-
vecInput | 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 polynom evalues to. This function will stop the evaluation, if the maximum error maxYError was reached.
The evaluation of the polynom 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:
-
vecInput | 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::cPolynom< tX, tY >::evalueSpline |
( |
const vector< cDataPointRange< tX, tY > > & |
vecInputData, |
|
|
unsigned int |
uiNumberOfParameters = 4 , |
|
|
const unsigned int |
uiMinBitsToStoreMantissa = 1 , |
|
|
const tY |
maxValue = 1E+36 , |
|
|
const unsigned long |
ulMaxMemoryCost = 0 |
|
) |
| |
|
virtual |
This functions evalues a spline, which matches the given range vecInputData The vector vecData is the sorted vector vecInputData. vecData 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 ) <= vecData[i].maxY, for i = 0 till n, with n <= vecData.size() The first sorted n range data points will be matched by the spline. The first sorted n+1'th data points can't be matched by a spline/polynom with uiNumberOfParameters parameters. The evalued spline (this polynom) will have the form: y = vecFactors[ 0 ] + vecFactors[ 1 ] * x + vecFactors[ 2 ] * x^2 + ... + vecFactors[ uiNumberOfParameters - 1 ] * x^(uiNumberOfParameters - 1)
- See also:
- evalue()
-
evalueSplineIterativFast()
- Parameters:
-
vecInputData | the data which the returend polynom should match |
uiNumberOfParameters | 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 polynom will allways have parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size() |
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 sorted data points vecData[0] to vecData[ return - 1 ] will be matched by the spline
template<class tX, class tY>
virtual unsigned long fib::algorithms::nD1::cPolynom< tX, tY >::evalueSplineIterativFast |
( |
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 the given range data vecInputData The vector vecData is the sorted vector vecInputData. 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 ) <= vecData[i].maxY, for i = 0 till n, with n <= vecData.size() The first sorted n range data points will be matched by the spline. The first sorted n+1'th data points can't be matched by a spline/polynom with uiNumberOfParameters parameters. The evalued spline (this polynom) will have the form: y = vecFactors[ 0 ] + vecFactors[ 1 ] * x + vecFactors[ 2 ] * x^2 + ... + vecFactors[ uiNumberOfParameters - 1 ] * x^(uiNumberOfParameters - 1)
The method should give the same result as evalueSpline() but faster. It will iterativ increase the number of parameters for the spline (from 1 to uiMaxNumberOfParameters) and will try to not use all of the given range points to find the polynom.
- See also:
- evalue()
-
evalueSpline()
- Parameters:
-
vecInputData | the data which the returend polynom 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 polynom will allways have parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size() |
maxError | the maximal error for the polynom to find; the error on the interpolated polynom 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 sorted data points vecData[0] to vecData[ return - 1 ] will be matched by the spline