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

Function etree_find

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

Source from the content-addressed store, hash-verified

40/** Find the root of the tree/set containing the vertex i : Use Path halving */
41template <typename Index, typename IndexVector>
42Index etree_find(Index i, IndexVector& pp) {
43 Index p = pp(i); // Parent
44 Index gp = pp(p); // Grand parent
45 while (gp != p) {
46 pp(i) = gp; // Parent pointer on find path is changed to former grand parent
47 i = gp;
48 p = pp(i);
49 gp = pp(p);
50 }
51 return p;
52}
53
54/** Compute the column elimination tree of a sparse matrix
55 * \param mat The matrix in column-major format.

Callers 1

coletreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected