|
| | Polynom ()=default |
| | decault constructs the polynomials with the default values of their data type
|
| |
| | Polynom (const Polynom &)=default |
| | Copy constructor.
|
| |
template<int OtherOrder>
requires (OtherOrder < Order) |
| | Polynom (const Polynom< T, OtherOrder > &other) |
| |
template<class... Args>
requires (Order != Eigen::Dynamic && (std::convertible_to<Args, T> && ...)) |
| | Polynom (Args &&... args) |
| |
template<class... Args>
requires (Order == Eigen::Dynamic && (std::convertible_to<Args, T> && ...)) |
| | Polynom (Args &&... args) |
| |
| Polynom & | operator= (const Polynom &)=default |
| | Copy assignment operator from polynomials with equal compile time size.
|
| |
template<int M>
requires (M < Order) |
| Polynom & | operator= (const Polynom< T, M > &other) |
| | Copy assignment from polynomials with smaller compile time size.
|
| |
template<int M>
requires ((Order != Eigen::Dynamic) && (M == Order+1)) |
| | Polynom (const T(&array)[M]) |
| | Constructs a polynomial from an array.
|
| |
template<int M>
requires ((Order != Eigen::Dynamic) && (M < Order+1)) |
| | Polynom (const T(&array)[M]) |
| | Constructs a polynomial from an array.
|
| |
| | Polynom (const T *values, size_t length) |
| | Constructs a dynamically sized polynomial from an array.
|
| |
template<int M>
requires (Order == Eigen::Dynamic) |
| | Polynom (const T(&array)[M]) |
| | Constructs a dynamically sized polynomial from an array.
|
| |
template<int M>
requires ((Order != Eigen::Dynamic) && (M != Eigen::Dynamic) && (M == Order+1)) |
| | Polynom (const Eigen::Vector< T, M > &vector) |
| | Constructs a polynomial from a vector.
|
| |
template<class U >
requires (std::constructible_from<Eigen::Vector<T, eigen_vector_size>, U>) |
| | Polynom (const U &vector_expression) |
| |
template<int M>
requires ((Order != Eigen::Dynamic) && (M != Eigen::Dynamic) && (M < Order+1)) |
| | Polynom (const Eigen::Vector< T, M > &vector) |
| |
template<std::same_as< T > U>
requires (Order == Eigen::Dynamic) |
| | Polynom (const Eigen::Vector< U, Eigen::Dynamic > &vector) |
| |
template<int M>
requires (Order == Eigen::Dynamic && M != Eigen::Dynamic) |
| | Polynom (const Eigen::Vector< T, M > &vector) |
| |
| const T & | at (size_t i) const |
| | Access elements at the i-th position.
|
| |
| T & | at (size_t i) |
| | Access elements at the i-th position.
|
| |
| const T & | operator[] (size_t i) const |
| | Access elements at the i-th position.
|
| |
| T & | operator[] (size_t i) |
| | Access elements at the i-th position.
|
| |
| vector_type & | vector () |
| | Returns the underlying vector that holds the values.
|
| |
| const vector_type & | vector () const |
| | Returns the underlying vector that holds the values.
|
| |
| size_t | size () const |
| | returns the size of the polynomial
|
| |
| size_t | order () const |
| | returns the order of the polynomial
|
| |
| void | setZero () |
| | sets all entries to zero
|
| |
| T | eval (const T &x) const |
| | Evaluates the polynomial at position x.
|
| |
| T | operator() (const T &x) const |
| | Evaluates the polynomial at position x
|
| |
| template<int M> |
| Eigen::Vector< T, M > | eval (const Eigen::Vector< T, M > &x_vec) const |
| | Evaluates the polynomial at positions of the vector x_vec
|
| |
| template<int M> |
| Eigen::Vector< T, M > | operator() (const Eigen::Vector< T, M > &x_vec) const |
| | Evaluates the polynomial at positions of the vector x_vec
|
| |
| std::complex< T > | eval (const std::complex< T > &x) const |
| | Evaluates the polynomial at position x.
|
| |
| std::complex< T > | operator() (const std::complex< T > &x) const |
| | Evaluates the polynomial at position x
|
| |
| template<int M> |
| Eigen::Vector< std::complex< T >, M > | eval (const Eigen::Vector< std::complex< T >, M > &x_vec) const |
| | Evaluates the polynomial at positions of the vector x_vec
|
| |
| template<int M> |
| Eigen::Vector< std::complex< T >, M > | operator() (const Eigen::Vector< std::complex< T >, M > &x_vec) const |
| | Evaluates the polynomial at positions of the vector x_vec
|
| |
| bool | is_zero (T epsilon=std::numeric_limits< T >::min()) const |
| | Checks if every element in the polynomial is zero.
|
| |
| void | print (std::ostream &stream, std::string_view var="x") const |
| | prints polynomial to an output character stream with a variale
|
| |
| void | print (std::ostream &stream, std::function< std::string(int i)> var) const |
| |
template<int M>
requires (M <= Order) |
| Polynom & | operator+= (const Polynom< T, M > &other) |
| |
template<int M>
requires (M <= Order) |
| Polynom & | operator-= (const Polynom< T, M > &other) |
| |
| template<std::convertible_to< T > U> |
| Polynom & | operator*= (const U &num) |
| |
| template<std::convertible_to< T > U> |
| Polynom & | operator/= (const U &num) |
| |
template<class T, int Order>
class controlpp::Polynom< T, Order >
Describes a mathematical polynomial.
Describes polynomials in the form of:
\[
a_1 + a_2 x + a_3 x^2 ..
\]
, where indices correspond to the parameter number and the potence
- Template Parameters
-
| T | The datatype of the polynomial parameters (e.g: float, double, complex) |
| Order | The Order of the polynomial or Eigen::Dynamic for dynamically allocated sizes |
| AutoGrow | If true for at least one polynomial of an operation the resulting polynomial will grow automatically in size to contain all values. Usually set false if one needs to sum over polynomials in a loop. |