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

◆ findPivot() [2/3]

size_t DMatLUinPlace< M2::ARingRRR >::findPivot ( size_t row,
size_t col )
inlineprivate

Definition at line 184 of file dmat-lu-inplace.hpp.

185{
186 // Look at elements A[row,col], A[row+1,col], ..., A[nrows-1, col]
187 // Return the index r s.y. abs(A[r,col]) is maximum over all of these
188
190 size_t best_row_so_far = static_cast<size_t>(-1);
191
192 ring().set_zero(largest);
193 for (size_t i = row; i < mLU.numRows(); i++)
194 {
195 ring().abs(abs, mLU.entry(i, col));
196 if (ring().compare_elems(abs, largest) > 0)
197 {
199 ring().set(largest, abs);
200 }
201 }
202 return best_row_so_far;
203}
const RingType & ring() const
#define abs(x)
Definition polyroots.cpp:51