Robotics Library
0.7.0
|
A vector-valued polynomial function from Real -> T. More...
#include <Polynomial.h>
Public Member Functions | |
Polynomial (const ::std::size_t °ree) | |
virtual | ~Polynomial () |
Polynomial * | clone () const |
T & | coefficient (const ::std::size_t &i) |
const T & | coefficient (const ::std::size_t &i) const |
::std::size_t | degree () const |
Polynomial | derivative () const |
T | getAbsoluteMaximum () const |
Returns the array of the maximum function values of each dimension within the definition range, not regarding the sign of the function values. More... | |
Polynomial | integral () const |
T | operator() (const Real &x, const ::std::size_t &derivative=0) const |
Evaluates the function or a derivative thereof for a given value x. More... | |
Polynomial | operator+ (const Polynomial &rhs) const |
Polynomial & | operator+= (const T &rhs) |
Polynomial & | operator+= (const Polynomial &rhs) |
Polynomial | operator- () const |
Polynomial | operator- (const Polynomial &rhs) const |
Polynomial & | operator-= (const T &rhs) |
Polynomial & | operator-= (const Polynomial &rhs) |
Polynomial & | operator*= (const Real &rhs) |
Polynomial & | operator/= (const Real &rhs) |
static ::std::vector< Real > | realRoots (const ::std::vector< Real > &c) |
Calculates the real roots (or, zeros) for given polynomial coefficients. More... | |
Polynomial | scaledX (const Real &factor) const |
Stretches the x-axis of a polynomial by a given factor. More... | |
Polynomial | translatedX (const Real &translation) const |
Translates a polynomial along the x-axis by a given parameter translation. More... | |
Public Member Functions inherited from rl::math::Function< T > | |
Function () | |
virtual | ~Function () |
Real | duration () const |
Real & | lower () |
const Real & | lower () const |
Real & | upper () |
const Real & | upper () const |
Static Public Member Functions | |
static Polynomial | CubicFirst (const T &y0, const T &y1, const T &yd0, const T &yd1, const Real &x1=1) |
static Polynomial | CubicSecond (const T &y0, const T &y1, const T &ydd0, const T &ydd1, const Real &x1=1) |
static Polynomial | Linear (const T &y0, const T &y1, const Real &x1=1) |
static Polynomial | Quadratic (const T &y0, const T &y1, const T &yd0, const Real &x1=1) |
static Polynomial | QuarticFirstSecond (const T &y0, const T &y1, const T &yd0, const T &yd1, const T &ydd0, const Real &x1=1) |
static Polynomial | QuinticFirstSecond (const T &y0, const T &y1, const T &yd0, const T &yd1, const T &ydd0, const T &ydd1, const Real &x1=1) |
static Polynomial | SepticFirstSecondThird (const T &y0, const T &y1, const T &yd0, const T &yd1, const T &ydd0, const T &ydd1, const T &yddd0, const T &yddd1, const Real &x1=1) |
static Polynomial | SexticFirstSecondThird (const T &y0, const T &y1, const T &yd0, const T &yd1, const T &ydd0, const T &ydd1, const T &yddd0, const Real &x1=1) |
Protected Attributes | |
::std::vector< T > | c |
Protected Attributes inherited from rl::math::Function< T > | |
Real | x0 |
Real | x1 |
Friends | |
Polynomial | operator+ (const T &lhs, const Polynomial &rhs) |
Polynomial | operator+ (const Polynomial &lhs, const T &rhs) |
Polynomial | operator- (const T &lhs, const Polynomial &rhs) |
Polynomial | operator- (const Polynomial &lhs, const T &rhs) |
Polynomial | operator* (const Real &lhs, const Polynomial &rhs) |
Polynomial | operator* (const Polynomial &lhs, const Real &rhs) |
Polynomial | operator/ (const Real &lhs, const Polynomial &rhs) |
Polynomial | operator/ (const Polynomial &lhs, const Real &rhs) |
A vector-valued polynomial function from Real -> T.
A Polynomial is indefinitely often differentiable and can be evaluated efficiently.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Implements rl::math::Function< T >.
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
Returns the array of the maximum function values of each dimension within the definition range, not regarding the sign of the function values.
For polynomials higher than cubics, Eigen::PolynomialSolver is required and calculations become iterative, without guaranteeing convergence. A common use case is to verify speed limits with the comparison (trajectory.derivate().getAbsoluteMaximum() < maximumSpeed).all()
|
inline |
|
inlinestatic |
|
inlinevirtual |
Evaluates the function or a derivative thereof for a given value x.
Some functions are only defined in the interval [lower(), upper()], and fail to evaluate outside of [lower() - FUNCTION_BOUNDARY, upper() + FUNCTION_BOUNDARY]. In Debug mode, this is signaled by failing asserts. In Release mode, the function is evaluated if algebraically possible, or will return an empty ArrayX otherwise. Some functions are not indefinitely often differentiable, and will return a NaN array for all higher orders.
[in] | x | Input value of the function or derivative |
[in] | derivative | Order of the derivative to be evaluated |
Implements rl::math::Function< T >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Calculates the real roots (or, zeros) for given polynomial coefficients.
For degrees higher than 3, Eigen::PolynomialSolver is required and calculations become iterative, without guaranteeing convergence.
|
inline |
Stretches the x-axis of a polynomial by a given factor.
The returned, scaled polynomial p' of a given polynomial p fulfills p'(x * factor) = p(x), and p'.duration() = factor * p.duration(). This is done by recalculating the underlying polynomial coefficients.
|
inlinestatic |
|
inlinestatic |
|
inline |
Translates a polynomial along the x-axis by a given parameter translation.
The returned polynomial p' for a given polynomial p fulfills p'(x - translation) = p(x) This is done by recalculating the underlying polynomial coefficients.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |