Amesos Package Browser (Single Doxygen Collection) Development
amesos_cholmod_common.c
Go to the documentation of this file.
00001 /* ========================================================================== */
00002 /* === Core/cholmod_common ================================================== */
00003 /* ========================================================================== */
00004 
00005 /* -----------------------------------------------------------------------------
00006  * CHOLMOD/Core Module.  Copyright (C) 2005-2006,
00007  * Univ. of Florida.  Author: Timothy A. Davis
00008  * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU
00009  * Lesser General Public License.  See lesser.txt for a text of the license.
00010  * CHOLMOD is also available under other licenses; contact authors for details.
00011  * http://www.cise.ufl.edu/research/sparse
00012  * -------------------------------------------------------------------------- */
00013 
00014 /* Core utility routines for the cholmod_common object:
00015  *
00016  * Primary routines:
00017  * -----------------
00018  * cholmod_start    the first call to CHOLMOD
00019  * cholmod_finish   the last call to CHOLMOD
00020  *
00021  * Secondary routines:
00022  * -------------------
00023  * cholmod_defaults   restore (most) default control parameters
00024  * cholmod_allocate_work  allocate (or reallocate) workspace in Common
00025  * cholmod_free_work    free workspace in Common
00026  * cholmod_clear_flag   clear Common->Flag in workspace
00027  * cholmod_maxrank    column dimension of Common->Xwork workspace
00028  *
00029  * The Common object is unique.  It cannot be allocated or deallocated by
00030  * CHOLMOD, since it contains the definition of the memory management routines
00031  * used (pointers to malloc, free, realloc, and calloc, or their equivalent).
00032  * The Common object contains workspace that is used between calls to
00033  * CHOLMOD routines.  This workspace allocated by CHOLMOD as needed, by
00034  * cholmod_allocate_work and cholmod_free_work.
00035  */
00036 
00037 #include "amesos_cholmod_internal.h"
00038 #include "amesos_cholmod_core.h"
00039 
00040 /* ========================================================================== */
00041 /* === cholmod_start ======================================================== */
00042 /* ========================================================================== */
00043 
00044 /* Initialize Common default parameters and statistics.  Sets workspace
00045  * pointers to NULL.
00046  *
00047  * This routine must be called just once, prior to calling any other CHOLMOD
00048  * routine.  Do not call this routine after any other CHOLMOD routine (except
00049  * cholmod_finish, to start a new CHOLMOD session), or a memory leak will
00050  * occur.
00051  *
00052  * workspace: none
00053  */
00054 
00055 int CHOLMOD(start)
00056 (
00057     cholmod_common *Common
00058 )
00059 {
00060     if (Common == NULL)
00061     {
00062   return (FALSE) ;
00063     }
00064 
00065     /* ---------------------------------------------------------------------- */
00066     /* user error handling routine */
00067     /* ---------------------------------------------------------------------- */
00068 
00069     Common->error_handler = NULL ;
00070 
00071     /* ---------------------------------------------------------------------- */
00072     /* integer and numerical types */
00073     /* ---------------------------------------------------------------------- */
00074 
00075     Common->itype = ITYPE ;
00076     Common->dtype = DTYPE ;
00077 
00078     /* ---------------------------------------------------------------------- */
00079     /* default control parameters */
00080     /* ---------------------------------------------------------------------- */
00081 
00082     CHOLMOD(defaults) (Common) ;
00083     Common->try_catch = FALSE ;
00084 
00085     /* ---------------------------------------------------------------------- */
00086     /* memory management routines */
00087     /* ---------------------------------------------------------------------- */
00088 
00089     /* The user can replace cholmod's memory management routines by redefining
00090      * these function pointers. */
00091 
00092 #ifndef NMALLOC
00093     /* stand-alone ANSI C program */
00094     Common->malloc_memory  = malloc ;
00095     Common->free_memory    = free ;
00096     Common->realloc_memory = realloc ;
00097     Common->calloc_memory  = calloc ;
00098 #else
00099     /* no memory manager defined at compile-time; MUST define one at run-time */
00100     Common->malloc_memory  = NULL ;
00101     Common->free_memory    = NULL ;
00102     Common->realloc_memory = NULL ;
00103     Common->calloc_memory  = NULL ;
00104 #endif
00105 
00106     /* ---------------------------------------------------------------------- */
00107     /* complex arithmetic routines */
00108     /* ---------------------------------------------------------------------- */
00109 
00110     Common->complex_divide = CHOLMOD(divcomplex) ;
00111     Common->hypotenuse = CHOLMOD(hypot) ;
00112 
00113     /* ---------------------------------------------------------------------- */
00114     /* print routine */
00115     /* ---------------------------------------------------------------------- */
00116 
00117 #ifndef NPRINT
00118     /* stand-alone ANSI C program */
00119     Common->print_function = printf ;
00120 #else
00121     /* printing disabled */
00122     Common->print_function = NULL ;
00123 #endif
00124 
00125     /* ---------------------------------------------------------------------- */
00126     /* workspace */
00127     /* ---------------------------------------------------------------------- */
00128 
00129     /* This code assumes the workspace held in Common is not initialized.  If
00130      * it is, then a memory leak will occur because the pointers are
00131      * overwritten with NULL. */
00132 
00133     Common->nrow = 0 ;
00134     Common->mark = EMPTY ;
00135     Common->xworksize = 0 ;
00136     Common->iworksize = 0 ;
00137     Common->Flag = NULL ;
00138     Common->Head = NULL ;
00139     Common->Iwork = NULL ;
00140     Common->Xwork = NULL ;
00141     Common->no_workspace_reallocate = FALSE ;
00142 
00143     /* ---------------------------------------------------------------------- */
00144     /* statistics */
00145     /* ---------------------------------------------------------------------- */
00146 
00147     /* fl and lnz are computed in cholmod_analyze and cholmod_rowcolcounts */
00148     Common->fl = EMPTY ;
00149     Common->lnz = EMPTY ;
00150 
00151     /* modfl is computed in cholmod_updown, cholmod_rowadd, and cholmod_rowdel*/
00152     Common->modfl = EMPTY ;
00153 
00154     /* all routines use status as their error-report code */
00155     Common->status = CHOLMOD_OK ;
00156 
00157     Common->malloc_count = 0 ;  /* # calls to malloc minus # calls to free */
00158     Common->memory_usage = 0 ;  /* peak memory usage (in bytes) */
00159     Common->memory_inuse = 0 ;  /* current memory in use (in bytes) */
00160 
00161     Common->nrealloc_col = 0 ;
00162     Common->nrealloc_factor = 0 ;
00163     Common->ndbounds_hit = 0 ;
00164     Common->rowfacfl = 0 ;
00165     Common->aatfl = EMPTY ;
00166 
00167     /* Common->called_nd is TRUE if cholmod_analyze called or NESDIS */
00168     Common->called_nd = FALSE ;
00169 
00170     DEBUG_INIT ("cholmod start") ;
00171     return (TRUE) ;
00172 }
00173 
00174 
00175 /* ========================================================================== */
00176 /* === cholmod_defaults ===================================================== */
00177 /* ========================================================================== */
00178 
00179 /* Set Common default parameters, except for the function pointers.
00180  *
00181  * workspace: none
00182  */
00183 
00184 int CHOLMOD(defaults)
00185 (
00186     cholmod_common *Common
00187 )
00188 {
00189     Int i ;
00190 
00191     RETURN_IF_NULL_COMMON (FALSE) ;
00192 
00193     /* ---------------------------------------------------------------------- */
00194     /* default control parameters */
00195     /* ---------------------------------------------------------------------- */
00196 
00197     Common->dbound = 0.0 ;
00198     Common->grow0 = 1.2 ;
00199     Common->grow1 = 1.2 ;
00200     Common->grow2 = 5 ;
00201     Common->maxrank = 8 ;
00202 
00203     Common->final_asis = TRUE ;
00204     Common->final_super = TRUE ;
00205     Common->final_ll = FALSE ;
00206     Common->final_pack = TRUE ;
00207     Common->final_monotonic = TRUE ;
00208     Common->final_resymbol = FALSE ;
00209 
00210     /* use simplicial factorization if flop/nnz(L) < 40, supernodal otherwise */
00211     Common->supernodal = CHOLMOD_AUTO ;
00212     Common->supernodal_switch = 40 ;
00213 
00214     Common->nrelax [0] = 4 ;
00215     Common->nrelax [1] = 16 ;
00216     Common->nrelax [2] = 48 ;
00217     Common->zrelax [0] = 0.8 ;
00218     Common->zrelax [1] = 0.1 ;
00219     Common->zrelax [2] = 0.05 ;
00220 
00221     Common->prefer_zomplex = FALSE ;
00222     Common->prefer_upper = TRUE ;
00223     Common->prefer_binary = FALSE ;
00224     Common->quick_return_if_not_posdef = FALSE ;
00225 
00226     /* METIS workarounds */
00227     Common->metis_memory = 0.0 ;    /* > 0 for memory guard (2 is reasonable) */
00228     Common->metis_nswitch = 3000 ;
00229     Common->metis_dswitch = 0.66 ;
00230 
00231     Common->print = 3 ;
00232     Common->precise = FALSE ;
00233 
00234     /* ---------------------------------------------------------------------- */
00235     /* default ordering methods */
00236     /* ---------------------------------------------------------------------- */
00237 
00238     /* Note that if the Partition module is not installed, the CHOLMOD_METIS
00239      * and CHOLMOD_NESDIS methods will not be available.  cholmod_analyze will
00240      * report the CHOLMOD_NOT_INSTALLED error, and safely skip over them.
00241      */
00242 
00243 #if (CHOLMOD_MAXMETHODS < 9)
00244 #error "CHOLMOD_MAXMETHODS must be 9 or more (defined in cholmod_core.h)."
00245 #endif
00246 
00247     /* default strategy: try given, AMD, and then METIS if AMD reports high
00248      * fill-in.  NESDIS can be used instead, if Common->default_nesdis is TRUE.
00249      */
00250     Common->nmethods = 0 ;    /* use default strategy */
00251     Common->default_nesdis = FALSE ;  /* use METIS in default strategy */
00252 
00253     Common->current = 0 ; /* current method being tried */
00254     Common->selected = 0 ;  /* the best method selected */
00255 
00256     /* first, fill each method with default parameters */
00257     for (i = 0 ; i <= CHOLMOD_MAXMETHODS ; i++)
00258     {
00259   /* CHOLMOD's default method is AMD for A or AA' */
00260   Common->method [i].ordering = CHOLMOD_AMD ;
00261 
00262   /* CHOLMOD nested dissection and minimum degree parameter */
00263   Common->method [i].prune_dense = 10.0 ; /* dense row/col control */
00264 
00265   /* min degree parameters (AMD, COLAMD, SYMAMD, CAMD, CCOLAMD, CSYMAMD)*/
00266   Common->method [i].prune_dense2 = -1 ;  /* COLAMD dense row control */
00267   Common->method [i].aggressive = TRUE ;  /* aggressive absorption */
00268   Common->method [i].order_for_lu = FALSE ;/* order for Cholesky not LU */
00269 
00270   /* CHOLMOD's nested dissection (METIS + constrained AMD) */
00271   Common->method [i].nd_small = 200 ; /* small graphs aren't cut */
00272   Common->method [i].nd_compress = TRUE ; /* compress graph & subgraphs */
00273   Common->method [i].nd_camd = 1 ;  /* use CAMD */
00274   Common->method [i].nd_components = FALSE ;  /* lump connected comp. */
00275   Common->method [i].nd_oksep = 1.0 ; /* sep ok if < oksep*n */
00276 
00277   /* statistics for each method are not yet computed */
00278   Common->method [i].fl = EMPTY ;
00279   Common->method [i].lnz = EMPTY ;
00280     }
00281 
00282     Common->postorder = TRUE ;  /* follow ordering with weighted postorder */
00283 
00284     /* Next, define some methods.  The first five use default parameters. */
00285     Common->method [0].ordering = CHOLMOD_GIVEN ;   /* skip if UserPerm NULL */
00286     Common->method [1].ordering = CHOLMOD_AMD ;
00287     Common->method [2].ordering = CHOLMOD_METIS ;
00288     Common->method [3].ordering = CHOLMOD_NESDIS ;
00289     Common->method [4].ordering = CHOLMOD_NATURAL ;
00290 
00291     /* CHOLMOD's nested dissection with large leaves of separator tree */
00292     Common->method [5].ordering = CHOLMOD_NESDIS ;
00293     Common->method [5].nd_small = 20000 ;
00294 
00295     /* CHOLMOD's nested dissection with tiny leaves, and no AMD ordering */
00296     Common->method [6].ordering = CHOLMOD_NESDIS ;
00297     Common->method [6].nd_small = 4 ;
00298     Common->method [6].nd_camd = 0 ;    /* no CSYMAMD or CAMD */
00299 
00300     /* CHOLMOD's nested dissection with no dense node removal */
00301     Common->method [7].ordering = CHOLMOD_NESDIS ;
00302     Common->method [7].prune_dense = -1. ;
00303 
00304     /* COLAMD for A*A', AMD for A */
00305     Common->method [8].ordering = CHOLMOD_COLAMD ;
00306 
00307     return (TRUE) ;
00308 }
00309 
00310 
00311 /* ========================================================================== */
00312 /* === cholmod_finish ======================================================= */
00313 /* ========================================================================== */
00314 
00315 /* The last call to CHOLMOD must be cholmod_finish.  You may call this routine
00316  * more than once, and can safely call any other CHOLMOD routine after calling
00317  * it (including cholmod_start).
00318  *
00319  * The statistics and parameter settings in Common are preserved.  The
00320  * workspace in Common is freed.  This routine is just another name for
00321  * cholmod_free_work.
00322  */
00323 
00324 int CHOLMOD(finish)
00325 (
00326     cholmod_common *Common
00327 )
00328 {
00329     return (CHOLMOD(free_work) (Common)) ;
00330 }
00331 
00332 
00333 /* ========================================================================== */
00334 /* === cholmod_allocate_work ================================================ */
00335 /* ========================================================================== */
00336 
00337 /* Allocate and initialize workspace for CHOLMOD routines, or increase the size
00338  * of already-allocated workspace.  If enough workspace is already allocated,
00339  * then nothing happens.
00340  *
00341  * workspace: Flag (nrow), Head (nrow+1), Iwork (iworksize), Xwork (xworksize)
00342  */
00343 
00344 int CHOLMOD(allocate_work)
00345 (
00346     /* ---- input ---- */
00347     size_t nrow,  /* # of rows in the matrix A */
00348     size_t iworksize, /* size of Iwork */
00349     size_t xworksize, /* size of Xwork */
00350     /* --------------- */
00351     cholmod_common *Common
00352 )
00353 {
00354     double *W ;
00355     Int *Head ;
00356     Int i ;
00357     size_t nrow1 ;
00358     int ok = TRUE ;
00359 
00360     /* ---------------------------------------------------------------------- */
00361     /* get inputs */
00362     /* ---------------------------------------------------------------------- */
00363 
00364     RETURN_IF_NULL_COMMON (FALSE) ;
00365     Common->status = CHOLMOD_OK ;
00366 
00367     /* ---------------------------------------------------------------------- */
00368     /* Allocate Flag (nrow) and Head (nrow+1) */
00369     /* ---------------------------------------------------------------------- */
00370 
00371     nrow = MAX (1, nrow) ;
00372 
00373     /* nrow1 = nrow + 1 */
00374     nrow1 = CHOLMOD(add_size_t) (nrow, 1, &ok) ;
00375     if (!ok)
00376     {
00377   /* nrow+1 causes size_t overflow ; problem is too large */
00378   Common->status = CHOLMOD_TOO_LARGE ;
00379   CHOLMOD(free_work) (Common) ;
00380   return (FALSE) ;
00381     }
00382 
00383     if (nrow > Common->nrow)
00384     {
00385 
00386   if (Common->no_workspace_reallocate)
00387   {
00388       /* CHOLMOD is not allowed to change the workspace here */
00389       Common->status = CHOLMOD_INVALID ;
00390       return (FALSE) ;
00391   }
00392 
00393   /* free the old workspace (if any) and allocate new space */
00394   Common->Flag = CHOLMOD(free) (Common->nrow,  sizeof (Int), Common->Flag,
00395     Common) ;
00396   Common->Head = CHOLMOD(free) (Common->nrow+1,sizeof (Int), Common->Head,
00397     Common) ;
00398   Common->Flag = CHOLMOD(malloc) (nrow,   sizeof (Int), Common) ;
00399   Common->Head = CHOLMOD(malloc) (nrow1, sizeof (Int), Common) ;
00400 
00401   /* record the new size of Flag and Head */
00402   Common->nrow = nrow ;
00403 
00404   if (Common->status < CHOLMOD_OK)
00405   {
00406       CHOLMOD(free_work) (Common) ;
00407       return (FALSE) ;
00408   }
00409 
00410   /* initialize Flag and Head */
00411   Common->mark = EMPTY ;
00412   CHOLMOD(clear_flag) (Common) ;
00413   Head = Common->Head ;
00414   for (i = 0 ; i <= (Int) (nrow) ; i++)
00415   {
00416       Head [i] = EMPTY ;
00417   }
00418     }
00419 
00420     /* ---------------------------------------------------------------------- */
00421     /* Allocate Iwork (iworksize) */
00422     /* ---------------------------------------------------------------------- */
00423 
00424     iworksize = MAX (1, iworksize) ;
00425     if (iworksize > Common->iworksize)
00426     {
00427 
00428   if (Common->no_workspace_reallocate)
00429   {
00430       /* CHOLMOD is not allowed to change the workspace here */
00431       Common->status = CHOLMOD_INVALID ;
00432       return (FALSE) ;
00433   }
00434 
00435   /* free the old workspace (if any) and allocate new space.
00436    * integer overflow safely detected in cholmod_malloc */
00437   CHOLMOD(free) (Common->iworksize, sizeof (Int), Common->Iwork, Common) ;
00438   Common->Iwork = CHOLMOD(malloc) (iworksize, sizeof (Int), Common) ;
00439 
00440   /* record the new size of Iwork */
00441   Common->iworksize = iworksize ;
00442 
00443   if (Common->status < CHOLMOD_OK)
00444   {
00445       CHOLMOD(free_work) (Common) ;
00446       return (FALSE) ;
00447   }
00448 
00449   /* note that Iwork does not need to be initialized */
00450     }
00451 
00452     /* ---------------------------------------------------------------------- */
00453     /* Allocate Xwork (xworksize) and set it to ((double) 0.) */
00454     /* ---------------------------------------------------------------------- */
00455 
00456     /* make sure xworksize is >= 1 */
00457     xworksize = MAX (1, xworksize) ;
00458     if (xworksize > Common->xworksize)
00459     {
00460 
00461   if (Common->no_workspace_reallocate)
00462   {
00463       /* CHOLMOD is not allowed to change the workspace here */
00464       Common->status = CHOLMOD_INVALID ;
00465       return (FALSE) ;
00466   }
00467 
00468   /* free the old workspace (if any) and allocate new space */
00469   CHOLMOD(free) (Common->xworksize, sizeof (double), Common->Xwork,
00470     Common) ;
00471   Common->Xwork = CHOLMOD(malloc) (xworksize, sizeof (double), Common) ;
00472 
00473   /* record the new size of Xwork */
00474   Common->xworksize = xworksize ;
00475 
00476   if (Common->status < CHOLMOD_OK)
00477   {
00478       CHOLMOD(free_work) (Common) ;
00479       return (FALSE) ;
00480   }
00481 
00482   /* initialize Xwork */
00483   W = Common->Xwork ;
00484   for (i = 0 ; i < (Int) xworksize ; i++)
00485   {
00486       W [i] = 0. ;
00487   }
00488     }
00489 
00490     return (TRUE) ;
00491 }
00492 
00493 
00494 /* ========================================================================== */
00495 /* === cholmod_free_work ==================================================== */
00496 /* ========================================================================== */
00497 
00498 /* Deallocate the CHOLMOD workspace.
00499  *
00500  * workspace: deallocates all workspace in Common
00501  */
00502 
00503 int CHOLMOD(free_work)
00504 (
00505     cholmod_common *Common
00506 )
00507 {
00508     RETURN_IF_NULL_COMMON (FALSE) ;
00509     Common->Flag  = CHOLMOD(free) (Common->nrow, sizeof (Int),
00510       Common->Flag, Common) ;
00511     Common->Head  = CHOLMOD(free) (Common->nrow+1, sizeof (Int),
00512       Common->Head, Common) ;
00513     Common->Iwork = CHOLMOD(free) (Common->iworksize, sizeof (Int),
00514       Common->Iwork, Common) ;
00515     Common->Xwork = CHOLMOD(free) (Common->xworksize, sizeof (double),
00516       Common->Xwork, Common) ;
00517     Common->nrow = 0 ;
00518     Common->iworksize = 0 ;
00519     Common->xworksize = 0 ;
00520     return (TRUE) ;
00521 }
00522 
00523 
00524 /* ========================================================================== */
00525 /* === cholmod_clear_flag =================================================== */
00526 /* ========================================================================== */
00527 
00528 /* Increment mark to ensure Flag [0..nrow-1] < mark.  If integer overflow
00529  * occurs, or mark was initially negative, reset the entire array.  This is
00530  * not an error condition, but an intended function of the Flag workspace.
00531  *
00532  * workspace: Flag (nrow).  Does not modify Flag if nrow is zero.
00533  */
00534 
00535 UF_long CHOLMOD(clear_flag)
00536 (
00537     cholmod_common *Common
00538 )
00539 {
00540     Int i, nrow, *Flag ;
00541 
00542     RETURN_IF_NULL_COMMON (-1) ;
00543 
00544     Common->mark++ ;
00545     if (Common->mark <= 0)
00546     {
00547   nrow = Common->nrow ;
00548   Flag = Common->Flag ;
00549   PRINT2 (("reset Flag: nrow "ID"\n", nrow)) ;
00550   PRINT2 (("reset Flag: mark %ld\n", Common->mark)) ;
00551   for (i = 0 ; i < nrow ; i++)
00552   {
00553       Flag [i] = EMPTY ;
00554   }
00555   Common->mark = 0 ;
00556     }
00557     return (Common->mark) ;
00558 }
00559 
00560 
00561 /* ========================================================================== */
00562 /* ==== cholmod_maxrank ===================================================== */
00563 /* ========================================================================== */
00564 
00565 /* Find a valid value of Common->maxrank.  Returns 0 if error, or 2, 4, or 8
00566  * if successful. */
00567 
00568 size_t CHOLMOD(maxrank) /* returns validated value of Common->maxrank */
00569 (
00570     /* ---- input ---- */
00571     size_t n,   /* A and L will have n rows */
00572     /* --------------- */
00573     cholmod_common *Common
00574 )
00575 {
00576     size_t maxrank ;
00577     RETURN_IF_NULL_COMMON (0) ;
00578     maxrank = Common->maxrank ;
00579     if (n > 0)
00580     {
00581   /* Ensure maxrank*n*sizeof(double) does not result in integer overflow.
00582    * If n is so large that 2*n*sizeof(double) results in integer overflow
00583    * (n = 268,435,455 if an Int is 32 bits), then maxrank will be 0 or 1,
00584    * but maxrank will be set to 2 below.  2*n will not result in integer
00585    * overflow, and CHOLMOD will run out of memory or safely detect integer
00586    * overflow elsewhere.
00587    */
00588   maxrank = MIN (maxrank, Size_max / (n * sizeof (double))) ;
00589     }
00590     if (maxrank <= 2)
00591     {
00592   maxrank = 2 ;
00593     }
00594     else if (maxrank <= 4)
00595     {
00596   maxrank = 4 ;
00597     }
00598     else
00599     {
00600   maxrank = 8 ;
00601     }
00602     return (maxrank) ;
00603 }
00604 
00605 
00606 /* ========================================================================== */
00607 /* === cholmod_dbound ======================================================= */
00608 /* ========================================================================== */
00609 
00610 /* Ensure the absolute value of a diagonal entry, D (j,j), is greater than
00611  * Common->dbound.  This routine is not meant for the user to call.  It is used
00612  * by the various LDL' factorization and update/downdate routines.  The
00613  * default value of Common->dbound is zero, and in that case this routine is not
00614  * called at all.  No change is made if D (j,j) is NaN.  CHOLMOD does not call
00615  * this routine if Common->dbound is NaN.
00616  */
00617 
00618 double CHOLMOD(dbound)  /* returns modified diagonal entry of D */
00619 (
00620     /* ---- input ---- */
00621     double dj,    /* diagonal entry of D, for LDL' factorization */
00622     /* --------------- */
00623     cholmod_common *Common
00624 )
00625 {
00626     double dbound ;
00627     RETURN_IF_NULL_COMMON (0) ;
00628     if (!IS_NAN (dj))
00629     {
00630   dbound = Common->dbound ;
00631   if (dj < 0)
00632   {
00633       if (dj > -dbound)
00634       {
00635     dj = -dbound ;
00636     Common->ndbounds_hit++ ;
00637     if (Common->status == CHOLMOD_OK)
00638     {
00639         ERROR (CHOLMOD_DSMALL, "diagonal below threshold") ;
00640     }
00641       }
00642   }
00643   else
00644   {
00645       if (dj < dbound)
00646       {
00647     dj = dbound ;
00648     Common->ndbounds_hit++ ;
00649     if (Common->status == CHOLMOD_OK)
00650     {
00651         ERROR (CHOLMOD_DSMALL, "diagonal below threshold") ;
00652     }
00653       }
00654   }
00655     }
00656     return (dj) ;
00657 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines