Macaulay2 Engine
Loading...
Searching...
No Matches
◆
findPivot()
[2/3]
size_t
DMatLUinPlace
<
M2::ARingRRR
>::findPivot
(
size_t
row
,
size_t
col
)
inline
private
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
189
M2::ARingRRR::Element
largest
(
ring
()),
abs
(
ring
());
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
{
198
best_row_so_far
=
i
;
199
ring
().set(
largest
,
abs
);
200
}
201
}
202
return
best_row_so_far
;
203
}
DMatLUinPlace::ring
const RingType & ring() const
Definition
dmat-lu-inplace.hpp:94
DMatLUinPlace::mLU
Mat mLU
Definition
dmat-lu-inplace.hpp:115
DMatLUinPlace
Definition
dmat-lu-inplace.hpp:86
abs
#define abs(x)
Definition
polyroots.cpp:51
DMatLUinPlace
Generated on
for Macaulay2 Engine by
1.15.0