MCPcopy Create free account
hub / github.com/PX4/eigen / treePostorder

Function treePostorder

Eigen/src/SparseCore/SparseColEtree.h:178–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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