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

◆ auto_reduce_by()

void gbA::auto_reduce_by ( int id)
private

Definition at line 2086 of file gb-default.cpp.

2087{
2088 /* Loop backwards while degree doesn't change */
2089 /* Don't change quotient ring elements */
2090 gbelem *me = gb[id];
2091 int a = me->gap; // Only auto reduce those that are of the same degree
2092 // and not a higher gap level
2093 for (int i = INTSIZE(gb) - 1; i >= first_gb_element; i--)
2094 {
2095 if (!gb[i]) continue;
2096 if (i == id) continue;
2097 gbelem *g = gb[i];
2098 if (g->deg < me->deg) return;
2099 if (g->gap < a) continue;
2100 if (M2_gbTrace >= 10)
2101 {
2102 buffer o;
2103 o << " auto reduce " << i << " by " << id;
2104 emit_line(o.str());
2105 }
2106 if (over_ZZ())
2107 {
2108 R->gbvector_auto_reduce_ZZ(_F,
2109 _Fsyz,
2110 g->g.f,
2111 g->g.fsyz, // these are modified
2112 me->g.f,
2113 me->g.fsyz);
2114 }
2115 else
2116 {
2117 R->gbvector_auto_reduce(_F,
2118 _Fsyz,
2119 g->g.f,
2120 g->g.fsyz, // these are modified
2121 me->g.f,
2122 me->g.fsyz);
2123 }
2124 }
2125}
char * str()
Definition buffer.hpp:72
GBRing * R
int first_gb_element
const FreeModule * _F
const FreeModule * _Fsyz
bool over_ZZ() const
void gb(IntermediateBasis &F, int n)
int M2_gbTrace
Definition m2-types.cpp:52
GBF4Polynomial f
Definition f4-types.hpp:139
int deg
Definition f4-types.hpp:140
#define INTSIZE(a)
Definition style.hpp:37
void emit_line(const char *s)
Definition text-io.cpp:47

References _F, _Fsyz, gbA::gbelem::deg, emit_line(), POLY::f, first_gb_element, POLY::fsyz, gbA::gbelem::g, gbA::gbelem::gap, gb(), INTSIZE, M2_gbTrace, over_ZZ(), R, and buffer::str().

Referenced by insert_gb(), and replace_gb_element_ZZ().