8 #include "../CoCoAAdaptor.h"
13 namespace gcd_detail {
14 template<
typename Polynomial>
18 std::vector<Variable> common;
24 return *common.begin();
28 template<
typename Polynomial>
45 template<
typename C,
typename O,
typename P>
68 [](
const MultivariatePolynomial<mpq_class,O,P>& n1,
const MultivariatePolynomial<mpq_class,O,P>& n2){ CoCoAAdaptor<MultivariatePolynomial<mpq_class,O,P>> c({n1, n2});
return c.gcd(n1,n2); },
77 CARL_LOG_DEBUG(
"carl.core.gcd",
"gcd(" << a <<
", " << b <<
") = " << res);
#define CARL_LOG_INEFFICIENT()
#define CARL_LOG_DEBUG(channel, msg)
carl is the main namespace for the library.
UnivariatePolynomial< C > to_univariate_polynomial(const MultivariatePolynomial< C, O, P > &p)
Convert a univariate polynomial that is currently (mis)represented by a 'MultivariatePolynomial' into...
cln::cl_I gcd(const cln::cl_I &a, const cln::cl_I &b)
Calculate the greatest common divisor of two integers.
bool is_zero(const Interval< Number > &i)
Check if this interval is a point-interval containing 0.
Interval< Number > set_intersection(const Interval< Number > &lhs, const Interval< Number > &rhs)
Intersects two intervals in a set-theoretic manner.
bool is_negative(const cln::cl_I &n)
UnivariatePolynomial< Coeff > primitive_euclidean(const UnivariatePolynomial< Coeff > &a, const UnivariatePolynomial< Coeff > &b)
Computes the GCD of two univariate polynomial with coefficients from a unique factorization domain us...
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.
Polynomial gcd_calculate(const Polynomial &a, const Polynomial &b)
Variable select_variable(const Polynomial &p1, const Polynomial &p2)
A Variable represents an algebraic variable that can be used throughout carl.
static const Variable NO_VARIABLE
Instance of an invalid variable.
The general-purpose multivariate polynomial class.
bool is_constant() const
Check if the polynomial is constant.
const Coeff & constant_part() const
Retrieve the constant term of this polynomial or zero, if there is no constant term.