/*************************************************************************/ /* */ /* Copyright (c) 1994 Stanford University */ /* */ /* All rights reserved. */ /* */ /* Permission is given to use, copy, and modify this software for any */ /* non-commercial purpose as long as this copyright notice is not */ /* removed. All other uses, including redistribution in whole or in */ /* part, are forbidden without prior written permission. */ /* */ /* This software is provided with absolutely no warranty and no */ /* support. */ /* */ /*************************************************************************/ EXTERN_ENV #include "matrix.h" #include long *firstchild, *child; double *work_tree; void EliminationTreeFromA(SMatrix A, long *T, long *P, long *INVP) { long *subtree; long i, nd, nabor, j, r, nextr, root; subtree = (long *) malloc((A.n+1)*sizeof(long)); for (i=0; i<=A.n; i++) T[i] = subtree[i] = A.n; for (j=0; j=0; i--) { parent = T[i]; if (parent != i) { next[i] = firstchild[parent]; firstchild[parent] = i; } } for (i=0; i<=n; i++) { k = firstchild[i]; firstchild[i] = count; while (k != -1) { child[count++] = k; k = next[k]; } } firstchild[n+1] = count; free(next); } void ComputeNZ(SMatrix A, long *T, long *nz, long *PERM, long *INVP) { long i, j, nd, nabor, k; long *marker; marker = (long *) malloc(A.n*sizeof(long)); for (i=0; i max_super) max_super = size; supers++; current = i; size = 1; } } node[current] = size; if (size > max_super) max_super = size; node[A.n] = 0; printf("%ld supers, %4.2f nodes/super, %ld max super\n", supers, A.n/(double) supers, max_super); free(nchild); } void ComputeWorkTree(SMatrix A, long *nz, double *work_tree) { long i, j, nzj; for (j=0; j<=A.n; j++) { if (j != A.n) { nzj = nz[j]; work_tree[j] = nzj+nzj*(nzj-1); } else work_tree[j] = 0; for (i=firstchild[j]; i