umfpack_defaults.c
3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* ========================================================================== */
/* === UMFPACK_defaults ===================================================== */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
/* -------------------------------------------------------------------------- */
/*
User-callable. Sets default control parameters. See umfpack_defaults.h
for details.
*/
#include "umf_internal.h"
GLOBAL void UMFPACK_defaults
(
double Control [UMFPACK_CONTROL]
)
{
Int i ;
if (!Control)
{
/* silently return if no Control array */
return ;
}
for (i = 0 ; i < UMFPACK_CONTROL ; i++)
{
Control [i] = 0 ;
}
/* ---------------------------------------------------------------------- */
/* default control settings: can be modified at run-time */
/* ---------------------------------------------------------------------- */
/* used in UMFPACK_report_* routines: */
Control [UMFPACK_PRL] = UMFPACK_DEFAULT_PRL ;
/* used in UMFPACK_*symbolic: */
Control [UMFPACK_DENSE_ROW] = UMFPACK_DEFAULT_DENSE_ROW ;
Control [UMFPACK_DENSE_COL] = UMFPACK_DEFAULT_DENSE_COL ;
Control [UMFPACK_AMD_DENSE] = UMFPACK_DEFAULT_AMD_DENSE ;
Control [UMFPACK_STRATEGY] = UMFPACK_DEFAULT_STRATEGY ;
Control [UMFPACK_2BY2_TOLERANCE] = UMFPACK_DEFAULT_2BY2_TOLERANCE ;
Control [UMFPACK_AGGRESSIVE] = UMFPACK_DEFAULT_AGGRESSIVE ;
/* used in UMFPACK_numeric: */
Control [UMFPACK_PIVOT_TOLERANCE] = UMFPACK_DEFAULT_PIVOT_TOLERANCE ;
Control [UMFPACK_SYM_PIVOT_TOLERANCE] = UMFPACK_DEFAULT_SYM_PIVOT_TOLERANCE;
Control [UMFPACK_BLOCK_SIZE] = UMFPACK_DEFAULT_BLOCK_SIZE ;
Control [UMFPACK_ALLOC_INIT] = UMFPACK_DEFAULT_ALLOC_INIT ;
Control [UMFPACK_FRONT_ALLOC_INIT] = UMFPACK_DEFAULT_FRONT_ALLOC_INIT ;
Control [UMFPACK_SCALE] = UMFPACK_DEFAULT_SCALE ;
/* used in UMFPACK_*solve: */
Control [UMFPACK_IRSTEP] = UMFPACK_DEFAULT_IRSTEP ;
/* ---------------------------------------------------------------------- */
/* compile-time settings: cannot be modified at run-time */
/* ---------------------------------------------------------------------- */
#ifdef NBLAS
/* do not use the BLAS - use in-line C code instead */
Control [UMFPACK_COMPILED_WITH_BLAS] = 0 ;
#else
/* use externally-provided BLAS (dgemm, dger, dgemv, zgemm, zgeru, zgemv) */
Control [UMFPACK_COMPILED_WITH_BLAS] = 1 ;
#endif
#ifdef MATLAB_MEX_FILE
/* compiled as a MATLAB mexFunction */
Control [UMFPACK_COMPILED_FOR_MATLAB] = 1 ;
#else
#ifdef MATHWORKS
/* compiled for internal use in MATLAB */
Control [UMFPACK_COMPILED_FOR_MATLAB] = 2 ;
#else
/* use ANSI C malloc, free, realloc, and printf */
Control [UMFPACK_COMPILED_FOR_MATLAB] = 0 ;
#endif
#endif
#ifdef NO_TIMER
/* no timer used */
Control [UMFPACK_COMPILED_WITH_GETRUSAGE] = 3 ;
#ifndef NPOSIX
/* uses the POSIX sysconf ( ) and times ( ) routines in UMFPACK_tic, toc */
Control [UMFPACK_COMPILED_WITH_GETRUSAGE] = 2 ;
#else
#ifdef GETRUSAGE
/* uses the non-standard getrusage to get CPU time (Solaris) */
Control [UMFPACK_COMPILED_WITH_GETRUSAGE] = 1 ;
#else
/* uses the ANSI standard clock routine to get CPU time */
/* this may wrap around */
Control [UMFPACK_COMPILED_WITH_GETRUSAGE] = 0 ;
#endif
#endif
#endif
#ifndef NDEBUG
/* UMFPACK is compiled in debug mode. */
/* This is exceedingly slow. */
DEBUG0 (("UMFPACK is running in debug mode. This is very slow!\n")) ;
Control [UMFPACK_COMPILED_IN_DEBUG_MODE] = 1 ;
#else
/* UMFPACK is compiled in normal (non-debug) mode */
Control [UMFPACK_COMPILED_IN_DEBUG_MODE] = 0 ;
#endif
}