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

◆ reduce() [2/3]

void GaussElimComputation::reduce ( vec & f)
private

Definition at line 152 of file gauss.cpp.

153{
154 vecterm head;
155 vecterm *result = &head;
156
157 while (f != nullptr)
158 {
159 int r = f->comp;
160 if (gb_list[r] != nullptr)
161 {
162 // Reduce w.r.t. this term
163 ring_elem c = f->coeff;
164 c = R->negate(c);
165 vec g = R->mult_vec(c, gb_list[r]->f);
166 R->add_vec_to(f, g);
167 }
168 else
169 {
170 result->next = f;
171 f = f->next;
172 result = result->next;
173 }
174 }
175
176 result->next = nullptr;
177 f = head.next;
178}
gm_elem ** gb_list
Definition gauss.hpp:63
const Ring * R
Definition gauss.hpp:66
VALGRIND_MAKE_MEM_DEFINED & result(result)

References gb_list, vec::next, R, and result().