Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
amesos_cholmod_l_common.c
Go to the documentation of this file.
1 /* ========================================================================== */
2 /* === Core/cholmod_common ================================================== */
3 /* ========================================================================== */
4 
5 /* -----------------------------------------------------------------------------
6  * CHOLMOD/Core Module. Copyright (C) 2005-2006,
7  * Univ. of Florida. Author: Timothy A. Davis
8  * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU
9  * Lesser General Public License. See lesser.txt for a text of the license.
10  * CHOLMOD is also available under other licenses; contact authors for details.
11  * http://www.cise.ufl.edu/research/sparse
12  * -------------------------------------------------------------------------- */
13 
14 /* Core utility routines for the cholmod_common object:
15  *
16  * Primary routines:
17  * -----------------
18  * cholmod_start the first call to CHOLMOD
19  * cholmod_finish the last call to CHOLMOD
20  *
21  * Secondary routines:
22  * -------------------
23  * cholmod_defaults restore (most) default control parameters
24  * cholmod_allocate_work allocate (or reallocate) workspace in Common
25  * cholmod_free_work free workspace in Common
26  * cholmod_clear_flag clear Common->Flag in workspace
27  * cholmod_maxrank column dimension of Common->Xwork workspace
28  *
29  * The Common object is unique. It cannot be allocated or deallocated by
30  * CHOLMOD, since it contains the definition of the memory management routines
31  * used (pointers to malloc, free, realloc, and calloc, or their equivalent).
32  * The Common object contains workspace that is used between calls to
33  * CHOLMOD routines. This workspace allocated by CHOLMOD as needed, by
34  * cholmod_allocate_work and cholmod_free_work.
35  */
36 
37 /* This file should make the long int version of CHOLMOD */
38 #define DLONG 1
39 
41 #include "amesos_cholmod_core.h"
42 
43 /* ========================================================================== */
44 /* === cholmod_start ======================================================== */
45 /* ========================================================================== */
46 
47 /* Initialize Common default parameters and statistics. Sets workspace
48  * pointers to NULL.
49  *
50  * This routine must be called just once, prior to calling any other CHOLMOD
51  * routine. Do not call this routine after any other CHOLMOD routine (except
52  * cholmod_finish, to start a new CHOLMOD session), or a memory leak will
53  * occur.
54  *
55  * workspace: none
56  */
57 
58 int CHOLMOD(start)
59 (
60  cholmod_common *Common
61 )
62 {
63  if (Common == NULL)
64  {
65  return (FALSE) ;
66  }
67 
68  /* ---------------------------------------------------------------------- */
69  /* user error handling routine */
70  /* ---------------------------------------------------------------------- */
71 
72  Common->error_handler = NULL ;
73 
74  /* ---------------------------------------------------------------------- */
75  /* integer and numerical types */
76  /* ---------------------------------------------------------------------- */
77 
78  Common->itype = ITYPE ;
79  Common->dtype = DTYPE ;
80 
81  /* ---------------------------------------------------------------------- */
82  /* default control parameters */
83  /* ---------------------------------------------------------------------- */
84 
85  CHOLMOD(defaults) (Common) ;
86  Common->try_catch = FALSE ;
87 
88  /* ---------------------------------------------------------------------- */
89  /* memory management routines */
90  /* ---------------------------------------------------------------------- */
91 
92  /* The user can replace cholmod's memory management routines by redefining
93  * these function pointers. */
94 
95 #ifndef NMALLOC
96  /* stand-alone ANSI C program */
97  Common->malloc_memory = malloc ;
98  Common->free_memory = free ;
99  Common->realloc_memory = realloc ;
100  Common->calloc_memory = calloc ;
101 #else
102  /* no memory manager defined at compile-time; MUST define one at run-time */
103  Common->malloc_memory = NULL ;
104  Common->free_memory = NULL ;
105  Common->realloc_memory = NULL ;
106  Common->calloc_memory = NULL ;
107 #endif
108 
109  /* ---------------------------------------------------------------------- */
110  /* complex arithmetic routines */
111  /* ---------------------------------------------------------------------- */
112 
113  Common->complex_divide = CHOLMOD(divcomplex) ;
114  Common->hypotenuse = CHOLMOD(hypot) ;
115 
116  /* ---------------------------------------------------------------------- */
117  /* print routine */
118  /* ---------------------------------------------------------------------- */
119 
120 #ifndef NPRINT
121  /* stand-alone ANSI C program */
122  Common->print_function = printf ;
123 #else
124  /* printing disabled */
125  Common->print_function = NULL ;
126 #endif
127 
128  /* ---------------------------------------------------------------------- */
129  /* workspace */
130  /* ---------------------------------------------------------------------- */
131 
132  /* This code assumes the workspace held in Common is not initialized. If
133  * it is, then a memory leak will occur because the pointers are
134  * overwritten with NULL. */
135 
136  Common->nrow = 0 ;
137  Common->mark = EMPTY ;
138  Common->xworksize = 0 ;
139  Common->iworksize = 0 ;
140  Common->Flag = NULL ;
141  Common->Head = NULL ;
142  Common->Iwork = NULL ;
143  Common->Xwork = NULL ;
144  Common->no_workspace_reallocate = FALSE ;
145 
146  /* ---------------------------------------------------------------------- */
147  /* statistics */
148  /* ---------------------------------------------------------------------- */
149 
150  /* fl and lnz are computed in cholmod_analyze and cholmod_rowcolcounts */
151  Common->fl = EMPTY ;
152  Common->lnz = EMPTY ;
153 
154  /* modfl is computed in cholmod_updown, cholmod_rowadd, and cholmod_rowdel*/
155  Common->modfl = EMPTY ;
156 
157  /* all routines use status as their error-report code */
158  Common->status = CHOLMOD_OK ;
159 
160  Common->malloc_count = 0 ; /* # calls to malloc minus # calls to free */
161  Common->memory_usage = 0 ; /* peak memory usage (in bytes) */
162  Common->memory_inuse = 0 ; /* current memory in use (in bytes) */
163 
164  Common->nrealloc_col = 0 ;
165  Common->nrealloc_factor = 0 ;
166  Common->ndbounds_hit = 0 ;
167  Common->rowfacfl = 0 ;
168  Common->aatfl = EMPTY ;
169 
170  /* Common->called_nd is TRUE if cholmod_analyze called or NESDIS */
171  Common->called_nd = FALSE ;
172 
173  DEBUG_INIT ("cholmod start") ;
174  return (TRUE) ;
175 }
176 
177 
178 /* ========================================================================== */
179 /* === cholmod_defaults ===================================================== */
180 /* ========================================================================== */
181 
182 /* Set Common default parameters, except for the function pointers.
183  *
184  * workspace: none
185  */
186 
187 int CHOLMOD(defaults)
188 (
189  cholmod_common *Common
190 )
191 {
192  Int i ;
193 
195 
196  /* ---------------------------------------------------------------------- */
197  /* default control parameters */
198  /* ---------------------------------------------------------------------- */
199 
200  Common->dbound = 0.0 ;
201  Common->grow0 = 1.2 ;
202  Common->grow1 = 1.2 ;
203  Common->grow2 = 5 ;
204  Common->maxrank = 8 ;
205 
206  Common->final_asis = TRUE ;
207  Common->final_super = TRUE ;
208  Common->final_ll = FALSE ;
209  Common->final_pack = TRUE ;
210  Common->final_monotonic = TRUE ;
211  Common->final_resymbol = FALSE ;
212 
213  /* use simplicial factorization if flop/nnz(L) < 40, supernodal otherwise */
214  Common->supernodal = CHOLMOD_AUTO ;
215  Common->supernodal_switch = 40 ;
216 
217  Common->nrelax [0] = 4 ;
218  Common->nrelax [1] = 16 ;
219  Common->nrelax [2] = 48 ;
220  Common->zrelax [0] = 0.8 ;
221  Common->zrelax [1] = 0.1 ;
222  Common->zrelax [2] = 0.05 ;
223 
224  Common->prefer_zomplex = FALSE ;
225  Common->prefer_upper = TRUE ;
226  Common->prefer_binary = FALSE ;
227  Common->quick_return_if_not_posdef = FALSE ;
228 
229  /* METIS workarounds */
230  Common->metis_memory = 0.0 ; /* > 0 for memory guard (2 is reasonable) */
231  Common->metis_nswitch = 3000 ;
232  Common->metis_dswitch = 0.66 ;
233 
234  Common->print = 3 ;
235  Common->precise = FALSE ;
236 
237  /* ---------------------------------------------------------------------- */
238  /* default ordering methods */
239  /* ---------------------------------------------------------------------- */
240 
241  /* Note that if the Partition module is not installed, the CHOLMOD_METIS
242  * and CHOLMOD_NESDIS methods will not be available. cholmod_analyze will
243  * report the CHOLMOD_NOT_INSTALLED error, and safely skip over them.
244  */
245 
246 #if (CHOLMOD_MAXMETHODS < 9)
247 #error "CHOLMOD_MAXMETHODS must be 9 or more (defined in cholmod_core.h)."
248 #endif
249 
250  /* default strategy: try given, AMD, and then METIS if AMD reports high
251  * fill-in. NESDIS can be used instead, if Common->default_nesdis is TRUE.
252  */
253  Common->nmethods = 0 ; /* use default strategy */
254  Common->default_nesdis = FALSE ; /* use METIS in default strategy */
255 
256  Common->current = 0 ; /* current method being tried */
257  Common->selected = 0 ; /* the best method selected */
258 
259  /* first, fill each method with default parameters */
260  for (i = 0 ; i <= CHOLMOD_MAXMETHODS ; i++)
261  {
262  /* CHOLMOD's default method is AMD for A or AA' */
263  Common->method [i].ordering = CHOLMOD_AMD ;
264 
265  /* CHOLMOD nested dissection and minimum degree parameter */
266  Common->method [i].prune_dense = 10.0 ; /* dense row/col control */
267 
268  /* min degree parameters (AMD, COLAMD, SYMAMD, CAMD, CCOLAMD, CSYMAMD)*/
269  Common->method [i].prune_dense2 = -1 ; /* COLAMD dense row control */
270  Common->method [i].aggressive = TRUE ; /* aggressive absorption */
271  Common->method [i].order_for_lu = FALSE ;/* order for Cholesky not LU */
272 
273  /* CHOLMOD's nested dissection (METIS + constrained AMD) */
274  Common->method [i].nd_small = 200 ; /* small graphs aren't cut */
275  Common->method [i].nd_compress = TRUE ; /* compress graph & subgraphs */
276  Common->method [i].nd_camd = 1 ; /* use CAMD */
277  Common->method [i].nd_components = FALSE ; /* lump connected comp. */
278  Common->method [i].nd_oksep = 1.0 ; /* sep ok if < oksep*n */
279 
280  /* statistics for each method are not yet computed */
281  Common->method [i].fl = EMPTY ;
282  Common->method [i].lnz = EMPTY ;
283  }
284 
285  Common->postorder = TRUE ; /* follow ordering with weighted postorder */
286 
287  /* Next, define some methods. The first five use default parameters. */
288  Common->method [0].ordering = CHOLMOD_GIVEN ; /* skip if UserPerm NULL */
289  Common->method [1].ordering = CHOLMOD_AMD ;
290  Common->method [2].ordering = CHOLMOD_METIS ;
291  Common->method [3].ordering = CHOLMOD_NESDIS ;
292  Common->method [4].ordering = CHOLMOD_NATURAL ;
293 
294  /* CHOLMOD's nested dissection with large leaves of separator tree */
295  Common->method [5].ordering = CHOLMOD_NESDIS ;
296  Common->method [5].nd_small = 20000 ;
297 
298  /* CHOLMOD's nested dissection with tiny leaves, and no AMD ordering */
299  Common->method [6].ordering = CHOLMOD_NESDIS ;
300  Common->method [6].nd_small = 4 ;
301  Common->method [6].nd_camd = 0 ; /* no CSYMAMD or CAMD */
302 
303  /* CHOLMOD's nested dissection with no dense node removal */
304  Common->method [7].ordering = CHOLMOD_NESDIS ;
305  Common->method [7].prune_dense = -1. ;
306 
307  /* COLAMD for A*A', AMD for A */
308  Common->method [8].ordering = CHOLMOD_COLAMD ;
309 
310  return (TRUE) ;
311 }
312 
313 
314 /* ========================================================================== */
315 /* === cholmod_finish ======================================================= */
316 /* ========================================================================== */
317 
318 /* The last call to CHOLMOD must be cholmod_finish. You may call this routine
319  * more than once, and can safely call any other CHOLMOD routine after calling
320  * it (including cholmod_start).
321  *
322  * The statistics and parameter settings in Common are preserved. The
323  * workspace in Common is freed. This routine is just another name for
324  * cholmod_free_work.
325  */
326 
327 int CHOLMOD(finish)
328 (
329  cholmod_common *Common
330 )
331 {
332  return (CHOLMOD(free_work) (Common)) ;
333 }
334 
335 
336 /* ========================================================================== */
337 /* === cholmod_allocate_work ================================================ */
338 /* ========================================================================== */
339 
340 /* Allocate and initialize workspace for CHOLMOD routines, or increase the size
341  * of already-allocated workspace. If enough workspace is already allocated,
342  * then nothing happens.
343  *
344  * workspace: Flag (nrow), Head (nrow+1), Iwork (iworksize), Xwork (xworksize)
345  */
346 
348 (
349  /* ---- input ---- */
350  size_t nrow, /* # of rows in the matrix A */
351  size_t iworksize, /* size of Iwork */
352  size_t xworksize, /* size of Xwork */
353  /* --------------- */
354  cholmod_common *Common
355 )
356 {
357  double *W ;
358  Int *Head ;
359  Int i ;
360  size_t nrow1 ;
361  int ok = TRUE ;
362 
363  /* ---------------------------------------------------------------------- */
364  /* get inputs */
365  /* ---------------------------------------------------------------------- */
366 
368  Common->status = CHOLMOD_OK ;
369 
370  /* ---------------------------------------------------------------------- */
371  /* Allocate Flag (nrow) and Head (nrow+1) */
372  /* ---------------------------------------------------------------------- */
373 
374  nrow = MAX (1, nrow) ;
375 
376  /* nrow1 = nrow + 1 */
377  nrow1 = CHOLMOD(add_size_t) (nrow, 1, &ok) ;
378  if (!ok)
379  {
380  /* nrow+1 causes size_t overflow ; problem is too large */
381  Common->status = CHOLMOD_TOO_LARGE ;
382  CHOLMOD(free_work) (Common) ;
383  return (FALSE) ;
384  }
385 
386  if (nrow > Common->nrow)
387  {
388 
389  if (Common->no_workspace_reallocate)
390  {
391  /* CHOLMOD is not allowed to change the workspace here */
392  Common->status = CHOLMOD_INVALID ;
393  return (FALSE) ;
394  }
395 
396  /* free the old workspace (if any) and allocate new space */
397  Common->Flag = CHOLMOD(free) (Common->nrow, sizeof (Int), Common->Flag,
398  Common) ;
399  Common->Head = CHOLMOD(free) (Common->nrow+1,sizeof (Int), Common->Head,
400  Common) ;
401  Common->Flag = CHOLMOD(malloc) (nrow, sizeof (Int), Common) ;
402  Common->Head = CHOLMOD(malloc) (nrow1, sizeof (Int), Common) ;
403 
404  /* record the new size of Flag and Head */
405  Common->nrow = nrow ;
406 
407  if (Common->status < CHOLMOD_OK)
408  {
409  CHOLMOD(free_work) (Common) ;
410  return (FALSE) ;
411  }
412 
413  /* initialize Flag and Head */
414  Common->mark = EMPTY ;
415  CHOLMOD(clear_flag) (Common) ;
416  Head = Common->Head ;
417  for (i = 0 ; i <= (Int) (nrow) ; i++)
418  {
419  Head [i] = EMPTY ;
420  }
421  }
422 
423  /* ---------------------------------------------------------------------- */
424  /* Allocate Iwork (iworksize) */
425  /* ---------------------------------------------------------------------- */
426 
427  iworksize = MAX (1, iworksize) ;
428  if (iworksize > Common->iworksize)
429  {
430 
431  if (Common->no_workspace_reallocate)
432  {
433  /* CHOLMOD is not allowed to change the workspace here */
434  Common->status = CHOLMOD_INVALID ;
435  return (FALSE) ;
436  }
437 
438  /* free the old workspace (if any) and allocate new space.
439  * integer overflow safely detected in cholmod_malloc */
440  CHOLMOD(free) (Common->iworksize, sizeof (Int), Common->Iwork, Common) ;
441  Common->Iwork = CHOLMOD(malloc) (iworksize, sizeof (Int), Common) ;
442 
443  /* record the new size of Iwork */
444  Common->iworksize = iworksize ;
445 
446  if (Common->status < CHOLMOD_OK)
447  {
448  CHOLMOD(free_work) (Common) ;
449  return (FALSE) ;
450  }
451 
452  /* note that Iwork does not need to be initialized */
453  }
454 
455  /* ---------------------------------------------------------------------- */
456  /* Allocate Xwork (xworksize) and set it to ((double) 0.) */
457  /* ---------------------------------------------------------------------- */
458 
459  /* make sure xworksize is >= 1 */
460  xworksize = MAX (1, xworksize) ;
461  if (xworksize > Common->xworksize)
462  {
463 
464  if (Common->no_workspace_reallocate)
465  {
466  /* CHOLMOD is not allowed to change the workspace here */
467  Common->status = CHOLMOD_INVALID ;
468  return (FALSE) ;
469  }
470 
471  /* free the old workspace (if any) and allocate new space */
472  CHOLMOD(free) (Common->xworksize, sizeof (double), Common->Xwork,
473  Common) ;
474  Common->Xwork = CHOLMOD(malloc) (xworksize, sizeof (double), Common) ;
475 
476  /* record the new size of Xwork */
477  Common->xworksize = xworksize ;
478 
479  if (Common->status < CHOLMOD_OK)
480  {
481  CHOLMOD(free_work) (Common) ;
482  return (FALSE) ;
483  }
484 
485  /* initialize Xwork */
486  W = Common->Xwork ;
487  for (i = 0 ; i < (Int) xworksize ; i++)
488  {
489  W [i] = 0. ;
490  }
491  }
492 
493  return (TRUE) ;
494 }
495 
496 
497 /* ========================================================================== */
498 /* === cholmod_free_work ==================================================== */
499 /* ========================================================================== */
500 
501 /* Deallocate the CHOLMOD workspace.
502  *
503  * workspace: deallocates all workspace in Common
504  */
505 
506 int CHOLMOD(free_work)
507 (
508  cholmod_common *Common
509 )
510 {
512  Common->Flag = CHOLMOD(free) (Common->nrow, sizeof (Int),
513  Common->Flag, Common) ;
514  Common->Head = CHOLMOD(free) (Common->nrow+1, sizeof (Int),
515  Common->Head, Common) ;
516  Common->Iwork = CHOLMOD(free) (Common->iworksize, sizeof (Int),
517  Common->Iwork, Common) ;
518  Common->Xwork = CHOLMOD(free) (Common->xworksize, sizeof (double),
519  Common->Xwork, Common) ;
520  Common->nrow = 0 ;
521  Common->iworksize = 0 ;
522  Common->xworksize = 0 ;
523  return (TRUE) ;
524 }
525 
526 
527 /* ========================================================================== */
528 /* === cholmod_clear_flag =================================================== */
529 /* ========================================================================== */
530 
531 /* Increment mark to ensure Flag [0..nrow-1] < mark. If integer overflow
532  * occurs, or mark was initially negative, reset the entire array. This is
533  * not an error condition, but an intended function of the Flag workspace.
534  *
535  * workspace: Flag (nrow). Does not modify Flag if nrow is zero.
536  */
537 
539 (
540  cholmod_common *Common
541 )
542 {
543  Int i, nrow, *Flag ;
544 
545  RETURN_IF_NULL_COMMON (-1) ;
546 
547  Common->mark++ ;
548  if (Common->mark <= 0)
549  {
550  nrow = Common->nrow ;
551  Flag = Common->Flag ;
552  PRINT2 (("reset Flag: nrow "ID"\n", nrow)) ;
553  PRINT2 (("reset Flag: mark %ld\n", Common->mark)) ;
554  for (i = 0 ; i < nrow ; i++)
555  {
556  Flag [i] = EMPTY ;
557  }
558  Common->mark = 0 ;
559  }
560  return (Common->mark) ;
561 }
562 
563 
564 /* ========================================================================== */
565 /* ==== cholmod_maxrank ===================================================== */
566 /* ========================================================================== */
567 
568 /* Find a valid value of Common->maxrank. Returns 0 if error, or 2, 4, or 8
569  * if successful. */
570 
571 size_t CHOLMOD(maxrank) /* returns validated value of Common->maxrank */
572 (
573  /* ---- input ---- */
574  size_t n, /* A and L will have n rows */
575  /* --------------- */
576  cholmod_common *Common
577 )
578 {
579  size_t maxrank ;
581  maxrank = Common->maxrank ;
582  if (n > 0)
583  {
584  /* Ensure maxrank*n*sizeof(double) does not result in integer overflow.
585  * If n is so large that 2*n*sizeof(double) results in integer overflow
586  * (n = 268,435,455 if an Int is 32 bits), then maxrank will be 0 or 1,
587  * but maxrank will be set to 2 below. 2*n will not result in integer
588  * overflow, and CHOLMOD will run out of memory or safely detect integer
589  * overflow elsewhere.
590  */
591  maxrank = MIN (maxrank, Size_max / (n * sizeof (double))) ;
592  }
593  if (maxrank <= 2)
594  {
595  maxrank = 2 ;
596  }
597  else if (maxrank <= 4)
598  {
599  maxrank = 4 ;
600  }
601  else
602  {
603  maxrank = 8 ;
604  }
605  return (maxrank) ;
606 }
607 
608 
609 /* ========================================================================== */
610 /* === cholmod_dbound ======================================================= */
611 /* ========================================================================== */
612 
613 /* Ensure the absolute value of a diagonal entry, D (j,j), is greater than
614  * Common->dbound. This routine is not meant for the user to call. It is used
615  * by the various LDL' factorization and update/downdate routines. The
616  * default value of Common->dbound is zero, and in that case this routine is not
617  * called at all. No change is made if D (j,j) is NaN. CHOLMOD does not call
618  * this routine if Common->dbound is NaN.
619  */
620 
621 double CHOLMOD(dbound) /* returns modified diagonal entry of D */
622 (
623  /* ---- input ---- */
624  double dj, /* diagonal entry of D, for LDL' factorization */
625  /* --------------- */
626  cholmod_common *Common
627 )
628 {
629  double dbound ;
631  if (!IS_NAN (dj))
632  {
633  dbound = Common->dbound ;
634  if (dj < 0)
635  {
636  if (dj > -dbound)
637  {
638  dj = -dbound ;
639  Common->ndbounds_hit++ ;
640  if (Common->status == CHOLMOD_OK)
641  {
642  ERROR (CHOLMOD_DSMALL, "diagonal below threshold") ;
643  }
644  }
645  }
646  else
647  {
648  if (dj < dbound)
649  {
650  dj = dbound ;
651  Common->ndbounds_hit++ ;
652  if (Common->status == CHOLMOD_OK)
653  {
654  ERROR (CHOLMOD_DSMALL, "diagonal below threshold") ;
655  }
656  }
657  }
658  }
659  return (dj) ;
660 }
UF_long CHOLMOD() clear_flag(cholmod_common *Common)
#define CHOLMOD_TOO_LARGE
int CHOLMOD() allocate_work(size_t nrow, size_t iworksize, size_t xworksize, cholmod_common *Common)
size_t CHOLMOD(maxrank)
#define EMPTY
#define CHOLMOD_AUTO
#define Int
size_t CHOLMOD() add_size_t(size_t a, size_t b, int *ok)
#define FALSE
int CHOLMOD() divcomplex(double ar, double ai, double br, double bi, double *cr, double *ci)
int CHOLMOD() start(cholmod_common *Common)
#define RETURN_IF_NULL_COMMON(result)
#define MAX(a, b)
#define CHOLMOD_GIVEN
#define CHOLMOD_AMD
#define NULL
#define PRINT2(params)
#define ID
#define CHOLMOD_METIS
int CHOLMOD() finish(cholmod_common *Common)
#define DTYPE
#define CHOLMOD_INVALID
int CHOLMOD() free_work(cholmod_common *Common)
#define CHOLMOD_OK
int CHOLMOD() defaults(cholmod_common *Common)
#define CHOLMOD_MAXMETHODS
#define Size_max
#define IS_NAN(x)
#define CHOLMOD_DSMALL
double CHOLMOD() hypot(double x, double y)
#define DEBUG_INIT(s)
#define CHOLMOD_COLAMD
#define MIN(a, b)
#define CHOLMOD_NESDIS
#define UF_long
int n
#define ERROR(status, msg)
#define TRUE
#define CHOLMOD_NATURAL
#define ITYPE