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

◆ gbvector_normal_form()

void QRingInfo_ZZ::gbvector_normal_form ( const FreeModule * F,
gbvector *& f ) const
virtual

Reimplemented from QRingInfo.

Definition at line 414 of file qring.cpp.

417{
419
420 GBRing *GR = R->get_gb_ring();
421 gbvector head;
422 gbvector *result = &head;
423 gbvector *t = f;
424 while (t != nullptr)
425 {
426 GR->gbvector_get_lead_exponents(F, t, EXP1);
427 int w = ringtableZZ->find_smallest_coeff_divisor(EXP1, 1);
428 if (w >= 0)
429 {
430 // reduce lead term as much as possible
431 // If the lead monomial reduces away, continue,
432 // else tack the monomial onto the result
433 const gbvector *g = quotient_gbvector(w);
434 gbvector *zero = nullptr;
435 if (GR->gbvector_reduce_lead_term_ZZ(F, F, t, zero, g, zero))
436 continue;
437 }
438 result->next = t;
439 t = t->next;
440 result = result->next;
441 }
442 result->next = nullptr;
443 f = head.next;
444}
exponents::Exponents exponents_t
bool gbvector_reduce_lead_term_ZZ(const FreeModule *F, const FreeModule *Fsyz, gbvector *&f, gbvector *&fsyz, const gbvector *g, const gbvector *gsyz)
Definition gbring.cpp:1027
void gbvector_get_lead_exponents(const FreeModule *F, const gbvector *f, int *result)
Definition gbring.cpp:541
MonomialTableZZ * ringtableZZ
Definition qring.hpp:245
const PolyRing * R
Definition qring.hpp:83
size_t exp_size
Definition qring.hpp:86
const gbvector * quotient_gbvector(int i) const
Definition qring.hpp:99
int zero
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define ALLOCATE_EXPONENTS(byte_len)
Definition monoid.hpp:62
gbvector * next
Definition gbring.hpp:80

References ALLOCATE_EXPONENTS, QRingInfo::exp_size, GBRing::gbvector_get_lead_exponents(), GBRing::gbvector_reduce_lead_term_ZZ(), gbvector::next, QRingInfo::quotient_gbvector(), QRingInfo::R, result(), ringtableZZ, and zero.