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

◆ remainder() [2/2]

void ReducedGB_ZZ::remainder ( POLY & f,
bool use_denom,
ring_elem & denom )
virtual

Implements ReducedGB.

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

149{
150 gbvector *zero = nullptr;
151 gbvector head;
152 gbvector *frem = &head;
153 (void) use_denom;
154 (void) denom;
155 frem->next = nullptr;
156 POLY h = f;
157 exponents_t EXP = ALLOCATE_EXPONENTS(R->exponent_byte_size());
158 gbvector *r;
159 POLY g;
160 while (!R->gbvector_is_zero(h.f))
161 {
162 int w;
163 R->gbvector_get_lead_exponents(F, h.f, EXP);
164 int x = h.f->comp;
165 enum divisor_type typ = find_divisor(EXP, x, w);
166 switch (typ)
167 {
168 case DIVISOR_RING:
169 r = const_cast<gbvector *>(originalR->quotient_gbvector(w));
170 if (R->gbvector_reduce_lead_term_ZZ(F, Fsyz, h.f, zero, r, zero))
171 continue;
172 break;
173 case DIVISOR_MODULE:
174 g = polys[w];
175 if (R->gbvector_reduce_lead_term_ZZ(
176 F, Fsyz, h.f, h.fsyz, g.f, g.fsyz))
177 continue;
178 break;
179 case DIVISOR_NONE:
180 break;
181 }
182 frem->next = h.f;
183 frem = frem->next;
184 h.f = h.f->next;
185 frem->next = nullptr;
186 }
187 h.f = head.next;
188 f.f = h.f;
189 originalR->get_quotient_info()->gbvector_normal_form(Fsyz, h.fsyz);
190 f.fsyz = h.fsyz;
191}
exponents::Exponents exponents_t
enum divisor_type find_divisor(exponents_t exp, int comp, int &result_loc)
const FreeModule * Fsyz
Definition reducedgb.hpp:67
GBRing * R
Definition reducedgb.hpp:64
const PolynomialRing * originalR
Definition reducedgb.hpp:65
const FreeModule * F
Definition reducedgb.hpp:66
int zero
#define ALLOCATE_EXPONENTS(byte_len)
Definition monoid.hpp:62
volatile int x
#define POLY(q)
Definition poly.cpp:23
gbvector * fsyz
Definition gbring.hpp:99
gbvector * f
Definition gbring.hpp:98
gbvector * next
Definition gbring.hpp:80
int comp
Definition gbring.hpp:82

References ALLOCATE_EXPONENTS, gbvector::comp, DIVISOR_MODULE, DIVISOR_NONE, DIVISOR_RING, ReducedGB::F, POLY::f, find_divisor(), ReducedGB::Fsyz, POLY::fsyz, gbvector::next, ReducedGB::originalR, POLY, ReducedGB::R, x, and zero.

Referenced by minimalize().