22 template<
typename Coefficient>
38 explicit Term(
const Coefficient& c);
83 const Coefficient&
coeff()
const {
110 [[deprecated(
"use carl::is_zero(t) instead.")]]
119 [[deprecated(
"use carl::is_one(t) instead.")]]
179 return mMonomial->has_no_other_variable(v);
223 [[deprecated(
"Use carl::divide() instead.")]]
225 [[deprecated(
"Use carl::divide() instead.")]]
227 [[deprecated(
"Use carl::divide() instead.")]]
246 template<
typename C = Coefficient, EnableIf<is_field_type<C>> = dummy>
248 template<
typename C = Coefficient, DisableIf<is_field_type<C>> = dummy>
261 template<
typename Coeff>
271 template<
typename Coeff>
283 static bool monomialEqual(
const std::shared_ptr<const Term>& lhs,
const std::shared_ptr<const Term>& rhs) {
284 if (lhs == rhs)
return true;
291 static bool monomialLess(
const std::shared_ptr<const Term>& lhs,
const std::shared_ptr<const Term>& rhs) {
300 template<
typename Coeff>
306 template<
typename Coeff>
314 template<
typename Coeff>
319 template<
typename Coeff>
332 template<
typename Coeff>
341 template<
typename Coeff>
353 template<
typename Coeff>
365 template<
typename Coeff>
388 template<
typename Coeff>
390 template<
typename Coeff>
392 template<
typename Coeff>
394 template<
typename Coeff>
396 template<
typename Coeff>
400 template<
typename Coeff>
404 template<
typename Coeff>
409 template<
typename Coeff>
411 return !(lhs == rhs);
413 template<
typename Coeff>
415 return !(lhs == rhs);
417 template<
typename Coeff>
419 return !(lhs == rhs);
421 template<
typename Coeff>
423 return !(lhs == rhs);
425 template<
typename Coeff>
427 return !(lhs == rhs);
429 template<
typename Coeff>
431 return !(lhs == rhs);
433 template<
typename Coeff>
435 return !(lhs == rhs);
438 template<
typename Coeff>
440 template<
typename Coeff>
442 template<
typename Coeff>
444 template<
typename Coeff>
446 template<
typename Coeff>
448 template<
typename Coeff>
450 template<
typename Coeff>
453 template<
typename Coeff>
457 template<
typename Coeff>
461 template<
typename Coeff>
465 template<
typename Coeff>
469 template<
typename Coeff>
473 template<
typename Coeff>
477 template<
typename Coeff>
482 template<
typename Coeff>
486 template<
typename Coeff>
490 template<
typename Coeff>
494 template<
typename Coeff>
498 template<
typename Coeff>
502 template<
typename Coeff>
506 template<
typename Coeff>
511 template<
typename Coeff>
515 template<
typename Coeff>
519 template<
typename Coeff>
523 template<
typename Coeff>
527 template<
typename Coeff>
531 template<
typename Coeff>
535 template<
typename Coeff>
549 template<
typename Coeff>
553 template<
typename Coeff>
557 template<
typename Coeff>
561 template<
typename Coeff>
565 template<
typename Coeff>
569 template<
typename Coeff, EnableIf<carl::is_number_type<Coeff>> = dummy>
573 template<
typename Coeff>
577 template<
typename Coeff>
581 template<
typename Coeff>
585 template<
typename Coeff, EnableIf<carl::is_number_type<Coeff>> = dummy>
589 template<
typename Coeff>
593 template<
typename Coeff, EnableIf<carl::is_subset_of_rationals_type<Coeff>> = dummy>
597 template<
typename Coeff, EnableIf<carl::is_subset_of_rationals_type<Coeff>> = dummy>
601 template<
typename Coeff, EnableIf<carl::is_subset_of_rationals_type<Coeff>> = dummy>
614 template<
typename Coefficient>
615 struct hash<
carl::Term<Coefficient>> {
carl is the main namespace for the library.
Monomial::Arg createMonomial(T &&... t)
bool operator>(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
Interval< Number > operator/(const Interval< Number > &lhs, const Number &rhs)
Operator for the division of an interval and a number.
bool operator<(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
cln::cl_RA reciprocal(const cln::cl_RA &a)
bool is_zero(const Interval< Number > &i)
Check if this interval is a point-interval containing 0.
Interval< Number > operator*(const Interval< Number > &lhs, const Interval< Number > &rhs)
Operator for the multiplication of two intervals.
Interval< Number > & operator*=(Interval< Number > &lhs, const Interval< Number > &rhs)
Operator for the multiplication of an interval and a number with assignment.
typename UnderlyingNumberType< P >::type Coeff
Interval< Number > operator-(const Interval< Number > &rhs)
Unary minus.
bool operator!=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool operator<=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool operator==(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
bool is_integer(const Interval< Number > &n)
bool operator>=(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
std::size_t hash_all(Args &&... args)
Hashes an arbitrary number of values.
void variables(const BasicConstraint< Pol > &c, carlVariables &vars)
bool is_one(const Interval< Number > &i)
Check if this interval is a point-interval containing 1.
A Variable represents an algebraic variable that can be used throughout carl.
The general-purpose monomials.
std::shared_ptr< const Monomial > Arg
Represents a single term, that is a numeric coefficient and a monomial.
Term divide(const Coefficient &c) const
bool divide(const Term &t, Term &res) const
Term drop_variable(Variable v) const
Removes the given variable from the term.
std::size_t num_variables() const
Term()=default
Default constructor.
void negate()
Negates the term by negating the coefficient.
bool is_linear() const
Checks whether the monomial has exactly the degree one.
Coefficient & coeff()
Get the coefficient.
static bool monomialLess(const std::shared_ptr< const Term > &lhs, const std::shared_ptr< const Term > &rhs)
bool is_one() const
Checks whether the term equals one.
bool sqrt(Term &res) const
Calculates the square root of this term.
Term(Variable v)
Constructs a term of value .
Term(Monomial::Arg &&m)
Constructs a term of value .
bool divide(const Coefficient &c, Term &res) const
bool has_no_other_variable(Variable v) const
Checks if the monomial is either a constant or the only variable occuring is the variable v.
static bool monomialEqual(const std::shared_ptr< const Term > &lhs, const std::shared_ptr< const Term > &rhs)
bool divisible(const Term &t) const
Coefficient CoefficientType
bool is_single_variable() const
static bool monomialEqual(const Term &lhs, const Term &rhs)
Checks if two terms have the same monomial.
bool is_consistent() const
void clear()
Set the term to zero with the canonical representation.
Term(const Coefficient &c, Monomial::Arg m)
Constructs a term of value .
Term calcLcmAndDivideBy(const Monomial::Arg &m) const
friend std::ostream & operator<<(std::ostream &os, const Term< Coeff > &rhs)
Streaming operator for Term.
bool integer_valued() const
static bool monomialLess(const Term &lhs, const Term &rhs)
Variable single_variable() const
For terms with exactly one variable, get this variable.
bool divide(const Monomial::Arg &m, Term &res) const
Term(Coefficient &&c, Monomial::Arg &&m)
Constructs a term of value .
friend const Term< Coeff > operator/(const Term< Coeff > &lhs, uint rhs)
Perform a division involving a term.
bool is_square() const
Checks if the term is a square.
const Monomial::Arg & monomial() const
bool has(Variable v) const
bool is_zero() const
Checks whether the term is zero.
uint tdeg() const
Gives the total degree, i.e.
bool is_constant() const
Checks whether the monomial is a constant.
Term(const Coefficient &c, Variable v, uint e)
Constructs a term of value .
Term(const Coefficient &c)
Constructs a term of value .
const Coefficient & coeff() const
bool divide(Variable v, Term &res) const
Monomial::Arg & monomial()
Get the monomial.
Term(Monomial::Arg m)
Constructs a term of value .
std::size_t operator()(const carl::Term< Coefficient > &term) const
Calculates the hash of a Term.