Polynomial functor: f(x) = sum(a[i] * x^i). Coefficients are stored in order: a[0] + a[1]*x + a[2]*x^2 + ...
More...
#include <MathUtils_FunctorScalar.hxx>
|
| | Polynomial (std::initializer_list< double > theCoeffs) |
| | Constructor from initializer list.
|
| | Polynomial (const math_Vector &theCoeffs) |
| | Constructor from math_Vector.
|
| bool | Value (double theX, double &theY) const |
| | Evaluates polynomial at theX using Horner's method.
|
| bool | Values (double theX, double &theY, double &theDY) const |
| | Evaluates polynomial and its derivative at theX.
|
| int | Degree () const |
| | Returns the degree of the polynomial.
|
| double | Coefficient (int theIndex) const |
| | Returns coefficient by index.
|
Polynomial functor: f(x) = sum(a[i] * x^i). Coefficients are stored in order: a[0] + a[1]*x + a[2]*x^2 + ...
Usage:
Polynomial functor: f(x) = sum(a[i] * x^i). Coefficients are stored in order: a[0] + a[1]*x + a[2]*x^...
Definition MathUtils_FunctorScalar.hxx:148
Polynomial(std::initializer_list< double > theCoeffs)
Constructor from initializer list.
Definition MathUtils_FunctorScalar.hxx:152
◆ Polynomial() [1/2]
| MathUtils::Polynomial::Polynomial |
( |
std::initializer_list< double > | theCoeffs | ) |
|
|
inline |
Constructor from initializer list.
- Parameters
-
| theCoeffs | coefficients in ascending power order |
◆ Polynomial() [2/2]
| MathUtils::Polynomial::Polynomial |
( |
const math_Vector & | theCoeffs | ) |
|
|
inlineexplicit |
Constructor from math_Vector.
- Parameters
-
| theCoeffs | coefficients in ascending power order |
◆ Coefficient()
| double MathUtils::Polynomial::Coefficient |
( |
int | theIndex | ) |
const |
|
inline |
Returns coefficient by index.
- Parameters
-
| theIndex | coefficient index (0 = constant term) |
- Returns
- coefficient value
◆ Degree()
| int MathUtils::Polynomial::Degree |
( |
| ) |
const |
|
inline |
Returns the degree of the polynomial.
- Returns
- polynomial degree (number of coefficients - 1)
◆ Value()
| bool MathUtils::Polynomial::Value |
( |
double | theX, |
|
|
double & | theY ) const |
|
inline |
Evaluates polynomial at theX using Horner's method.
- Parameters
-
| [in] | theX | input value |
| [out] | theY | polynomial value p(theX) |
- Returns
- true (always succeeds for polynomials)
◆ Values()
| bool MathUtils::Polynomial::Values |
( |
double | theX, |
|
|
double & | theY, |
|
|
double & | theDY ) const |
|
inline |
Evaluates polynomial and its derivative at theX.
- Parameters
-
| [in] | theX | input value |
| [out] | theY | polynomial value p(theX) |
| [out] | theDY | derivative value p'(theX) |
- Returns
- true (always succeeds for polynomials)
The documentation for this class was generated from the following file: