MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / treePostorder

Function treePostorder

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

Source from the content-addressed store, hash-verified

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

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