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 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
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
◆ 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()
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()
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: