8 var,
std::move(dict)){SYMENGINE_ASSIGN_TYPEID()
9 SYMENGINE_ASSERT(is_canonical(get_poly()))}
13 hash_t seed = SYMENGINE_UINTPOLY;
15 seed += get_var()->hash();
16 for (
const auto &it : get_poly().dict_) {
17 hash_t temp = SYMENGINE_UINTPOLY;
18 hash_combine<unsigned int>(temp, it.first);
19 hash_combine<long long int>(temp, mp_get_si(it.second));
26 const Ptr<RCP<const UIntPoly>> &out)
28 if (!(a.get_var()->__eq__(*b.get_var())))
29 throw SymEngineException(
"Error: variables must agree.");
31 auto a_poly = a.get_poly();
32 auto b_poly = b.get_poly();
33 if (a_poly.size() == 0)
39 unsigned int a_deg, b_deg;
41 while (b_poly.size() >= a_poly.size()) {
42 a_deg = a_poly.degree();
43 b_deg = b_poly.degree();
45 mp_tdiv_qr(q, r, b_poly.get_lc(), a_poly.get_lc());
49 res[b_deg - a_deg] = q;
51 b_poly -= (a_poly * tmp);
55 *out = UIntPoly::from_dict(a.get_var(),
std::move(res));
UIntPoly(const RCP< const Basic > &var, UIntDict &&dict)
Constructor of UIntPoly class.
hash_t __hash__() const override
Main namespace for SymEngine package.