30 #ifndef SPARSELU_COLUMN_DFS_H 31 #define SPARSELU_COLUMN_DFS_H 34 #include "./InternalHeaderCheck.h" 39 template <
typename Scalar,
typename StorageIndex>
42 template <
typename IndexVector,
typename ScalarVector>
43 struct column_dfs_traits : no_assignment_operator {
44 typedef typename ScalarVector::Scalar Scalar;
45 typedef typename IndexVector::Scalar StorageIndex;
46 column_dfs_traits(
Index jcol,
Index& jsuper,
typename SparseLUImpl<Scalar, StorageIndex>::GlobalLU_t& glu,
48 : m_jcol(jcol), m_jsuper_ref(jsuper), m_glu(glu), m_luImpl(luImpl) {}
49 bool update_segrep(
Index ,
Index ) {
return true; }
50 void mem_expand(IndexVector& lsub,
Index& nextl,
Index chmark) {
51 if (nextl >= m_glu.nzlmax) m_luImpl.memXpand(lsub, m_glu.nzlmax, nextl, LSUB, m_glu.num_expansions);
52 if (chmark != (m_jcol - 1)) m_jsuper_ref = emptyIdxLU;
54 enum { ExpandMem =
true };
58 typename SparseLUImpl<Scalar, StorageIndex>::GlobalLU_t& m_glu;
59 SparseLUImpl<Scalar, StorageIndex>& m_luImpl;
89 template <
typename Scalar,
typename StorageIndex>
95 Index jsuper = glu.supno(jcol);
96 Index nextl = glu.xlsub(jcol);
99 column_dfs_traits<IndexVector, ScalarVector> traits(jcol, jsuper, glu, *
this);
102 for (
Index k = 0; ((k < m) ? lsub_col[k] != emptyIdxLU :
false); k++) {
103 Index krow = lsub_col(k);
104 lsub_col(k) = emptyIdxLU;
105 Index kmark = marker2(krow);
108 if (kmark == jcol)
continue;
110 dfs_kernel(StorageIndex(jcol), perm_r, nseg, glu.lsub, segrep, repfnz, xprune, marker2, parent, xplore, glu, nextl,
115 StorageIndex nsuper = glu.supno(jcol);
116 StorageIndex jcolp1 = StorageIndex(jcol) + 1;
117 Index jcolm1 = jcol - 1;
121 nsuper = glu.supno(0) = 0;
123 fsupc = glu.xsup(nsuper);
124 StorageIndex jptr = glu.xlsub(jcol);
125 StorageIndex jm1ptr = glu.xlsub(jcolm1);
128 if ((nextl - jptr != jptr - jm1ptr - 1)) jsuper = emptyIdxLU;
132 if ((jcol - fsupc) >= maxsuper) jsuper = emptyIdxLU;
139 if (jsuper == emptyIdxLU) {
140 if ((fsupc < jcolm1 - 1)) {
141 StorageIndex ito = glu.xlsub(fsupc + 1);
142 glu.xlsub(jcolm1) = ito;
143 StorageIndex istop = ito + jptr - jm1ptr;
144 xprune(jcolm1) = istop;
145 glu.xlsub(jcol) = istop;
147 for (StorageIndex ifrom = jm1ptr; ifrom < nextl; ++ifrom, ++ito) glu.lsub(ito) = glu.lsub(ifrom);
151 glu.supno(jcol) = nsuper;
156 glu.xsup(nsuper + 1) = jcolp1;
157 glu.supno(jcolp1) = nsuper;
158 xprune(jcol) = StorageIndex(nextl);
159 glu.xlsub(jcolp1) = StorageIndex(nextl);
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
Index column_dfs(const Index m, const Index jcol, IndexVector &perm_r, Index maxsuper, Index &nseg, BlockIndexVector lsub_col, IndexVector &segrep, BlockIndexVector repfnz, IndexVector &xprune, IndexVector &marker, IndexVector &parent, IndexVector &xplore, GlobalLU_t &glu)
Performs a symbolic factorization on column jcol and decide the supernode boundary.
Definition: SparseLU_column_dfs.h:90
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
Definition: SparseLU_column_dfs.h:40
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:186