47void SparseLUImpl<Scalar,Index>::relax_snode (const Index n, IndexVector& et, const Index relax_columns, IndexVector& descendants, IndexVector& relax_end)
48{
49
50// compute the number of descendants of each node in the etree
51 Index j, parent;
52 relax_end.setConstant(emptyIdxLU);
53 descendants.setZero();
54for (j = 0; j < n; j++)
55 {
56 parent = et(j);
57if (parent != n) // not the dummy root
58 descendants(parent) += descendants(j) + 1;
59 }
60// Identify the relaxed supernodes by postorder traversal of the etree
61 Index snode_start; // beginning of a snode
62for (j = 0; j < n; )
63 {
64 parent = et(j);
65 snode_start = j;
66while ( parent != n && descendants(parent) < relax_columns )
67 {
68 j = parent;
69 parent = et(j);
70 }
71// Found a supernode in postordered etree, j is the last column
72 relax_end(snode_start) = j; // Record last column