|
template<class T > |
static Real | eval (const VecBase< T > &c, Real x) |
| Evaluate a polynomial at x. More...
|
|
template<class T > |
static tuple< T, int > | compress (const VecBase< T > &c, Real epsilon=Real_::epsilon) |
| Reduce the degree by eliminating all near-zero leading coefficients and by making the leading coefficient one. More...
|
|
template<class T > |
static auto | derivative (const VecBase< T > &c) -> honey::Vec<(T::s_size==matrix::dynamic?matrix::dynamic:T::s_size-1), Real > |
| Get the derivative of a polynomial. Returns a polynomial with 1 degree less. More...
|
|
static tuple< Real, int > | roots (const Vec2 &c, Real epsilon=Real_::epsilon) |
| Find roots using an algebraic closed form expression. Solves the linear equation: . More...
|
|
static tuple< Vec2, int > | roots (const Vec3 &c, Real epsilon=Real_::epsilon) |
| Solves the quadratic equation: . More...
|
|
static tuple< Vec3, int > | roots (const Vec4 &c, Real epsilon=Real_::epsilon) |
| Solves the cubic equation: . More...
|
|
static tuple< Vec4, int > | roots (const Vec5 &c, Real epsilon=Real_::epsilon) |
| Solves the quartic equation: . More...
|
|
static tuple< Vec, int > | roots (const Vec &c, Real epsilon=Real_::epsilon, int iterMax=30) |
| Find roots of generic polynomial using bisection. More...
|
|
static tuple< Vec, int > | rootsInRange (const Vec &c, Real min, Real max, Real epsilon=Real_::epsilon, int iterMax=30) |
| Find roots of generic polynomial within range using bisection. More...
|
|
template<class T > |
static tuple< Real, Real > | rootBounds (const VecBase< T > &c, Real epsilon=Real_::epsilon) |
| Get lower and upper bounds of root magnitudes. Returns positive range or 0 if polynomial is constant (degree 0). More...
|
|
template<class Real>
class honey::Polynomial< Real >
Polynomial algorithms.
A polynomial is represented by a vector of coefficients c
. The polynomial's degree is c.size()-1. The lowest degree is at the first index. ex.