The Polynomial3 class represents a cubic polynomial with real coefficients p(x) = c0 x^3 + c1 x^2 + c2 x + c3.
More...
#include <gz/math/Polynomial3.hh>
template<typename T>
class gz::math::Polynomial3< T >
The Polynomial3 class represents a cubic polynomial with real coefficients p(x) = c0 x^3 + c1 x^2 + c2 x + c3.
Example
#include <iostream>
int main(int argc, char **argv)
{
std::cout <<
"A default constructed polynomial is always: "
std::cout <<
"A constant polynomial only has an independent term: "
const double x = 0.5;
std::cout <<
"Evaluating " << p <<
" at " << x
std::cout <<
"The minimum of " << p <<
" in the " << interval
<<
" interval is " << p.Minimum(interval) <<
std::endl;
std::cout <<
"The minimum of " << q <<
" in the " << interval
<<
" interval is " << q.Minimum(interval) <<
std::endl;
}
◆ Polynomial3() [1/2]
◆ Polynomial3() [2/2]
Constructor.
- Parameters
-
[in] | _coeffs | coefficients c0 through c3, left to right |
◆ Coeffs()
Get the polynomial coefficients.
- Returns
- this polynomial coefficients
◆ Constant()
◆ Evaluate()
T Evaluate |
( |
const T & |
_x | ) |
const |
|
inline |
◆ Minimum() [1/4]
◆ Minimum() [2/4]
T Minimum |
( |
const Interval< T > & |
_interval | ) |
const |
|
inline |
Compute polynomial minimum in an _interval
- Parameters
-
[in] | _interval | polynomial argument interval to check |
- Returns
- the polynomial minimum in the given interval (may not be finite), or NaN if the interval is empty
References Polynomial3< T >::Minimum().
◆ Minimum() [3/4]
T Minimum |
( |
const Interval< T > & |
_interval, |
|
|
T & |
_xMin |
|
) |
| const |
|
inline |
◆ Minimum() [4/4]
T Minimum |
( |
T & |
_xMin | ) |
const |
|
inline |
Compute polynomial minimum.
- Parameters
-
[out] | _xMin | polynomial argument that yields minimum |
- Returns
- the polynomial minimum (may not be finite)
References Polynomial3< T >::Minimum().
◆ operator()()
T operator() |
( |
const T & |
_x | ) |
const |
|
inline |
◆ Print()
Prints polynomial as p(_x
) to _out
stream.
- Parameters
-
[in] | _out | Output stream to print to |
[in] | _x | Argument name to be used |
References numeric_limits::epsilon().
The documentation for this class was generated from the following file: