30 #ifndef SPARSELU_PANEL_DFS_H 31 #define SPARSELU_PANEL_DFS_H 37 template<
typename IndexVector>
42 : m_jcol(jcol), m_marker(marker)
44 bool update_segrep(Index krep, Index jj)
46 if(m_marker[krep]<m_jcol)
53 void mem_expand(IndexVector& , Index , Index ) {}
54 enum { ExpandMem =
false };
60 template <
typename Scalar,
typename Index>
61 template <
typename Traits>
63 Index& nseg, IndexVector& panel_lsub, IndexVector& segrep,
65 IndexVector& xplore, GlobalLU_t& glu,
66 Index& nextl_col, Index krow, Traits&
traits 70 Index kmark = marker(krow);
74 Index kperm = perm_r(krow);
75 if (kperm == emptyIdxLU ) {
77 panel_lsub(nextl_col++) = krow;
79 traits.mem_expand(panel_lsub, nextl_col, kmark);
86 Index krep = glu.xsup(glu.supno(kperm)+1) - 1;
88 Index myfnz = repfnz_col(krep);
90 if (myfnz != emptyIdxLU )
93 if (myfnz > kperm ) repfnz_col(krep) = kperm;
99 Index oldrep = emptyIdxLU;
100 parent(krep) = oldrep;
101 repfnz_col(krep) = kperm;
102 Index xdfs = glu.xlsub(krep);
103 Index maxdfs = xprune(krep);
109 while (xdfs < maxdfs)
111 Index kchild = glu.lsub(xdfs);
113 Index chmark = marker(kchild);
118 Index chperm = perm_r(kchild);
120 if (chperm == emptyIdxLU)
123 panel_lsub(nextl_col++) = kchild;
124 traits.mem_expand(panel_lsub, nextl_col, chmark);
131 Index chrep = glu.xsup(glu.supno(chperm)+1) - 1;
132 myfnz = repfnz_col(chrep);
134 if (myfnz != emptyIdxLU)
137 repfnz_col(chrep) = chperm;
144 parent(krep) = oldrep;
145 repfnz_col(krep) = chperm;
146 xdfs = glu.xlsub(krep);
147 maxdfs = xprune(krep);
160 if(traits.update_segrep(krep,jj))
169 if (kpar == emptyIdxLU)
173 maxdfs = xprune(krep);
175 }
while (kpar != emptyIdxLU);
218 template <
typename Scalar,
typename Index>
219 void SparseLUImpl<Scalar,Index>::panel_dfs(
const Index m,
const Index w,
const Index jcol,
MatrixType& A,
IndexVector& perm_r, Index& nseg,
ScalarVector& dense,
IndexVector& panel_lsub,
IndexVector& segrep,
IndexVector& repfnz,
IndexVector& xprune,
IndexVector& marker,
IndexVector& parent,
IndexVector& xplore,
GlobalLU_t& glu)
230 for (Index jj = jcol; jj < jcol + w; jj++)
232 nextl_col = (jj - jcol) * m;
241 Index krow = it.row();
242 dense_col(krow) = it.value();
244 Index kmark = marker(krow);
248 dfs_kernel(jj, perm_r, nseg, panel_lsub, segrep, repfnz_col, xprune, marker, parent,
249 xplore, glu, nextl_col, krow, traits);
258 #endif // SPARSELU_PANEL_DFS_H A versatible sparse matrix representation.
Definition: SparseMatrix.h:85
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Definition: SparseLU_Structs.h:77
Expression of a fixed-size or dynamic-size sub-vector.
Definition: ForwardDeclarations.h:83
Definition: SparseMatrix.h:872
A matrix or vector expression mapping an existing expressions.
Definition: Ref.h:17
Base class for sparseLU.
Definition: SparseLUImpl.h:20
Definition: BandTriangularSolver.h:13
void panel_dfs(const Index m, const Index w, const Index jcol, MatrixType &A, IndexVector &perm_r, Index &nseg, ScalarVector &dense, IndexVector &panel_lsub, IndexVector &segrep, IndexVector &repfnz, IndexVector &xprune, IndexVector &marker, IndexVector &parent, IndexVector &xplore, GlobalLU_t &glu)
Performs a symbolic factorization on a panel of columns [jcol, jcol+w)
Definition: SparseLU_panel_dfs.h:219
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
Definition: SparseLU_panel_dfs.h:38
Definition: ForwardDeclarations.h:17
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48