Represents the Chebyshev polynomial of the first kind Tₙ(x).
One definition of Chebyshev polynomial of the first kind is Tₙ(cos(θ)) = cos(nθ) It can also be defined recursively as
T₀(x) = 1 T₁(x) = x Tₙ₊₁(x) = 2xTₙ(x) − Tₙ₋₁(x)
#include <drake/common/symbolic/chebyshev_polynomial.h>
Public Member Functions | |
| ChebyshevPolynomial (Variable var, int degree) | |
| Constructs a Chebyshev polynomial Tₙ(x) More... | |
| const Variable & | var () const |
| Getter for the variable. More... | |
| int | degree () const |
| Getter for the degree of the Chebyshev polynomial. More... | |
| Polynomial | ToPolynomial () const |
| Converts this Chebyshev polynomial to a polynomial with monomial basis. More... | |
| double | Evaluate (double var_val) const |
Evaluates this Chebyshev polynomial at var_val. More... | |
| bool | operator== (const ChebyshevPolynomial &other) const |
Checks if this and other represent the same Chebyshev polynomial. More... | |
| bool | operator!= (const ChebyshevPolynomial &other) const |
Checks if this and other do not represent the same Chebyshev polynomial. More... | |
| bool | operator< (const ChebyshevPolynomial &other) const |
| Compare this to another Chebyshev polynomial, returns True if this is regarded as less than the other, otherwise returns false. More... | |
| std::vector< std::pair< ChebyshevPolynomial, double > > | Differentiate () const |
| Computes the differentiation of a Chebyshev polynomial dTₙ(x)/dx = nUₙ₋₁(x) where Uₙ₋₁(x) is a Chebyshev polynomial of the second kind. More... | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
| ChebyshevPolynomial (const ChebyshevPolynomial &)=default | |
| ChebyshevPolynomial & | operator= (const ChebyshevPolynomial &)=default |
| ChebyshevPolynomial (ChebyshevPolynomial &&)=default | |
| ChebyshevPolynomial & | operator= (ChebyshevPolynomial &&)=default |
Friends | |
| template<class HashAlgorithm > | |
| void | hash_append (HashAlgorithm &hasher, const ChebyshevPolynomial &item) noexcept |
| Implements the hash_append generic hashing concept. More... | |
|
default |
|
default |
| ChebyshevPolynomial | ( | Variable | var, |
| int | degree | ||
| ) |
Constructs a Chebyshev polynomial Tₙ(x)
| var | The variable x |
| degree | The Chebyshev polynomial is of degree n. |
| int degree | ( | ) | const |
Getter for the degree of the Chebyshev polynomial.
| std::vector<std::pair<ChebyshevPolynomial, double> > Differentiate | ( | ) | const |
Computes the differentiation of a Chebyshev polynomial dTₙ(x)/dx = nUₙ₋₁(x) where Uₙ₋₁(x) is a Chebyshev polynomial of the second kind.
Uₙ₋₁(x) can be written as a summation of Chebyshev polynomials of the first kind with lower degrees.
| chebyshev_coeff_pairs. | sum(chebyshev_coeff_pairs[j].first * chebyshev_coeff_pairs[j].second) is the differentiation dTₙ(x)/dx. If n is even, then chebyshev_coeff_pairs[j] = (T₂ⱼ₋₁(x), 2n). If n is odd, then chebyshev_coeff_pairs[j] = (T₂ⱼ(x), 2n) for j >= 1, and chebyshev_coeff_pairs[0] = (T₀(x), n). For the special case when degree() == 0, we return an empty vector. |
| bool operator!= | ( | const ChebyshevPolynomial & | other | ) | const |
Checks if this and other do not represent the same Chebyshev polynomial.
| bool operator< | ( | const ChebyshevPolynomial & | other | ) | const |
Compare this to another Chebyshev polynomial, returns True if this is regarded as less than the other, otherwise returns false.
If this.var() < other.var(), return True. If this.var() > other.var(), return False. If this.var() == other.var(), then return this.degree() < other.degree().
A special case is when this.degree() == 0 or other.degree() == 0. In this case the variable doesn't matter, and we return this.degree() < other.degree().
|
default |
|
default |
| bool operator== | ( | const ChebyshevPolynomial & | other | ) | const |
Checks if this and other represent the same Chebyshev polynomial.
Two Chebyshev polynomials are equal iff their variable and degree are the same, or they both have degree 0.
| Polynomial ToPolynomial | ( | ) | const |
Converts this Chebyshev polynomial to a polynomial with monomial basis.
| const Variable& var | ( | ) | const |
Getter for the variable.
|
friend |
Implements the hash_append generic hashing concept.