MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / treePostorder

Function treePostorder

include/Eigen/src/SparseCore/SparseColEtree.h:168–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 */
167template <typename IndexVector>
168void treePostorder(typename IndexVector::Scalar n, IndexVector& parent, IndexVector& post) {
169 typedef typename IndexVector::Scalar StorageIndex;
170 IndexVector first_kid, next_kid; // Linked list of children
171 StorageIndex postnum;
172 // Allocate storage for working arrays and results
173 first_kid.resize(n + 1);
174 next_kid.setZero(n + 1);
175 post.setZero(n + 1);
176
177 // Set up structure describing children
178 first_kid.setConstant(-1);
179 for (StorageIndex v = n - 1; v >= 0; v--) {
180 StorageIndex dad = parent(v);
181 next_kid(v) = first_kid(dad);
182 first_kid(dad) = v;
183 }
184
185 // Depth-first search from dummy root vertex #n
186 postnum = 0;
187 internal::nr_etdfs(n, parent, first_kid, next_kid, post, postnum);
188}
189
190} // end namespace internal
191

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