31 #ifndef SPARSELU_PANEL_BMOD_H 32 #define SPARSELU_PANEL_BMOD_H 35 #include "./InternalHeaderCheck.h" 58 template <
typename Scalar,
typename StorageIndex>
62 Index ksub, jj, nextl_col;
63 Index fsupc, nsupc, nsupr, nrow;
67 Index segsize, no_zeros;
70 const Index PacketSize = internal::packet_traits<Scalar>::size;
72 for (ksub = 0; ksub < nseg; ksub++) {
80 fsupc = glu.xsup(glu.supno(krep));
81 nsupc = krep - fsupc + 1;
82 nsupr = glu.xlsub(fsupc + 1) - glu.xlsub(fsupc);
84 lptr = glu.xlsub(fsupc);
89 for (jj = jcol; jj < jcol + w; jj++) {
90 nextl_col = (jj - jcol) * m;
93 kfnz = repfnz_col(krep);
94 if (kfnz == emptyIdxLU)
continue;
96 segsize = krep - kfnz + 1;
98 u_rows = (std::max)(segsize, u_rows);
102 Index ldu = internal::first_multiple<Index>(u_rows, PacketSize);
107 for (jj = jcol; jj < jcol + w; jj++) {
108 nextl_col = (jj - jcol) * m;
112 kfnz = repfnz_col(krep);
113 if (kfnz == emptyIdxLU)
continue;
115 segsize = krep - kfnz + 1;
116 luptr = glu.xlusup(fsupc);
117 no_zeros = kfnz - fsupc;
119 Index isub = lptr + no_zeros;
120 Index off = u_rows - segsize;
121 for (
Index i = 0; i < off; i++) U(i, u_col) = 0;
122 for (
Index i = 0; i < segsize; i++) {
123 Index irow = glu.lsub(isub);
124 U(i + off, u_col) = dense_col(irow);
130 luptr = glu.xlusup(fsupc);
131 Index lda = glu.xlusup(fsupc + 1) - glu.xlusup(fsupc);
132 no_zeros = (krep - u_rows + 1) - fsupc;
133 luptr += lda * no_zeros + no_zeros;
135 U = A.template triangularView<UnitLower>().solve(U);
140 eigen_assert(tempv.size() > w * ldu + nrow * w + 1);
142 Index ldl = internal::first_multiple<Index>(nrow, PacketSize);
143 Index offset = (PacketSize - internal::first_default_aligned(B.data(), PacketSize)) % PacketSize;
150 for (jj = jcol; jj < jcol + w; jj++) {
151 nextl_col = (jj - jcol) * m;
155 kfnz = repfnz_col(krep);
156 if (kfnz == emptyIdxLU)
continue;
158 segsize = krep - kfnz + 1;
159 no_zeros = kfnz - fsupc;
160 Index isub = lptr + no_zeros;
162 Index off = u_rows - segsize;
163 for (
Index i = 0; i < segsize; i++) {
164 Index irow = glu.lsub(isub++);
165 dense_col(irow) = U.coeff(i + off, u_col);
166 U.coeffRef(i + off, u_col) = 0;
170 for (
Index i = 0; i < nrow; i++) {
171 Index irow = glu.lsub(isub++);
172 dense_col(irow) -= L.coeff(i, u_col);
173 L.coeffRef(i, u_col) = 0;
180 for (jj = jcol; jj < jcol + w; jj++) {
181 nextl_col = (jj - jcol) * m;
185 kfnz = repfnz_col(krep);
186 if (kfnz == emptyIdxLU)
continue;
188 segsize = krep - kfnz + 1;
189 luptr = glu.xlusup(fsupc);
191 Index lda = glu.xlusup(fsupc + 1) - glu.xlusup(fsupc);
195 no_zeros = kfnz - fsupc;
197 LU_kernel_bmod<1>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
198 else if (segsize == 2)
199 LU_kernel_bmod<2>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
200 else if (segsize == 3)
201 LU_kernel_bmod<3>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
203 LU_kernel_bmod<Dynamic>::run(segsize, dense_col, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr,
215 #endif // SPARSELU_PANEL_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
constexpr const Scalar * data() const
Definition: PlainObjectBase.h:247
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
void panel_bmod(const Index m, const Index w, const Index jcol, const Index nseg, ScalarVector &dense, ScalarVector &tempv, IndexVector &segrep, IndexVector &repfnz, GlobalLU_t &glu)
Performs numeric block updates (sup-panel) in topological order.
Definition: SparseLU_panel_bmod.h:59
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