30 #ifndef SPARSELU_PIVOTL_H 31 #define SPARSELU_PIVOTL_H 59 template <
typename Scalar,
typename StorageIndex>
64 Index nsupc = jcol - fsupc;
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]);
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]);
129 for (k = nsupc+1; k < nsupr; k++)
130 lu_col_ptr[k] *= temp;
137 #endif // SPARSELU_PIVOTL_H
Matrix diag(const std::vector< Matrix > &Hs)
Namespace containing all symbols from the Eigen library.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
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.
NumTraits< Scalar >::Real RealScalar
ScalarVector::RealScalar RealScalar
void swap(mpfr::mpreal &x, mpfr::mpreal &y)