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

◆ find_divisor()

enum ReducedGB_ZZ::divisor_type ReducedGB_ZZ::find_divisor ( exponents_t exp,
int comp,
int & result_loc )
private

Definition at line 116 of file reducedgb-ZZ.cpp.

119{
120 int w = T->find_smallest_coeff_divisor(exp, comp); // gives smallest coeff
121 int r = -1;
122 if (ringtableZZ) r = ringtableZZ->find_smallest_coeff_divisor(exp, 1);
123
124 if (r < 0)
125 {
126 if (w < 0) return DIVISOR_NONE;
127 result_loc = w;
128 return DIVISOR_MODULE;
129 }
130 // r >= 0
131 if (w < 0)
132 {
133 result_loc = r;
134 return DIVISOR_RING;
135 }
136 // r >= 0, w >= 0
137 mpz_srcptr rc = originalR->quotient_gbvector(r)->coeff.get_mpz();
138 mpz_srcptr wc = polys[w].f->coeff.get_mpz();
139 if (mpz_cmpabs(rc, wc) > 0)
140 {
141 result_loc = w;
142 return DIVISOR_MODULE;
143 }
144 result_loc = r;
145 return DIVISOR_RING;
146}
const MonomialTableZZ * ringtableZZ
MonomialTableZZ * T
const PolynomialRing * originalR
Definition reducedgb.hpp:65

References DIVISOR_MODULE, DIVISOR_NONE, DIVISOR_RING, ReducedGB::originalR, ringtableZZ, and T.

Referenced by remainder(), and remainder().