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

◆ reset_degree()

void M2::ARingTower::reset_degree ( ARingPolynomial & f) const
private

Definition at line 118 of file aring-tower.cpp.

119{
120 if (f == nullptr) return;
121 int fdeg = f->deg;
122 for (int j = fdeg; j >= 0; --j)
123 if (f->polys[j] != nullptr)
124 {
125 f->deg = j;
126 return;
127 }
128 // at this point, everything is 0!
129 dealloc_poly(f); // sets f to 0
130}
void dealloc_poly(ARingPolynomial &f) const

References dealloc_poly(), M2::ARingPolynomialStruct::deg, and M2::ARingPolynomialStruct::polys.

Referenced by add_in_place(), and subtract_in_place().