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

◆ do_pivots()

void FF_LUComputation::do_pivots ( int lo,
int hi,
int pivot_col )
private

Definition at line 54 of file fractionfreeLU.cpp.

55{
56 // Here we clear out row r in columns lo..hi, using the pivot.
57 R->remove(lastpivot);
59 size_t pivot_row = M->lead_row(
60 pivotCol, pivot); // pivot is the element at (pivot_row, pivotCol)
61
62 for (int i = lo; i <= hi; i++)
63 {
64 ring_elem a;
65 size_t r = M->lead_row(i, a);
66 if (r == pivot_row)
67 {
68 // Need to modify column i:
69 // col(i) := pivot*M[i] - M[pivot_row,i] * M[pivotCol]
70 R->negate_to(a);
71 M->scale_column(i, pivot);
72 M->column_op(i, a, pivotCol);
73 }
74
75 if (need_div[i]) M->divide_column(i, lastpivot);
76
77 need_div[i] = (r == pivot_row);
78 }
79}
MutableMatrix * M

References lastpivot, M, need_div, pivot, and R.

Referenced by calc().