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