Macaulay2 Engine
Loading...
Searching...
No Matches
◆
findPivot()
[1/3]
size_t
DMatLUinPlace
<
M2::ARingCCC
>::findPivot
(
size_t
row
,
size_t
col
)
inline
private
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();
212
M2::ARingRRR::Element
largest
(
RR
),
abs
(
RR
);
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
{
222
best_row_so_far
=
i
;
223
RR
.set(
largest
,
abs
);
224
}
225
}
226
return
best_row_so_far
;
227
}
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