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