120 Int prevleaf, q, s, sparent ;
121 if (First [p] > PrevNbr [u])
125 prevleaf = PrevLeaf [u] ;
126 if (prevleaf ==
EMPTY)
136 for (q = prevleaf ; q != SetParent [q] ; q = SetParent [q])
143 for (s = prevleaf ; s != q ; s = sparent)
145 sparent = SetParent [s] ;
153 if (RowCount !=
NULL)
157 RowCount [u] += (Level [p] - Level [q]) ;
180 if (Parent [p] !=
EMPTY)
182 SetParent [p] = Parent [p] ;
214 Int *Ap, *Ai, *Anz, *PrevNbr, *SetParent, *Head, *PrevLeaf, *Anext, *Ipost,
216 Int i, j, r, k, len, s, p, pend, inew, stype, nf, anz, inode, parent,
217 nrow, ncol, packed, use_fset, jj ;
281 Iwork = Common->Iwork ;
283 PrevNbr = Iwork + nrow ;
284 Anext = Iwork + 2*((size_t) nrow) ;
285 PrevLeaf = Common->Flag ;
286 Head = Common->Head ;
295 for (i = 0 ; i < nrow ; i++)
301 for (k = 0 ; k < nrow ; k++)
308 ColCount [i] = (First [i] ==
EMPTY) ? 1 : 0 ;
313 for (r = i ; (r !=
EMPTY) && (First [r] ==
EMPTY) ; r = Parent [r])
329 for (s = i ; s != r ; s = Parent [s])
345 for (k = 0 ; k < nrow ; k++)
347 Ipost [Post [k]] = k ;
349 use_fset = (fset !=
NULL) ;
354 for (j = 0 ; j < ncol ; j++)
360 for (jj = 0 ; jj < nf ; jj++)
363 if (j < 0 || j > ncol || Anext [j] != -2)
379 for (jj = 0 ; jj < nf ; jj++)
381 j = (use_fset) ? (fset [jj]) : jj ;
384 pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
385 ff = (double)
MAX (0, pend - p) ;
390 for ( ; p < pend ; p++)
392 inew = Ipost [Ai [p]] ;
396 ASSERT (k >= 0 && k < nrow) ;
397 Anext [j] = Head [k] ;
410 if (RowCount !=
NULL)
412 for (i = 0 ; i < nrow ; i++)
417 for (i = 0 ; i < nrow ; i++)
419 PrevLeaf [i] =
EMPTY ;
420 PrevNbr [i] =
EMPTY ;
433 for (k = 0 ; k < nrow ; k++)
440 pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
441 for ( ; p < pend ; p++)
449 PrevLeaf, RowCount, SetParent, Level) ;
464 for (k = 0 ; k < nrow ; k++)
470 for (j = Head [k] ; j !=
EMPTY ; j = Anext [j])
475 pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
476 for ( ; p < pend ; p++)
485 PrevLeaf, RowCount, SetParent, Level) ;
500 for (j = 0 ; j < nrow ; j++)
502 parent = Parent [j] ;
506 ColCount [parent] += ColCount [j] ;
514 Common->mark =
EMPTY ;
526 for (j = 0 ; j < nrow ; j++)
528 ff = (double) (ColCount [j]) ;
534 PRINT1 ((
"rowcol fl %g lnz %g\n", Common->fl, Common->lnz)) ;
#define CHOLMOD_TOO_LARGE
size_t CHOLMOD() add_size_t(size_t a, size_t b, int *ok)
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_NULL_COMMON(result)
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() 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)
static void amesos_finalize_node(Int p, Int Parent[], Int SetParent[])
#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)
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)
#define RETURN_IF_XTYPE_INVALID(A, xtype1, xtype2, result)