20 #include "order/order_internal.h"
71 #if defined(PASTIX_DEBUG_ORDERING)
80 pastix_print_error(
"compute_subtree_size: sum of the subtree = %ld n = %ld", (
long)sum, (
long)n );
145 #if defined(PASTIX_DEBUG_ORDERING)
147 assert(T[i] <= T[father[i]]);
153 perm[i] = T[father[i]];
154 T[father[i]] -= T[i];
156 assert(perm[father[i]] >= perm[i]);
165 #if defined(PASTIX_DEBUG_ORDERING)
169 assert(perm[i] >= 0);
180 if(invp[i] != 1) { k++; }
183 pastix_print_error(
"Number of errors in perm vector in postorder %ld", (
long)k );
262 for(j=ia[node];j<ia[node+1];j++)
266 if(perm[k] < perm[node])
270 while(father[vroot] != -1 && father[vroot] != node)
281 vroot = father[vroot];
284 father[vroot] = node;
299 #if defined(PASTIX_DEBUG_ORDERING)
303 if(perm[i] > perm[father[i]])
305 fprintf(stderr,
"Node %ld perm=%ld Father %ld perm=%ld \n",
306 (
long)i, (
long)perm[i], (
long)father[i], (
long)perm[father[i]]);
307 assert(perm[i] <= perm[father[i]]);
380 assert( graph->colptr[0] == 0 );
383 if ( ordeptr->
rangtab != NULL ) {
384 memFree_null( ordeptr->
rangtab );
386 if ( ordeptr->
treetab != NULL ) {
387 memFree_null( ordeptr->
treetab );
393 #if defined(PASTIX_DEBUG_ORDERING)
396 assert(perm[i] >= 0);
398 assert(invp[i] >= 0);
414 pastix_print_error(
"perm array is not valid, number of error = %ld", (
long)k );
444 for(i=ia[pj];i<ia[pj+1];i++)
450 if(k < j - T[pj]+1 ) {
492 assert( snodenbr > 0 );
499 for(i=0;i<snodenbr;i++) {
500 for(j=T[i];j<T[i+1];j++) {
506 for(i=0;i<snodenbr;i++)
509 for(j=T[i];j<T[i+1];j++)
511 dad = S[perm[father[invp[j]]]];
512 if( dad < k && dad > i) {
521 assert((treetab[i] == -1) || (treetab[i] >= i));
538 assert(ordeptr->
rangtab[0] == 0);
BEGIN_C_DECLS typedef int pastix_int_t
static void compute_elimination_tree(pastix_int_t n, const pastix_int_t *ia, const pastix_int_t *ja, const pastix_int_t *perm, const pastix_int_t *invp, pastix_int_t *father)
Compute the elimination tree of a matrix A (without computing the symbolic factorization) associated ...
static void compute_post_order(pastix_int_t n, const pastix_int_t *father, pastix_int_t *perm, pastix_int_t *invp, pastix_int_t *T)
Computes the post order of the elimination tree given on entry.
static void compute_subtree_size(pastix_int_t n, const pastix_int_t *father, const pastix_int_t *iperm, pastix_int_t *T)
Computes the size of each subtree.
void orderFindSupernodes(const pastix_graph_t *graph, pastix_order_t *const ordeptr)
Computes the set of supernodes for a given permutation.