31 #ifndef SPARSELU_COLUMN_BMOD_H 32 #define SPARSELU_COLUMN_BMOD_H 35 #include "./InternalHeaderCheck.h" 55 template <
typename Scalar,
typename StorageIndex>
59 Index jsupno, k, ksub, krep, ksupno;
60 Index lptr, nrow, isub, irow, nextlu, new_next, ufirst;
61 Index fsupc, nsupc, nsupr, luptr, kfnz, no_zeros;
71 jsupno = glu.supno(jcol);
78 for (ksub = 0; ksub < nseg; ksub++) {
81 ksupno = glu.supno(krep);
82 if (jsupno != ksupno) {
84 fsupc = glu.xsup(ksupno);
85 fst_col = (std::max)(fsupc, fpanelc);
89 d_fsupc = fst_col - fsupc;
91 luptr = glu.xlusup(fst_col) + d_fsupc;
92 lptr = glu.xlsub(fsupc) + d_fsupc;
95 kfnz = (std::max)(kfnz, fpanelc);
97 segsize = krep - kfnz + 1;
98 nsupc = krep - fst_col + 1;
99 nsupr = glu.xlsub(fsupc + 1) - glu.xlsub(fsupc);
100 nrow = nsupr - d_fsupc - nsupc;
101 Index lda = glu.xlusup(fst_col + 1) - glu.xlusup(fst_col);
105 no_zeros = kfnz - fst_col;
107 LU_kernel_bmod<1>::run(segsize, dense, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
109 LU_kernel_bmod<Dynamic>::run(segsize, dense, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
114 nextlu = glu.xlusup(jcol);
115 fsupc = glu.xsup(jsupno);
119 new_next = nextlu + glu.xlsub(fsupc + 1) - glu.xlsub(fsupc);
120 Index offset = internal::first_multiple<Index>(new_next, internal::packet_traits<Scalar>::size) - new_next;
121 if (offset) new_next += offset;
122 while (new_next > glu.nzlumax) {
123 mem = memXpand<ScalarVector>(glu.lusup, glu.nzlumax, nextlu, LUSUP, glu.num_expansions);
127 for (isub = glu.xlsub(fsupc); isub < glu.xlsub(fsupc + 1); isub++) {
128 irow = glu.lsub(isub);
129 glu.lusup(nextlu) = dense(irow);
130 dense(irow) = Scalar(0.0);
135 glu.lusup.segment(nextlu, offset).setZero();
138 glu.xlusup(jcol + 1) = StorageIndex(nextlu);
146 fst_col = (std::max)(fsupc, fpanelc);
148 if (fst_col < jcol) {
151 d_fsupc = fst_col - fsupc;
153 lptr = glu.xlsub(fsupc) + d_fsupc;
154 luptr = glu.xlusup(fst_col) + d_fsupc;
155 nsupr = glu.xlsub(fsupc + 1) - glu.xlsub(fsupc);
156 nsupc = jcol - fst_col;
157 nrow = nsupr - d_fsupc - nsupc;
160 ufirst = glu.xlusup(jcol) + d_fsupc;
161 Index lda = glu.xlusup(jcol + 1) - glu.xlusup(jcol);
164 u = A.template triangularView<UnitLower>().solve(u);
168 l.noalias() -= A * u;
177 #endif // SPARSELU_COLUMN_BMOD_H A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
Index column_bmod(const Index jcol, const Index nseg, BlockScalarVector dense, ScalarVector &tempv, BlockIndexVector segrep, BlockIndexVector repfnz, Index fpanelc, GlobalLU_t &glu)
Performs numeric block updates (sup-col) in topological order.
Definition: SparseLU_column_bmod.h:56
Expression of a fixed-size or dynamic-size sub-vector.
Definition: ForwardDeclarations.h:98
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:264
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:186
Convenience specialization of Stride to specify only an outer stride See class Map for some examples...
Definition: Stride.h:104