#include <MRSparsePolynomial.h>
Public Member Functions | |
| SparsePolynomial ()=default | |
| constructs zero polynomial | |
| SparsePolynomial (std::map< D, C > &&) | |
| takes existing coefficients in ownership | |
| SparsePolynomial (C c0, D d1, C c1) | |
| constructs polynomial c0 + c1*x^d1 | |
| SparsePolynomial (C c0, D d1, C c1, D d2, C c2) | |
| constructs polynomial c0 + c1*x^d1 + c2*x^d2 | |
| void | setZeroCoeff (D d) |
| sets coefficient for given degree to zero | |
| bool | empty () const |
| returns true if no single polynomial coefficient is defined | |
| bool | isPositive () const |
| returns true if the coefficient for the smallest not-zero degress is positive | |
| const std::map< D, C > & | get () const |
| gets read-only access to all not-zero coefficients | |
| SparsePolynomial & | operator+= (const SparsePolynomial &b) |
| SparsePolynomial & | operator-= (const SparsePolynomial &b) |
Friends | |
| SparsePolynomial | operator* (const SparsePolynomial &a, const SparsePolynomial &b) |
The class to store a polynomial with a large number of zero coefficient (only non-zeros are stored in std::map)
| C | - type of coefficients |
| D | - type of degrees |
| M | - maximum degree to store in the polynomial |