30 #ifndef SPARSELU_PIVOTL_H
31 #define SPARSELU_PIVOTL_H
59 template <
typename Scalar,
typename StorageIndex>
64 Index nsupc = jcol - fsupc;
68 Scalar* lu_sup_ptr = &(glu.
lusup.data()[glu.
xlusup(fsupc)]);
69 Scalar* lu_col_ptr = &(glu.
lusup.data()[glu.
xlusup(jcol)]);
70 StorageIndex* lsub_ptr = &(glu.
lsub.data()[lptr]);
73 Index diagind = iperm_c(jcol);
78 Index isub, icol, itemp, k;
79 for (isub = nsupc; isub < nsupr; ++isub) {
81 rtemp =
abs(lu_col_ptr[isub]);
86 if (lsub_ptr[isub] == diagind) diag = isub;
92 pivrow = pivmax <
RealScalar(0.0) ? diagind : lsub_ptr[pivptr];
93 perm_r(pivrow) = StorageIndex(jcol);
107 rtemp =
abs(lu_col_ptr[diag]);
108 if (rtemp !=
RealScalar(0.0) && rtemp >= thresh) pivptr = diag;
110 pivrow = lsub_ptr[pivptr];
114 perm_r(pivrow) = StorageIndex(jcol);
116 if (pivptr != nsupc )
118 std::swap( lsub_ptr[pivptr], lsub_ptr[nsupc] );
121 for (icol = 0; icol <= nsupc; icol++)
123 itemp = pivptr + icol * lda;
124 std::swap(lu_sup_ptr[itemp], lu_sup_ptr[nsupc + icol * lda]);
128 Scalar temp = Scalar(1.0) / lu_col_ptr[nsupc];
129 for (k = nsupc+1; k < nsupr; k++)
130 lu_col_ptr[k] *= temp;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
Definition: ArrayCwiseUnaryOps.h:52
ScalarVector::RealScalar RealScalar
Definition: SparseLUImpl.h:27
Index pivotL(const Index jcol, const RealScalar &diagpivotthresh, IndexVector &perm_r, IndexVector &iperm_c, Index &pivrow, GlobalLU_t &glu)
Performs the numerical pivotin on the current column of L, and the CDIV operation.
Definition: SparseLU_pivotL.h:60
@ emptyIdxLU
Definition: SparseLU_Memory.h:38
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: document.h:416
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
Definition: json.hpp:25399
Definition: SparseLU_Structs.h:77
IndexVector xsup
Definition: SparseLU_Structs.h:79
IndexVector xlusup
Definition: SparseLU_Structs.h:83
IndexVector supno
Definition: SparseLU_Structs.h:80
IndexVector lsub
Definition: SparseLU_Structs.h:82
IndexVector xlsub
Definition: SparseLU_Structs.h:84
ScalarVector lusup
Definition: SparseLU_Structs.h:81