8 var,
std::move(dict)){SYMENGINE_ASSIGN_TYPEID()
9 SYMENGINE_ASSERT(is_canonical(get_poly()))}
13 hash_t seed = SYMENGINE_URATPOLY;
15 seed += get_var()->hash();
16 for (
const auto &it : get_poly().dict_) {
17 hash_t temp = SYMENGINE_URATPOLY;
18 hash_combine<unsigned int>(temp, it.first);
19 hash_combine<long long int>(temp, mp_get_si(get_num(it.second)));
20 hash_combine<long long int>(temp, mp_get_si(get_den(it.second)));
27 const Ptr<RCP<const URatPoly>> &out)
29 if (!(a.get_var()->__eq__(*b.get_var())))
30 throw SymEngineException(
"Error: variables must agree.");
32 auto a_poly = a.get_poly();
33 auto b_poly = b.get_poly();
34 if (a_poly.size() == 0)
40 unsigned int a_deg, b_deg;
42 while (b_poly.size() >= a_poly.size()) {
43 a_deg = a_poly.degree();
44 b_deg = b_poly.degree();
45 q = b_poly.get_lc() / a_poly.get_lc();
46 res[b_deg - a_deg] = q;
48 b_poly -= (a_poly * tmp);
52 *out = URatPoly::from_dict(a.get_var(),
std::move(res));
hash_t __hash__() const override
URatPoly(const RCP< const Basic > &var, URatDict &&dict)
Constructor of URatPoly class.
Main namespace for SymEngine package.