Amesos Package Browser (Single Doxygen Collection) Development
amesos_klu_defaults.c
Go to the documentation of this file.
00001 /* ========================================================================== */
00002 /* === KLU_defaults ========================================================= */
00003 /* ========================================================================== */
00004 
00005 /* Sets default parameters for KLU */
00006 
00007 #include "amesos_klu_internal.h"
00008 
00009 Int KLU_defaults
00010 (
00011     KLU_common *Common
00012 )
00013 {
00014     if (Common == NULL)
00015     {
00016   return (FALSE) ;
00017     }
00018 
00019     /* parameters */
00020     Common->tol = 0.001 ; /* pivot tolerance for diagonal */
00021     Common->memgrow = 1.2;  /* realloc size ratio increase for LU factors */
00022     Common->initmem_amd = 1.2 ; /* init. mem with AMD:  c*nnz(L) + n */
00023     Common->initmem = 10 ;  /* init. mem otherwise: c*nnz(A) + n */
00024     Common->btf = TRUE ;  /* use BTF pre-ordering, or not */
00025     Common->maxwork = 0 ; /* no limit to work done by btf_order */
00026     Common->ordering = 0 ;  /* 0: AMD, 1: COLAMD, 2: user-provided P and Q,
00027          * 3: user-provided function */
00028     Common->scale = 2 ;   /* scale: -1: none, and do not check for errors
00029          * in the input matrix in KLU_refactor.
00030          * 0: none, but check for errors,
00031          * 1: sum, 2: max */
00032     Common->halt_if_singular = TRUE ; /* quick halt if matrix is singular */
00033 
00034     /* memory management routines */
00035     Common->malloc_memory  = malloc ;
00036     Common->calloc_memory  = calloc ;
00037     Common->free_memory    = free ;
00038     Common->realloc_memory = realloc ;
00039 
00040     /* user ordering function and optional argument */
00041     Common->user_order = NULL ;
00042     Common->user_data = NULL ;
00043 
00044     /* statistics */
00045     Common->status = KLU_OK ;
00046     Common->nrealloc = 0 ;
00047     Common->structural_rank = EMPTY ;
00048     Common->numerical_rank = EMPTY ;
00049     Common->noffdiag = EMPTY ;
00050     Common->flops = EMPTY ;
00051     Common->rcond = EMPTY ;
00052     Common->condest = EMPTY ;
00053     Common->rgrowth = EMPTY ;
00054     Common->work = 0 ;    /* work done by btf_order */
00055 
00056     Common->memusage = 0 ;
00057     Common->mempeak = 0 ;
00058 
00059     return (TRUE) ;
00060 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines