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