A specialisation of the algebra class with a commutative monomial product. More...
#include <polynomials.h>
Public Types | |
typedef poly_basis< SCA, RAT > | BASIS |
The basis type. | |
typedef BASIS::KEY | KEY |
Import of the KEY type. | |
typedef sparse_vector< BASIS > | VECT |
The sparse_vector type. | |
typedef algebra< BASIS > | ALG |
The algebra type. | |
typedef ALG::iterator | iterator |
Import of the iterator type. | |
typedef ALG::const_iterator | const_iterator |
Import of the constant iterator type. | |
Public Member Functions | |
poly (void) | |
Default constructor. Empty polynomial. Zero. | |
poly (const poly &p) | |
Copy constructor. | |
poly (const ALG &a) | |
Constructs an instance from an algebra instance. | |
poly (const VECT &v) | |
Constructs an instance from a sparse_vector instance. | |
poly (const SCA &s) | |
Constructs an instance from a scalar. Embedding of scalars. | |
poly (const KEY &k) | |
Constructs a unidimensional instance from a key (a monomial). | |
poly (LET letter, const SCA &s) | |
Constructs a unidimensional instance from a given letter and scalar. | |
__DECLARE_BINARY_OPERATOR (poly,*,*=, SCA) inline __DECLARE_BINARY_OPERATOR(poly | |
RAT | __DECLARE_BINARY_OPERATOR (poly,*,*=, poly) inline __DECLARE_BINARY_OPERATOR(poly |
RAT poly | __DECLARE_BINARY_OPERATOR (poly,-,-=, poly) inline __DECLARE_UNARY_OPERATOR(poly |
RAT poly ALG SCA | eval (const std::map< LET, SCA > &values) const |
Evaluates the polynomial for some scalar values for letters (variables). | |
Static Public Member Functions | |
static poly | prediff (const KEY &k1, const typename LET &k2) |
Partial differentiation of the KEY (monomial) k1 in the direction k2. | |
static poly | diff (const poly &p1, const typename LET &k2) |
Partial differentiation of a polynomail in the direction k2. | |
Friends | |
poly | exp (const poly &arg, DEG max_degree=3) |
Computes the truncated exponential of arg. | |
poly | log (const poly &arg, DEG max_degree=3) |
Computes the truncated logarithm of a poly instance. |
A specialisation of the algebra class with a commutative monomial product.
Mathematically, the algebra of polynomials instances is a communtative and associative polynomial algebra in several variables (letters). With respect to the inherited algebra class, the essential distinguishing feature of this class is the basis class used, and in particular the basis::prod() member function. Thus, the most important information is in the definition of poly_basis. Notice that this associative algebra of polynomials includes as a sub-algebra the associative algebra corresponding to the SCALAR type. This is permitted by the existence of empty keys in poly_basis. A polynomial is essentially a sparse vector of monomials with polynomial commutative product.
poly< SCA, RAT >::__DECLARE_BINARY_OPERATOR | ( | poly< SCA, RAT > | , | |
* | , | |||
* | , | |||
SCA | ||||
) | [inline] |
Ensures that the return type is an instance of polynomial.
RAT poly< SCA, RAT >::__DECLARE_BINARY_OPERATOR | ( | poly< SCA, RAT > | , | |
* | , | |||
* | , | |||
poly< SCA, RAT > | ||||
) | [inline] |
Ensures that the return type is an instance of polynomial.
RAT poly poly< SCA, RAT >::__DECLARE_BINARY_OPERATOR | ( | poly< SCA, RAT > | , | |
- | , | |||
- | , | |||
poly< SCA, RAT > | ||||
) | [inline] |
Ensures that the return type is an instance of polynomial.
poly exp | ( | const poly< SCA, RAT > & | arg, | |
DEG | max_degree = 3 | |||
) | [friend] |
Computes the truncated exponential of arg.
The result is 1 + arg + arg^2/2! + ... + arg^n/n! where n = max_degree
poly log | ( | const poly< SCA, RAT > & | arg, | |
DEG | max_degree = 3 | |||
) | [friend] |
Computes the truncated logarithm of a poly instance.
Computes the truncated log of arg up to degree max_degree The coef. of the constant term (empty word in the monoid) of arg is forced to 1. log(arg) = log(1+x) = x - x^2/2 + ... + (-1)^(n+1) x^n/n. max_degree must be > 0.