Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
amesos_klu_l_defaults.c
Go to the documentation of this file.
1 /* ========================================================================== */
2 /* === KLU_defaults ========================================================= */
3 /* ========================================================================== */
4 
5 /* Sets default parameters for KLU */
6 
7 /* This file should make the long int version of KLU */
8 #define DLONG 1
9 
10 #include "amesos_klu_internal.h"
11 
13 (
14  KLU_common *Common
15 )
16 {
17  if (Common == NULL)
18  {
19  return (FALSE) ;
20  }
21 
22  /* parameters */
23  Common->tol = 0.001 ; /* pivot tolerance for diagonal */
24  Common->memgrow = 1.2; /* realloc size ratio increase for LU factors */
25  Common->initmem_amd = 1.2 ; /* init. mem with AMD: c*nnz(L) + n */
26  Common->initmem = 10 ; /* init. mem otherwise: c*nnz(A) + n */
27  Common->btf = TRUE ; /* use BTF pre-ordering, or not */
28  Common->maxwork = 0 ; /* no limit to work done by btf_order */
29  Common->ordering = 0 ; /* 0: AMD, 1: COLAMD, 2: user-provided P and Q,
30  * 3: user-provided function */
31  Common->scale = 2 ; /* scale: -1: none, and do not check for errors
32  * in the input matrix in KLU_refactor.
33  * 0: none, but check for errors,
34  * 1: sum, 2: max */
35  Common->halt_if_singular = TRUE ; /* quick halt if matrix is singular */
36 
37  /* memory management routines */
38  Common->malloc_memory = malloc ;
39  Common->calloc_memory = calloc ;
40  Common->free_memory = free ;
41  Common->realloc_memory = realloc ;
42 
43  /* user ordering function and optional argument */
44  Common->user_order = NULL ;
45  Common->user_data = NULL ;
46 
47  /* statistics */
48  Common->status = KLU_OK ;
49  Common->nrealloc = 0 ;
50  Common->structural_rank = EMPTY ;
51  Common->numerical_rank = EMPTY ;
52  Common->noffdiag = EMPTY ;
53  Common->flops = EMPTY ;
54  Common->rcond = EMPTY ;
55  Common->condest = EMPTY ;
56  Common->rgrowth = EMPTY ;
57  Common->work = 0 ; /* work done by btf_order */
58 
59  Common->memusage = 0 ;
60  Common->mempeak = 0 ;
61 
62  return (TRUE) ;
63 }
#define EMPTY
#define Int
#define FALSE
Int KLU_defaults(KLU_common *Common)
#define NULL
#define KLU_common
#define TRUE
#define KLU_OK