28 #ifndef SPARSELU_HEAP_RELAX_SNODE_H 29 #define SPARSELU_HEAP_RELAX_SNODE_H 45 template <
typename Scalar,
typename Index>
54 for (i = 0; i < n+1; ++i) inv_post(post(i)) = i;
59 for (i = 0; i < n; ++i)
61 iwork(post(i)) = post(et(i));
70 for (j = 0; j < n; j++)
74 descendants(parent) += descendants(j) + 1;
79 Index nsuper_et_post = 0;
86 while ( parent != n && descendants(parent) < relax_columns )
94 for (i = snode_start; i <= j; ++i)
95 k = (std::min)(k, inv_post(i));
97 if ( (l - k) == (j - snode_start) )
105 for (i = snode_start; i <= j; ++i)
108 if (descendants(i) == 0)
117 while (descendants(j) != 0 && j < n) j++;
127 #endif // SPARSELU_HEAP_RELAX_SNODE_H iterative scaling algorithm to equilibrate rows and column norms in matrices
Derived & setZero(Index size)
Derived & setConstant(Index size, const Scalar &value)
void treePostorder(Index n, IndexVector &parent, IndexVector &post)
Post order a tree.
void heap_relax_snode(const Index n, IndexVector &et, const Index relax_columns, IndexVector &descendants, IndexVector &relax_end)
Identify the initial relaxed supernodes.