117 Int prevleaf, q, s, sparent ;
118 if (First [p] > PrevNbr [u])
122 prevleaf = PrevLeaf [u] ;
123 if (prevleaf ==
EMPTY)
133 for (q = prevleaf ; q != SetParent [q] ; q = SetParent [q])
140 for (s = prevleaf ; s != q ; s = sparent)
142 sparent = SetParent [s] ;
150 if (RowCount !=
NULL)
154 RowCount [u] += (Level [p] - Level [q]) ;
177 if (Parent [p] !=
EMPTY)
179 SetParent [p] = Parent [p] ;
211 Int *Ap, *Ai, *Anz, *PrevNbr, *SetParent, *Head, *PrevLeaf, *Anext, *Ipost,
213 Int i, j, r, k, len, s, p, pend, inew, stype, nf, anz, inode, parent,
214 nrow, ncol, packed, use_fset, jj ;
278 Iwork = Common->Iwork ;
280 PrevNbr = Iwork + nrow ;
281 Anext = Iwork + 2*((size_t) nrow) ;
282 PrevLeaf = Common->Flag ;
283 Head = Common->Head ;
292 for (i = 0 ; i < nrow ; i++)
298 for (k = 0 ; k < nrow ; k++)
305 ColCount [i] = (First [i] ==
EMPTY) ? 1 : 0 ;
310 for (r = i ; (r !=
EMPTY) && (First [r] ==
EMPTY) ; r = Parent [r])
326 for (s = i ; s != r ; s = Parent [s])
342 for (k = 0 ; k < nrow ; k++)
344 Ipost [Post [k]] = k ;
346 use_fset = (fset !=
NULL) ;
351 for (j = 0 ; j < ncol ; j++)
357 for (jj = 0 ; jj < nf ; jj++)
360 if (j < 0 || j > ncol || Anext [j] != -2)
376 for (jj = 0 ; jj < nf ; jj++)
378 j = (use_fset) ? (fset [jj]) : jj ;
381 pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
382 ff = (double)
MAX (0, pend - p) ;
387 for ( ; p < pend ; p++)
389 inew = Ipost [Ai [p]] ;
393 ASSERT (k >= 0 && k < nrow) ;
394 Anext [j] = Head [k] ;
407 if (RowCount !=
NULL)
409 for (i = 0 ; i < nrow ; i++)
414 for (i = 0 ; i < nrow ; i++)
416 PrevLeaf [i] =
EMPTY ;
417 PrevNbr [i] =
EMPTY ;
430 for (k = 0 ; k < nrow ; k++)
437 pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
438 for ( ; p < pend ; p++)
446 PrevLeaf, RowCount, SetParent, Level) ;
461 for (k = 0 ; k < nrow ; k++)
467 for (j = Head [k] ; j !=
EMPTY ; j = Anext [j])
472 pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
473 for ( ; p < pend ; p++)
482 PrevLeaf, RowCount, SetParent, Level) ;
497 for (j = 0 ; j < nrow ; j++)
499 parent = Parent [j] ;
503 ColCount [parent] += ColCount [j] ;
511 Common->mark =
EMPTY ;
523 for (j = 0 ; j < nrow ; j++)
525 ff = (double) (ColCount [j]) ;
531 PRINT1 ((
"rowcol fl %g lnz %g\n", Common->fl, Common->lnz)) ;
#define CHOLMOD_TOO_LARGE
static void amesos_process_edge(Int p, Int u, Int k, Int First[], Int PrevNbr[], Int ColCount[], Int PrevLeaf[], Int RowCount[], Int SetParent[], Int Level[])
size_t CHOLMOD() add_size_t(size_t a, size_t b, int *ok)
#define RETURN_IF_NULL_COMMON(result)
size_t CHOLMOD() mult_size_t(size_t a, size_t k, int *ok)
int CHOLMOD() dump_work(int flag, int head, UF_long wsize, cholmod_common *Common)
#define ASSERT(expression)
static int amesos_initialize_node(Int k, Int Post[], Int Parent[], Int ColCount[], Int PrevNbr[])
int CHOLMOD() dump_perm(Int *Perm, size_t len, size_t n, char *name, cholmod_common *Common)
static void amesos_finalize_node(Int p, Int Parent[], Int SetParent[])
int CHOLMOD() allocate_work(size_t nrow, size_t iworksize, size_t xworksize, cholmod_common *Common)
#define RETURN_IF_NULL(A, result)
int CHOLMOD() dump_parent(Int *Parent, size_t n, char *name, cholmod_common *Common)
UF_long CHOLMOD() clear_flag(cholmod_common *Common)
#define ERROR(status, msg)
int CHOLMOD() rowcolcounts(cholmod_sparse *A, Int *fset, size_t fsize, Int *Parent, Int *Post, Int *RowCount, Int *ColCount, Int *First, Int *Level, cholmod_common *Common)
#define RETURN_IF_XTYPE_INVALID(A, xtype1, xtype2, result)