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);
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