5 #include "../MultivariatePolynomial.h"
6 #include "../UnivariatePolynomial.h"
10 template<
typename Coefficient>
11 Coefficient
evaluate(
const Monomial& m,
const std::map<Variable, Coefficient>& substitutions) {
12 CARL_LOG_FUNC(
"carl.core.monomial", m <<
", " << substitutions);
14 for (
const auto& ve : m) {
15 auto it = substitutions.find(ve.first);
16 assert(it != substitutions.end());
23 template<
typename Coefficient>
36 template<
typename C,
typename O,
typename P,
typename SubstitutionType>
41 SubstitutionType result(
evaluate(p[0], substitutions));
42 for (
unsigned i = 1; i < p.
nr_terms(); ++i) {
43 result +=
evaluate(p[i], substitutions);
49 template<
typename Coeff>
54 result += (coeff * var);
61 template<
typename Coeff>
Implements utility functions concerning the (total) degree of monomials, terms and polynomials.
#define CARL_LOG_FUNC(channel, args)
#define CARL_LOG_TRACE(channel, msg)
carl is the main namespace for the library.
bool is_zero(const Interval< Number > &i)
Check if this interval is a point-interval containing 0.
bool evaluate(const BasicConstraint< Poly > &c, const Assignment< Number > &m)
bool is_root_of(const UnivariatePolynomial< Coeff > &p, const Coeff &value)
Sign sgn(const Number &n)
Obtain the sign of the given number.
typename UnderlyingNumberType< P >::type Coeff
Interval< Number > pow(const Interval< Number > &i, Integer exp)
This class represents a univariate polynomial with coefficients of an arbitrary type.
const std::vector< Coefficient > & coefficients() const &
Retrieves the coefficients defining this polynomial.
The general-purpose multivariate polynomial class.
std::size_t nr_terms() const
Calculate the number of terms.
The general-purpose monomials.
Represents a single term, that is a numeric coefficient and a monomial.
Coefficient & coeff()
Get the coefficient.
Monomial::Arg & monomial()
Get the monomial.