MCPcopy Create free account
hub / github.com/dblalock/bolt / dfs_kernel

Method dfs_kernel

cpp/src/external/eigen/src/SparseLU/SparseLU_panel_dfs.h:62–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60template <typename Scalar, typename StorageIndex>
61template <typename Traits>
62void SparseLUImpl<Scalar,StorageIndex>::dfs_kernel(const StorageIndex jj, IndexVector& perm_r,
63 Index& nseg, IndexVector& panel_lsub, IndexVector& segrep,
64 Ref<IndexVector> repfnz_col, IndexVector& xprune, Ref<IndexVector> marker, IndexVector& parent,
65 IndexVector& xplore, GlobalLU_t& glu,
66 Index& nextl_col, Index krow, Traits& traits
67 )
68{
69
70 StorageIndex kmark = marker(krow);
71
72 // For each unmarked krow of jj
73 marker(krow) = jj;
74 StorageIndex kperm = perm_r(krow);
75 if (kperm == emptyIdxLU ) {
76 // krow is in L : place it in structure of L(*, jj)
77 panel_lsub(nextl_col++) = StorageIndex(krow); // krow is indexed into A
78
79 traits.mem_expand(panel_lsub, nextl_col, kmark);
80 }
81 else
82 {
83 // krow is in U : if its supernode-representative krep
84 // has been explored, update repfnz(*)
85 // krep = supernode representative of the current row
86 StorageIndex krep = glu.xsup(glu.supno(kperm)+1) - 1;
87 // First nonzero element in the current column:
88 StorageIndex myfnz = repfnz_col(krep);
89
90 if (myfnz != emptyIdxLU )
91 {
92 // Representative visited before
93 if (myfnz > kperm ) repfnz_col(krep) = kperm;
94
95 }
96 else
97 {
98 // Otherwise, perform dfs starting at krep
99 StorageIndex oldrep = emptyIdxLU;
100 parent(krep) = oldrep;
101 repfnz_col(krep) = kperm;
102 StorageIndex xdfs = glu.xlsub(krep);
103 Index maxdfs = xprune(krep);
104
105 StorageIndex kpar;
106 do
107 {
108 // For each unmarked kchild of krep
109 while (xdfs < maxdfs)
110 {
111 StorageIndex kchild = glu.lsub(xdfs);
112 xdfs++;
113 StorageIndex chmark = marker(kchild);
114
115 if (chmark != jj )
116 {
117 marker(kchild) = jj;
118 StorageIndex chperm = perm_r(kchild);
119

Callers

nothing calls this directly

Calls 2

mem_expandMethod · 0.45
update_segrepMethod · 0.45

Tested by

no test coverage detected