3 #include "../MultivariatePolynomial.h"
4 #include "../UnivariatePolynomial.h"
9 template<
typename C,
typename O,
typename P>
10 MultivariatePolynomial<C,O,P>
gcd(
const MultivariatePolynomial<C,O,P>& a,
const MultivariatePolynomial<C,O,P>& b);
12 template<
typename Coeff>
13 UnivariatePolynomial<Coeff>
gcd(
const UnivariatePolynomial<Coeff>& a,
const UnivariatePolynomial<Coeff>& b);
22 template<
typename C,
typename O,
typename P>
31 template<
typename C,
typename O,
typename P>
36 template<
typename C,
typename O,
typename P>
38 if (!b)
return nullptr;
41 std::vector<std::pair<Variable, exponent>> vepairs;
42 for (
const auto& ve : *b) {
43 if (varinfo.var(ve.first)->num_occurences() == a.
nr_terms()) {
44 vepairs.push_back(ve.first, std::min(varinfo.var(ve.first)->min_degree(), ve.second));
50 template<
typename C,
typename O,
typename P>
States if a type is a field.
carl is the main namespace for the library.
Monomial::Arg createMonomial(T &&... t)
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.
VarsInfo< MultivariatePolynomial< Coeff, Ordering, Policies > > vars_info(const MultivariatePolynomial< Coeff, Ordering, Policies > &poly, bool collect_coeff=false)
The general-purpose multivariate polynomial class.
std::size_t nr_terms() const
Calculate the number of terms.
std::shared_ptr< const Monomial > Arg
Represents a single term, that is a numeric coefficient and a monomial.
bool is_constant() const
Checks whether the monomial is a constant.
Monomial::Arg & monomial()
Get the monomial.