carl
24.04
Computer ARithmetic Library
|
The general-purpose multivariate polynomial class. More...
#include <MultivariatePolynomial.h>
Public Types | |
enum class | ConstructorOperation { ADD , SUB , MUL , DIV } |
using | OrderedBy = Ordering |
The ordering of the terms. More... | |
using | TermType = Term< Coeff > |
Type of the terms. More... | |
using | MonomType = Monomial |
Type of the monomials within the terms. More... | |
using | CoeffType = Coeff |
Type of the coefficients. More... | |
using | Policy = Policies |
Policies for this monomial. More... | |
using | NumberType = typename UnderlyingNumberType< Coeff >::type |
Number type within the coefficients. More... | |
using | IntNumberType = typename IntegralType< NumberType >::type |
Integer type associated with the number type. More... | |
using | PolyType = MultivariatePolynomial< Coeff, Ordering, Policies > |
using | CACHE = void |
The type of the cache. Multivariate polynomials do not need a cache, we set it to something. More... | |
using | TermsType = std::vector< Term< Coeff > > |
Type our terms vector.f. More... | |
using | RootType = typename UnivariatePolynomial< NumberType >::RootType |
template<typename C , typename T > | |
using | EnableIfNotSame = typename std::enable_if<!std::is_same< C, T >::value, T >::type |
Public Member Functions | |
~MultivariatePolynomial () noexcept=default | |
bool | isOrdered () const |
Check if the terms are ordered. More... | |
void | reset_ordered () const |
void | makeOrdered () const |
Ensure that the terms are ordered. More... | |
const Term< Coeff > & | lterm () const |
The leading term. More... | |
Term< Coeff > & | lterm () |
const Coeff & | lcoeff () const |
Returns the coefficient of the leading term. More... | |
const Monomial::Arg & | lmon () const |
The leading monomial. More... | |
MultivariatePolynomial | lcoeff (Variable::Arg var) const |
Returns the leading coefficient with respect to the given variable. More... | |
const Term< Coeff > & | trailingTerm () const |
Give the last term according to Ordering. More... | |
Term< Coeff > & | trailingTerm () |
std::size_t | total_degree () const |
Calculates the max. More... | |
std::size_t | degree (Variable::Arg var) const |
Calculates the degree of this polynomial with respect to the given variable. More... | |
MultivariatePolynomial | coeff (Variable::Arg var, std::size_t exp) const |
Calculates the coefficient of var^exp. More... | |
bool | is_zero () const |
Check if the polynomial is zero. More... | |
bool | is_one () const |
bool | is_constant () const |
Check if the polynomial is constant. More... | |
bool | is_number () const |
Check if the polynomial is a number, i.e., a constant. More... | |
bool | is_variable () const |
bool | is_linear () const |
Check if the polynomial is linear. More... | |
std::size_t | nr_terms () const |
Calculate the number of terms. More... | |
std::size_t | size () const |
bool | has_constant_term () const |
Check if the polynomial has a constant term that is not zero. More... | |
bool | integer_valued () const |
const Coeff & | constant_part () const |
Retrieve the constant term of this polynomial or zero, if there is no constant term. More... | |
auto | begin () const |
auto | end () const |
auto | rbegin () const |
auto | rend () const |
auto | erase_term (typename TermsType::iterator pos) |
const TermsType & | terms () const |
TermsType & | terms () |
MultivariatePolynomial | tail (bool makeFullyOrdered=false) const |
For the polynomial p, the function calculates a polynomial p - lt(p). More... | |
MultivariatePolynomial & | strip_lterm () |
Drops the leading term. More... | |
bool | has_single_variable () const |
Variable | single_variable () const |
For terms with exactly one variable, get this variable. More... | |
const CoeffType & | coefficient () const |
const PolyType & | polynomial () const |
bool | is_univariate () const |
Checks whether only one variable occurs. More... | |
bool | is_tsos () const |
Checks whether the polynomial is a trivial sum of squares. More... | |
bool | has (Variable v) const |
bool | is_reducible_identity () const |
void | subtractProduct (const Term< Coeff > &factor, const MultivariatePolynomial &p) |
Subtract a term times a polynomial from this polynomial. More... | |
void | addTerm (const Term< Coeff > &term) |
Adds a single term without using a TermAdditionManager or changing the ordering status. More... | |
bool | sqrt (MultivariatePolynomial &res) const |
Calculates the square of this multivariate polynomial if it is a square. More... | |
Coeff | coprime_factor () const |
template<typename C = Coeff, EnableIf< is_subset_of_rationals_type< C >> = dummy> | |
Coeff | coprime_factor_without_constant () const |
MultivariatePolynomial | coprime_coefficients () const |
MultivariatePolynomial | coprime_coefficients_sign_preserving () const |
MultivariatePolynomial | normalize () const |
For a polynomial p, returns p/lc(p) More... | |
bool | divides (const MultivariatePolynomial &b) const |
MultivariatePolynomial< typename IntegralType< Coeff >::type, Ordering, Policies > | to_integer_domain () const |
const Term< Coeff > & | operator[] (std::size_t index) const |
MultivariatePolynomial | mod (const typename IntegralType< Coeff >::type &modulo) const |
template<typename C = Coeff, EnableIf< is_number_type< C >> = dummy> | |
Coeff | numeric_content () const |
template<typename C = Coeff, DisableIf< is_number_type< C >> = dummy> | |
UnderlyingNumberType< C >::type | numeric_content () const |
template<typename C = Coeff, EnableIf< is_number_type< C >> = dummy> | |
IntNumberType | main_denom () const |
MultivariatePolynomial | operator- () const |
template<bool findConstantTerm = true, bool findLeadingTerm = true> | |
void | makeMinimallyOrdered () const |
Make sure that the terms are at least minimally ordered. More... | |
bool | is_consistent () const |
Asserts that this polynomial complies with the requirements and assumptions for MultivariatePolynomial objects. More... | |
void | setReason (unsigned index) |
BitVector | getReasons () const |
void | setReasons (const BitVector &) const |
Constructors | |
MultivariatePolynomial () | |
MultivariatePolynomial (const MultivariatePolynomial< Coeff, Ordering, Policies > &p) | |
MultivariatePolynomial (MultivariatePolynomial< Coeff, Ordering, Policies > &&p) | |
MultivariatePolynomial & | operator= (const MultivariatePolynomial &p) |
MultivariatePolynomial & | operator= (MultivariatePolynomial &&p) noexcept |
MultivariatePolynomial (int c) | |
template<typename C = Coeff> | |
MultivariatePolynomial (EnableIfNotSame< C, sint > c) | |
template<typename C = Coeff> | |
MultivariatePolynomial (EnableIfNotSame< C, uint > c) | |
MultivariatePolynomial (const Coeff &c) | |
MultivariatePolynomial (Variable::Arg v) | |
MultivariatePolynomial (const Term< Coeff > &t) | |
MultivariatePolynomial (const std::shared_ptr< const Monomial > &m) | |
MultivariatePolynomial (const UnivariatePolynomial< MultivariatePolynomial< Coeff, Ordering, Policy >> &pol) | |
MultivariatePolynomial (const UnivariatePolynomial< Coeff > &p) | |
template<class OtherPolicies , DisableIf< std::is_same< Policies, OtherPolicies >> = dummy> | |
MultivariatePolynomial (const MultivariatePolynomial< Coeff, Ordering, OtherPolicies > &p) | |
MultivariatePolynomial (TermsType &&terms, bool duplicates=true, bool ordered=false) | |
MultivariatePolynomial (const TermsType &terms, bool duplicates=true, bool ordered=false) | |
MultivariatePolynomial (const std::initializer_list< Term< Coeff >> &terms) | |
MultivariatePolynomial (const std::initializer_list< Variable > &terms) | |
MultivariatePolynomial (const std::pair< ConstructorOperation, std::vector< MultivariatePolynomial >> &p) | |
MultivariatePolynomial (ConstructorOperation op, const std::vector< MultivariatePolynomial > &operands) | |
In-place addition operators | |
MultivariatePolynomial & | operator+= (const MultivariatePolynomial &rhs) |
Add something to this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator+= (const TermType &rhs) |
Add something to this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator+= (const std::shared_ptr< const TermType > &rhs) |
Add something to this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator+= (const Monomial::Arg &rhs) |
Add something to this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator+= (Variable rhs) |
Add something to this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator+= (const Coeff &rhs) |
Add something to this polynomial and return the changed polynomial. More... | |
In-place subtraction operators | |
MultivariatePolynomial & | operator-= (const MultivariatePolynomial &rhs) |
Subtract something from this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator-= (const Term< Coeff > &rhs) |
Subtract something from this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator-= (const Monomial::Arg &rhs) |
Subtract something from this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator-= (Variable::Arg rhs) |
Subtract something from this polynomial and return the changed polynomial. More... | |
MultivariatePolynomial & | operator-= (const Coeff &rhs) |
Subtract something from this polynomial and return the changed polynomial. More... | |
In-place multiplication operators | |
MultivariatePolynomial & | operator*= (const MultivariatePolynomial &rhs) |
Multiply this polynomial with something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator*= (const Term< Coeff > &rhs) |
Multiply this polynomial with something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator*= (const Monomial::Arg &rhs) |
Multiply this polynomial with something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator*= (Variable::Arg rhs) |
Multiply this polynomial with something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator*= (const Coeff &rhs) |
Multiply this polynomial with something and return the changed polynomial. More... | |
In-place division operators | |
MultivariatePolynomial & | operator/= (const MultivariatePolynomial &rhs) |
Divide this polynomial by something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator/= (const Term< Coeff > &rhs) |
Divide this polynomial by something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator/= (const Monomial::Arg &rhs) |
Divide this polynomial by something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator/= (Variable::Arg rhs) |
Divide this polynomial by something and return the changed polynomial. More... | |
MultivariatePolynomial & | operator/= (const Coeff &rhs) |
Divide this polynomial by something and return the changed polynomial. More... | |
Static Public Member Functions | |
static bool | compareByLeadingTerm (const MultivariatePolynomial &p1, const MultivariatePolynomial &p2) |
static bool | compareByNrTerms (const MultivariatePolynomial &p1, const MultivariatePolynomial &p2) |
Static Public Attributes | |
static TermAdditionManager< MultivariatePolynomial, Ordering > | mTermAdditionManager |
static const bool | searchLinear = true |
Linear searching means that we search linearly for a term instead of applying e.g. More... | |
static const bool | has_reasons = ReasonsAdaptor::has_reasons |
Private Member Functions | |
void | makeMinimallyOrdered (typename TermsType::iterator <erm, typename TermsType::iterator &cterm) const |
Make sure that the terms are at least minimally ordered. More... | |
Private Attributes | |
TermsType | mTerms |
A vector of all terms. More... | |
bool | mOrdered |
Flag that indicates if the terms are ordered. More... | |
Friends | |
template<typename Polynomial , typename Order > | |
class | TermAdditionManager |
std::ostream & | operator<< (std::ostream &os, ConstructorOperation op) |
Division operators | |
template<typename C , typename O , typename P > | |
MultivariatePolynomial< C, O, P > | operator/ (const MultivariatePolynomial< C, O, P > &lhs, const MultivariatePolynomial< C, O, P > &rhs) |
Perform a division involving a polynomial. More... | |
template<typename C , typename O , typename P > | |
MultivariatePolynomial< C, O, P > | operator/ (const MultivariatePolynomial< C, O, P > &lhs, unsigned long rhs) |
Perform a division involving a polynomial. More... | |
The general-purpose multivariate polynomial class.
It is represented as a sum of terms, being a coefficient and a monomial.
A polynomial is always minimally ordered. By that, we mean that the leading term and the constant term (if there is any) are at the correct positions. For some operations, the terms may be fully ordered. isOrdered()
checks if the polynomial is fully ordered while makeOrdered()
makes the polynomial fully ordered.
Definition at line 42 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::CACHE = void |
The type of the cache. Multivariate polynomials do not need a cache, we set it to something.
Definition at line 64 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::CoeffType = Coeff |
Type of the coefficients.
Definition at line 54 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::EnableIfNotSame = typename std::enable_if<!std::is_same<C,T>::value,T>::type |
Definition at line 71 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::IntNumberType = typename IntegralType<NumberType>::type |
Integer type associated with the number type.
Definition at line 60 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::MonomType = Monomial |
Type of the monomials within the terms.
Definition at line 52 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::NumberType = typename UnderlyingNumberType<Coeff>::type |
Number type within the coefficients.
Definition at line 58 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::OrderedBy = Ordering |
The ordering of the terms.
Definition at line 48 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::Policy = Policies |
Policies for this monomial.
Definition at line 56 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::PolyType = MultivariatePolynomial<Coeff, Ordering, Policies> |
Definition at line 62 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::RootType = typename UnivariatePolynomial<NumberType>::RootType |
Definition at line 68 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::TermsType = std::vector<Term<Coeff> > |
Type our terms vector.f.
Definition at line 66 of file MultivariatePolynomial.h.
using carl::MultivariatePolynomial< Coeff, Ordering, Policies >::TermType = Term<Coeff> |
Type of the terms.
Definition at line 50 of file MultivariatePolynomial.h.
|
strong |
Enumerator | |
---|---|
ADD | |
SUB | |
MUL | |
DIV |
Definition at line 82 of file MultivariatePolynomial.h.
carl::MultivariatePolynomial< Coeff, Ordering, Policies >::MultivariatePolynomial | ( | ) |
carl::MultivariatePolynomial< Coeff, Ordering, Policies >::MultivariatePolynomial | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | p | ) |
carl::MultivariatePolynomial< Coeff, Ordering, Policies >::MultivariatePolynomial | ( | MultivariatePolynomial< Coeff, Ordering, Policies > && | p | ) |
|
inlineexplicit |
Definition at line 100 of file MultivariatePolynomial.h.
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
carl::MultivariatePolynomial< Coeff, Ordering, Policies >::MultivariatePolynomial | ( | const std::initializer_list< Term< Coeff >> & | terms | ) |
carl::MultivariatePolynomial< Coeff, Ordering, Policies >::MultivariatePolynomial | ( | const std::initializer_list< Variable > & | terms | ) |
|
explicit |
|
explicit |
|
defaultnoexcept |
void carl::MultivariatePolynomial< Coeff, Ordering, Policies >::addTerm | ( | const Term< Coeff > & | term | ) |
Adds a single term without using a TermAdditionManager or changing the ordering status.
term | Term. |
|
inline |
Definition at line 310 of file MultivariatePolynomial.h.
|
inline |
Calculates the coefficient of var^exp.
var | Variable. |
exp | Exponent. |
Definition at line 221 of file MultivariatePolynomial.h.
|
inline |
Definition at line 365 of file MultivariatePolynomial.h.
|
inlinestatic |
|
inlinestatic |
const Coeff& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::constant_part | ( | ) | const |
Retrieve the constant term of this polynomial or zero, if there is no constant term.
MultivariatePolynomial carl::MultivariatePolynomial< Coeff, Ordering, Policies >::coprime_coefficients | ( | ) | const |
MultivariatePolynomial carl::MultivariatePolynomial< Coeff, Ordering, Policies >::coprime_coefficients_sign_preserving | ( | ) | const |
Coeff carl::MultivariatePolynomial< Coeff, Ordering, Policies >::coprime_factor | ( | ) | const |
Coeff carl::MultivariatePolynomial< Coeff, Ordering, Policies >::coprime_factor_without_constant | ( | ) | const |
|
inline |
Calculates the degree of this polynomial with respect to the given variable.
var | Variable. |
Definition at line 205 of file MultivariatePolynomial.h.
bool carl::MultivariatePolynomial< Coeff, Ordering, Policies >::divides | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | b | ) | const |
|
inline |
Definition at line 313 of file MultivariatePolynomial.h.
|
inline |
Definition at line 323 of file MultivariatePolynomial.h.
|
inlineinherited |
Definition at line 17 of file ReasonsAdaptor.h.
|
inline |
v | The variable to check for its occurrence. |
Definition at line 397 of file MultivariatePolynomial.h.
|
inline |
Check if the polynomial has a constant term that is not zero.
Definition at line 292 of file MultivariatePolynomial.h.
|
inline |
|
inline |
Definition at line 299 of file MultivariatePolynomial.h.
bool carl::MultivariatePolynomial< Coeff, Ordering, Policies >::is_consistent | ( | ) | const |
Asserts that this polynomial complies with the requirements and assumptions for MultivariatePolynomial objects.
|
inline |
Check if the polynomial is constant.
Definition at line 254 of file MultivariatePolynomial.h.
bool carl::MultivariatePolynomial< Coeff, Ordering, Policies >::is_linear | ( | ) | const |
Check if the polynomial is linear.
|
inline |
Check if the polynomial is a number, i.e., a constant.
Definition at line 260 of file MultivariatePolynomial.h.
|
inline |
Definition at line 248 of file MultivariatePolynomial.h.
bool carl::MultivariatePolynomial< Coeff, Ordering, Policies >::is_reducible_identity | ( | ) | const |
|
inline |
Checks whether the polynomial is a trivial sum of squares.
Definition at line 387 of file MultivariatePolynomial.h.
bool carl::MultivariatePolynomial< Coeff, Ordering, Policies >::is_univariate | ( | ) | const |
Checks whether only one variable occurs.
|
inline |
Definition at line 266 of file MultivariatePolynomial.h.
|
inline |
Check if the polynomial is zero.
Definition at line 240 of file MultivariatePolynomial.h.
|
inline |
Check if the terms are ordered.
Definition at line 127 of file MultivariatePolynomial.h.
|
inline |
Returns the coefficient of the leading term.
Notice that this is not defined for zero polynomials.
Definition at line 161 of file MultivariatePolynomial.h.
|
inline |
Returns the leading coefficient with respect to the given variable.
var | Variable. |
Definition at line 176 of file MultivariatePolynomial.h.
|
inline |
The leading monomial.
Definition at line 168 of file MultivariatePolynomial.h.
|
inline |
|
inline |
The leading term.
Definition at line 148 of file MultivariatePolynomial.h.
IntNumberType carl::MultivariatePolynomial< Coeff, Ordering, Policies >::main_denom | ( | ) | const |
void carl::MultivariatePolynomial< Coeff, Ordering, Policies >::makeMinimallyOrdered | ( | ) | const |
Make sure that the terms are at least minimally ordered.
|
private |
Make sure that the terms are at least minimally ordered.
Iterators to the important terms are given as arguments, so that we don't need to scan the whole vector.
lterm | Iterator to leading term. |
cterm | Iterator to constant term. |
|
inline |
Ensure that the terms are ordered.
Definition at line 136 of file MultivariatePolynomial.h.
MultivariatePolynomial carl::MultivariatePolynomial< Coeff, Ordering, Policies >::mod | ( | const typename IntegralType< Coeff >::type & | modulo | ) | const |
MultivariatePolynomial carl::MultivariatePolynomial< Coeff, Ordering, Policies >::normalize | ( | ) | const |
For a polynomial p, returns p/lc(p)
|
inline |
Calculate the number of terms.
Definition at line 277 of file MultivariatePolynomial.h.
Coeff carl::MultivariatePolynomial< Coeff, Ordering, Policies >::numeric_content | ( | ) | const |
UnderlyingNumberType<C>::type carl::MultivariatePolynomial< Coeff, Ordering, Policies >::numeric_content | ( | ) | const |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator*= | ( | const Coeff & | rhs | ) |
Multiply this polynomial with something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator*= | ( | const Monomial::Arg & | rhs | ) |
Multiply this polynomial with something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator*= | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | rhs | ) |
Multiply this polynomial with something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator*= | ( | const Term< Coeff > & | rhs | ) |
Multiply this polynomial with something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator*= | ( | Variable::Arg | rhs | ) |
Multiply this polynomial with something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator+= | ( | const Coeff & | rhs | ) |
Add something to this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator+= | ( | const Monomial::Arg & | rhs | ) |
Add something to this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator+= | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | rhs | ) |
Add something to this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator+= | ( | const std::shared_ptr< const TermType > & | rhs | ) |
Add something to this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator+= | ( | const TermType & | rhs | ) |
Add something to this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator+= | ( | Variable | rhs | ) |
Add something to this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator- | ( | ) | const |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator-= | ( | const Coeff & | rhs | ) |
Subtract something from this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator-= | ( | const Monomial::Arg & | rhs | ) |
Subtract something from this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator-= | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | rhs | ) |
Subtract something from this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator-= | ( | const Term< Coeff > & | rhs | ) |
Subtract something from this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator-= | ( | Variable::Arg | rhs | ) |
Subtract something from this polynomial and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator/= | ( | const Coeff & | rhs | ) |
Divide this polynomial by something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator/= | ( | const Monomial::Arg & | rhs | ) |
Divide this polynomial by something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator/= | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | rhs | ) |
Divide this polynomial by something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator/= | ( | const Term< Coeff > & | rhs | ) |
Divide this polynomial by something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator/= | ( | Variable::Arg | rhs | ) |
Divide this polynomial by something and return the changed polynomial.
rhs | Right hand side. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::operator= | ( | const MultivariatePolynomial< Coeff, Ordering, Policies > & | p | ) |
|
noexcept |
|
inline |
Definition at line 460 of file MultivariatePolynomial.h.
|
inline |
Definition at line 372 of file MultivariatePolynomial.h.
|
inline |
Definition at line 316 of file MultivariatePolynomial.h.
|
inline |
Definition at line 319 of file MultivariatePolynomial.h.
|
inline |
Definition at line 130 of file MultivariatePolynomial.h.
|
inherited |
|
inlineinherited |
Definition at line 18 of file ReasonsAdaptor.h.
|
inline |
For terms with exactly one variable, get this variable.
Definition at line 358 of file MultivariatePolynomial.h.
|
inline |
Definition at line 285 of file MultivariatePolynomial.h.
bool carl::MultivariatePolynomial< Coeff, Ordering, Policies >::sqrt | ( | MultivariatePolynomial< Coeff, Ordering, Policies > & | res | ) | const |
Calculates the square of this multivariate polynomial if it is a square.
res | Used to store the result in. |
MultivariatePolynomial& carl::MultivariatePolynomial< Coeff, Ordering, Policies >::strip_lterm | ( | ) |
Drops the leading term.
The function assumes the polynomial to be nonzero, otherwise the leading term is not defined.
void carl::MultivariatePolynomial< Coeff, Ordering, Policies >::subtractProduct | ( | const Term< Coeff > & | factor, |
const MultivariatePolynomial< Coeff, Ordering, Policies > & | p | ||
) |
Subtract a term times a polynomial from this polynomial.
factor | Term. |
p | Polynomial. |
MultivariatePolynomial carl::MultivariatePolynomial< Coeff, Ordering, Policies >::tail | ( | bool | makeFullyOrdered = false | ) | const |
For the polynomial p, the function calculates a polynomial p - lt(p).
The function assumes the polynomial to be nonzero, otherwise, lt(p) is not defined.
|
inline |
Definition at line 332 of file MultivariatePolynomial.h.
|
inline |
Definition at line 329 of file MultivariatePolynomial.h.
MultivariatePolynomial<typename IntegralType<Coeff>::type, Ordering, Policies> carl::MultivariatePolynomial< Coeff, Ordering, Policies >::to_integer_domain | ( | ) | const |
std::size_t carl::MultivariatePolynomial< Coeff, Ordering, Policies >::total_degree | ( | ) | const |
Calculates the max.
degree over all monomials occurring in the polynomial. As the degree of the zero polynomial is , we assert that this polynomial is not zero. This must be checked by the caller before calling this method.
|
inline |
|
inline |
Give the last term according to Ordering.
Notice that if there is a constant part, it is always trailing.
Definition at line 183 of file MultivariatePolynomial.h.
|
friend |
Perform a division involving a polynomial.
lhs | Left hand side. |
rhs | Right hand side. |
lhs / rhs
Definition at line 242 of file Division.h.
|
friend |
Perform a division involving a polynomial.
lhs | Left hand side. |
rhs | Right hand side. |
lhs / rhs
|
friend |
Definition at line 83 of file MultivariatePolynomial.h.
|
friend |
Definition at line 45 of file MultivariatePolynomial.h.
|
staticinherited |
Definition at line 31 of file MultivariatePolynomialPolicy.h.
|
mutableprivate |
Flag that indicates if the terms are ordered.
Definition at line 77 of file MultivariatePolynomial.h.
|
static |
Definition at line 80 of file MultivariatePolynomial.h.
|
mutableprivate |
A vector of all terms.
Definition at line 75 of file MultivariatePolynomial.h.
|
staticinherited |
Linear searching means that we search linearly for a term instead of applying e.g.
binary search. Although the worst-case complexity is worse, for polynomials with a small nr of terms, this should be better.
Definition at line 28 of file MultivariatePolynomialPolicy.h.