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

◆ findPivot() [1/3]

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

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

207{
208 // Look at elements A[row,col], A[row+1,col], ..., A[nrows-1, col]
209 // Return the index r s.y. abs(A[r,col]) is maximum over all of these
210
211 const M2::ARingRRR& RR = ring().real_ring();
213 size_t best_row_so_far = static_cast<size_t>(-1);
214
215 RR.set_zero(largest);
216
217 for (size_t i = row; i < mLU.numRows(); i++)
218 {
219 ring().abs(abs, mLU.entry(i, col));
220 if (RR.compare_elems(abs, largest) > 0)
221 {
223 RR.set(largest, abs);
224 }
225 }
226 return best_row_so_far;
227}
const RingType & ring() const
#define abs(x)
Definition polyroots.cpp:51