T
.
The coefficients are stored in an std::vector. #include <lemon/polynomial.h>
Public Member Functions | |
Polynomial (int d=0) | |
Construct a polynomial of degree d . | |
template<class U > | |
Polynomial (const U &u) | |
| |
template<class U > | |
Polynomial (const Polynomial< U > &u) | |
| |
int | deg () const |
Query the degree of the polynomial. | |
void | deg (int d) |
Set the degree of the polynomial. | |
std::vector< T >::reference | operator[] (int d) |
Returns (as a reference) the coefficient of degree d . | |
std::vector< T >::const_reference | operator[] (int d) const |
Returns (as a const reference) the coefficient of degree d . | |
template<class R , class U > | |
R | subst (const U &u) const |
Substitute the value u into the polinomial. | |
template<class U > | |
T | operator() (const U &u) const |
Substitute the value u into the polinomial. | |
Polynomial & | derivateMyself () |
Derivate the polynomial (in place). | |
Polynomial | derivate () const |
Return the derivate of the polynomial. | |
Polynomial & | integrateMyself () |
Integrate the polynomial (in place). | |
Polynomial | integrate () const |
Return the integrate of the polynomial. | |
template<class U > | |
Polynomial & | operator+= (const Polynomial< U > &p) |
| |
template<class U > | |
Polynomial & | operator-= (const Polynomial< U > &p) |
| |
template<class U > | |
Polynomial & | operator+= (const U &u) |
| |
template<class U > | |
Polynomial & | operator-= (const U &u) |
| |
template<class U > | |
Polynomial & | operator*= (const U &u) |
| |
template<class U > | |
Polynomial & | operator/= (const U &u) |
| |
Related Functions | |
(Note that these are not member functions.) | |
template<class U , class V > | |
bool | operator== (const Polynomial< U > &u, const Polynomial< V > &v) |
Equality comparison. | |
template<class U , class V > | |
bool | operator!= (const Polynomial< U > &u, const Polynomial< V > &v) |
Non-equality comparison. | |
template<class U , class V > | |
Polynomial< U > | operator+ (const Polynomial< U > &u, const Polynomial< V > &v) |
| |
template<class U , class V > | |
Polynomial< U > | operator- (const Polynomial< U > &u, const Polynomial< V > &v) |
| |
template<class U , class V > | |
Polynomial< U > | operator* (const Polynomial< U > &u, const Polynomial< V > &v) |
| |
template<class U , class V > | |
Polynomial< U > | operator+ (const Polynomial< U > &u, const V &v) |
| |
template<class U , class V > | |
Polynomial< U > | operator+ (const V &v, const Polynomial< U > &u) |
| |
template<class U , class V > | |
Polynomial< U > | operator- (const Polynomial< U > &u, const V &v) |
| |
template<class U > | |
Polynomial< U > | operator- (const Polynomial< U > &u) |
| |
template<class U , class V > | |
Polynomial< U > | operator- (const V &v, const Polynomial< U > &u) |
| |
template<class U , class V > | |
Polynomial< U > | operator* (const Polynomial< U > &u, const V &v) |
| |
template<class U , class V > | |
Polynomial< U > | operator* (const V &v, const Polynomial< U > &u) |
| |
template<class U , class V > | |
Polynomial< U > | operator/ (const Polynomial< U > &u, const V &v) |
|
int deg | ( | ) | const [inline] |
Query the degree of the polynomial.
void deg | ( | int | d | ) | [inline] |
Set the degree of the polynomial. In fact it resizes the coefficient vector.
R subst | ( | const U & | u | ) | const [inline] |
Substitute the value u into the polinomial. The calculation will be done using type R
. The following examples shows the usage of the template parameter R
.
Polynomial<dim2::Point<double> > line(1); line[0]=dim2::Point<double>(12,25); line[1]=dim2::Point<double>(2,7); ... dim2::Point<double> d = line.subst<dim2::Point<double> >(23.2);
Polynomial<double> p; Polynomial<double> q; ... Polynomial<double> s = p.subst<Polynomial<double> >(q);
T operator() | ( | const U & | u | ) | const [inline] |
Substitute the value u into the polinomial. The calculation will be done using type T
(i.e. using the type of the coefficients.)