Macaulay2 Engine
Loading...
Searching...
No Matches

◆ divide()

bool ResMonoidDense::divide ( res_const_packed_monomial m,
res_const_packed_monomial n,
res_packed_monomial result ) const
inline

Definition at line 337 of file res-moninfo-dense.hpp.

340 {
342 // First, divide monomials
343 // Then, if the division is OK, set the component, hash value and rest of
344 // the monomial
345 if (m[1] != n[1]) // components are not equal
346 return false;
350 for (int i = nslots - 2; i > 0; i--)
351 {
352 res_varpower_word cmp = *--m1 - *--n1;
353 if (cmp < 0) return false;
354 *--result1 = cmp;
355 }
356 result[1] = 0; // the component of a division is in the ring (comp 0).
357 result[0] = m[0] - n[0]; // subtract hash codes
358 return true;
359 }
unsigned long ncalls_divide
VALGRIND_MAKE_MEM_DEFINED & result(result)
const res_monomial_word * res_const_packed_monomial
res_varpower_monomials::Exponent res_varpower_word
res_monomial_word * res_packed_monomial

References ncalls_divide, nslots, and result().