MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / nr_etdfs

Function nr_etdfs

Externals/eigen/Eigen/src/SparseCore/SparseColEtree.h:129–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127*/
128template <typename Index, typename IndexVector>
129void nr_etdfs (Index n, IndexVector& parent, IndexVector& first_kid, IndexVector& next_kid, IndexVector& post, Index postnum)
130{
131 Index current = n, first, next;
132 while (postnum != n)
133 {
134 // No kid for the current node
135 first = first_kid(current);
136
137 // no kid for the current node
138 if (first == -1)
139 {
140 // Numbering this node because it has no kid
141 post(current) = postnum++;
142
143 // looking for the next kid
144 next = next_kid(current);
145 while (next == -1)
146 {
147 // No more kids : back to the parent node
148 current = parent(current);
149 // numbering the parent node
150 post(current) = postnum++;
151
152 // Get the next kid
153 next = next_kid(current);
154 }
155 // stopping criterion
156 if (postnum == n+1) return;
157
158 // Updating current node
159 current = next;
160 }
161 else
162 {
163 current = first;
164 }
165 }
166}
167
168
169/**

Callers 1

treePostorderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected