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

Function treePostorder

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

Source from the content-addressed store, hash-verified

174 */
175template <typename Index, typename IndexVector>
176void treePostorder(Index n, IndexVector& parent, IndexVector& post)
177{
178 IndexVector first_kid, next_kid; // Linked list of children
179 Index postnum;
180 // Allocate storage for working arrays and results
181 first_kid.resize(n+1);
182 next_kid.setZero(n+1);
183 post.setZero(n+1);
184
185 // Set up structure describing children
186 Index v, dad;
187 first_kid.setConstant(-1);
188 for (v = n-1; v >= 0; v--)
189 {
190 dad = parent(v);
191 next_kid(v) = first_kid(dad);
192 first_kid(dad) = v;
193 }
194
195 // Depth-first search from dummy root vertex #n
196 postnum = 0;
197 internal::nr_etdfs(n, parent, first_kid, next_kid, post, postnum);
198}
199
200} // end namespace internal
201

Callers 2

analyzePatternMethod · 0.85
heap_relax_snodeMethod · 0.85

Calls 3

nr_etdfsFunction · 0.85
resizeMethod · 0.45
setZeroMethod · 0.45

Tested by

no test coverage detected