RobWorkProject
23.9.11-
|
Representation of a polynomial that can have non-scalar coefficients (polynomial matrix). More...
#include <PolynomialND.hpp>
Inherited by Polynomial< std::complex< double > >.
Public Member Functions | |
PolynomialND (std::size_t order) | |
Create polynomial with uninitialized coefficients. More... | |
PolynomialND (const std::vector< Coef > &coefficients) | |
Create polynomial from vector. More... | |
PolynomialND (const PolynomialND< Coef, Scalar > &p) | |
Create polynomial from other polynomial. More... | |
virtual | ~PolynomialND () |
Destructor. | |
std::size_t | order () const |
Get the order of the polynomial (the highest power). More... | |
void | increaseOrder (std::size_t increase, const Coef &value) |
Increase the order of this polynomial. More... | |
void | increaseOrder (std::size_t increase=1) |
Increase the order of this polynomial. More... | |
Coef | evaluate (const Scalar &x) const |
Evaluate the polynomial using Horner's Method. More... | |
std::vector< Coef > | evaluateDerivatives (const Scalar &x, std::size_t n=1) const |
Evaluate the first n derivatives of the polynomial using Horner's Method. More... | |
PolynomialND< Coef, Scalar > | deflate (const Scalar &x) const |
Perform deflation of polynomial. More... | |
PolynomialND< Coef, Scalar > | derivative (std::size_t n=1) const |
Get the derivative polynomial. More... | |
const PolynomialND< Coef, Scalar > | operator- () const |
Negate coefficients. More... | |
bool | operator== (const PolynomialND< Coef, Scalar > &b) const |
Check if polynomials are equal. More... | |
Coefficient access operators. | |
Operators used to access coefficients. | |
const Coef & | operator() (std::size_t i) const |
Get specific coefficient. More... | |
Coef & | operator() (size_t i) |
Get specific coefficient. More... | |
const Coef & | operator[] (size_t i) const |
Get specific coefficient. More... | |
Coef & | operator[] (size_t i) |
Get specific coefficient. More... | |
Arithmetic operators between polynomials. | |
Operators used to do arithmetic between two polynomials. | |
const PolynomialND< Coef, Scalar > | operator- (const PolynomialND< Coef, Scalar > &b) const |
Polynomial subtraction. More... | |
PolynomialND< Coef, Scalar > & | operator-= (const PolynomialND< Coef, Scalar > &b) |
Polynomial subtraction. More... | |
const PolynomialND< Coef, Scalar > | operator+ (const PolynomialND< Coef, Scalar > &b) const |
Polynomial addition. More... | |
PolynomialND< Coef, Scalar > & | operator+= (const PolynomialND< Coef, Scalar > &b) |
Polynomial addition. More... | |
template<typename OutCoef , typename Coef2 = Coef> | |
PolynomialND< OutCoef, Scalar > | multiply (const PolynomialND< Coef2, Scalar > &b) const |
Polynomial multiplication. More... | |
template<typename OutCoef , typename Coef2 = Coef> | |
PolynomialND< OutCoef, Scalar > | multiply (const Coef2 &b) const |
Multiply with a coefficient. More... | |
void | operator= (const PolynomialND< Coef, Scalar > &b) |
Assignment. More... | |
Protected Attributes | |
std::vector< Coef > | _coef |
The coefficient vector. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const PolynomialND< Coef, Scalar > &p) |
Printing polynomial to stream. More... | |
Arithmetic operators between polynomial and scalars. | |
const PolynomialND< Coef, Scalar > | operator* (Scalar s) const |
Scalar multiplication. More... | |
const PolynomialND< Coef, Scalar > | operator/ (Scalar s) const |
Scalar division. More... | |
PolynomialND< Coef, Scalar > & | operator*= (Scalar s) |
Scalar multiplication. More... | |
PolynomialND< Coef, Scalar > & | operator/= (Scalar s) |
Scalar division. More... | |
const PolynomialND< Coef, Scalar > | operator* (Scalar s, const PolynomialND< Coef, Scalar > &p) |
Scalar multiplication. More... | |
Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).
Representation of a polynomial of the following form:
\( f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0 \)
The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \( {c_0,c_1,...,c_n}\).
|
inlineexplicit |
Create polynomial with uninitialized coefficients.
order | [in] the order of the polynomial. |
|
inline |
Create polynomial from vector.
coefficients | [in] the coefficients ordered from lowest-order term to highest-order term. |
|
inline |
Create polynomial from other polynomial.
p | [in] the polynomial to copy. |
|
inline |
Perform deflation of polynomial.
x | [in] a root of the polynomial. |
|
inline |
Get the derivative polynomial.
n | [in] gives the n'th derivative (default is n=1). |
|
inline |
Evaluate the polynomial using Horner's Method.
x | [in] the input parameter. |
|
inline |
Evaluate the first n derivatives of the polynomial using Horner's Method.
x | [in] the input parameter. |
n | [in] the number of derivatives to find (default is the first derivative only) |
|
inline |
Increase the order of this polynomial.
increase | [in] how much to increase the order (default is 1). |
value | [in] initialize new coefficients to this value. |
|
inline |
Increase the order of this polynomial.
increase | [in] how much to increase the order (default is 1). |
|
inline |
Multiply with a coefficient.
Each coefficient is post-multiplied with the given coefficient.
b | [in] coefficient to multiply with. Post-multiplication is used - the dimensions must match. |
|
inline |
Polynomial multiplication.
A convolution of the coefficients is used. Notice that more efficient algorithms exist for polynomials with scalar coefficients.
b | [in] polynomial to multiply. Post-multiplication is used - the dimensions must match. |
|
inline |
Get specific coefficient.
i | [in] the power of the term to get coefficient for. |
|
inline |
Get specific coefficient.
i | [in] the power of the term to get coefficient for. |
|
inline |
Scalar multiplication.
s | [in] scalar to multiply with. |
|
inline |
Scalar multiplication.
s | [in] the scalar to multiply with. |
|
inline |
|
inline |
Polynomial addition.
b | [in] polynomial to add. |
|
inline |
Negate coefficients.
|
inline |
Polynomial subtraction.
b | [in] polynomial of to subtract. |
|
inline |
Polynomial subtraction.
b | [in] polynomial to subtract. |
|
inline |
Scalar division.
s | [in] scalar to divide with. |
|
inline |
Scalar division.
s | [in] the scalar to divide with. |
|
inline |
Assignment.
b | [in] the polynomial to take coefficients from. |
|
inline |
Check if polynomials are equal.
b | [in] the polynomial to compare with. |
|
inline |
Get specific coefficient.
i | [in] the power of the term to get coefficient for. |
|
inline |
Get specific coefficient.
i | [in] the power of the term to get coefficient for. |
|
inline |
Get the order of the polynomial (the highest power).
|
friend |
Scalar multiplication.
s | [in] scalar to multiply with. |
p | [in] polynomial to multiply with. |
|
friend |
Printing polynomial to stream.
out | [in/out] the stream to write to. |
p | [in] the polynomail to print. |