EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
SuiteSparse_config.h
Go to the documentation of this file.
1 /* ========================================================================== */
2 /* === SuiteSparse_config =================================================== */
3 /* ========================================================================== */
4 
5 /* Configuration file for SuiteSparse: a Suite of Sparse matrix packages
6  * (AMD, COLAMD, CCOLAMD, CAMD, CHOLMOD, UMFPACK, CXSparse, and others).
7  *
8  * SuiteSparse_config.h provides the definition of the long integer. On most
9  * systems, a C program can be compiled in LP64 mode, in which long's and
10  * pointers are both 64-bits, and int's are 32-bits. Windows 64, however, uses
11  * the LLP64 model, in which int's and long's are 32-bits, and long long's and
12  * pointers are 64-bits.
13  *
14  * SuiteSparse packages that include long integer versions are
15  * intended for the LP64 mode. However, as a workaround for Windows 64
16  * (and perhaps other systems), the long integer can be redefined.
17  *
18  * If _WIN64 is defined, then the __int64 type is used instead of long.
19  *
20  * The long integer can also be defined at compile time. For example, this
21  * could be added to SuiteSparse_config.mk:
22  *
23  * CFLAGS = -O -D'SuiteSparse_long=long long' \
24  * -D'SuiteSparse_long_max=9223372036854775801' -D'SuiteSparse_long_idd="lld"'
25  *
26  * This file defines SuiteSparse_long as either long (on all but _WIN64) or
27  * __int64 on Windows 64. The intent is that a SuiteSparse_long is always a
28  * 64-bit integer in a 64-bit code. ptrdiff_t might be a better choice than
29  * long; it is always the same size as a pointer.
30  *
31  * This file also defines the SUITESPARSE_VERSION and related definitions.
32  *
33  * Copyright (c) 2012, Timothy A. Davis. No licensing restrictions apply
34  * to this file or to the SuiteSparse_config directory.
35  * Author: Timothy A. Davis.
36  */
37 
38 #ifndef SUITESPARSE_CONFIG_H
39 #define SUITESPARSE_CONFIG_H
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #include <limits.h>
46 #include <stdlib.h>
47 
48 /* ========================================================================== */
49 /* === SuiteSparse_long ===================================================== */
50 /* ========================================================================== */
51 
52 #ifndef SuiteSparse_long
53 
54 #ifdef _WIN64
55 
56 #define SuiteSparse_long __int64
57 #define SuiteSparse_long_max _I64_MAX
58 #define SuiteSparse_long_idd "I64d"
59 
60 #else
61 
62 #define SuiteSparse_long long
63 #define SuiteSparse_long_max LONG_MAX
64 #define SuiteSparse_long_idd "ld"
65 
66 #endif
67 #define SuiteSparse_long_id "%" SuiteSparse_long_idd
68 #endif
69 
70 /* ========================================================================== */
71 /* === SuiteSparse_config parameters and functions ========================== */
72 /* ========================================================================== */
73 
74 /* SuiteSparse-wide parameters are placed in this struct. It is meant to be
75  an extern, globally-accessible struct. It is not meant to be updated
76  frequently by multiple threads. Rather, if an application needs to modify
77  SuiteSparse_config, it should do it once at the beginning of the application,
78  before multiple threads are launched.
79 
80  The intent of these function pointers is that they not be used in your
81  application directly, except to assign them to the desired user-provided
82  functions. Rather, you should use the
83  */
84 
86 {
87  void *(*malloc_func) (size_t) ; /* pointer to malloc */
88  void *(*calloc_func) (size_t, size_t) ; /* pointer to calloc */
89  void *(*realloc_func) (void *, size_t) ; /* pointer to realloc */
90  void (*free_func) (void *) ; /* pointer to free */
91  int (*printf_func) (const char *, ...) ; /* pointer to printf */
92  double (*hypot_func) (double, double) ; /* pointer to hypot */
93  int (*divcomplex_func) (double, double, double, double, double *, double *);
94 } ;
95 
97 
98 void SuiteSparse_start ( void ) ; /* called to start SuiteSparse */
99 
100 void SuiteSparse_finish ( void ) ; /* called to finish SuiteSparse */
101 
102 void *SuiteSparse_malloc /* pointer to allocated block of memory */
103 (
104  size_t nitems, /* number of items to malloc (>=1 is enforced) */
105  size_t size_of_item /* sizeof each item */
106 ) ;
107 
108 void *SuiteSparse_calloc /* pointer to allocated block of memory */
109 (
110  size_t nitems, /* number of items to calloc (>=1 is enforced) */
111  size_t size_of_item /* sizeof each item */
112 ) ;
113 
114 void *SuiteSparse_realloc /* pointer to reallocated block of memory, or
115  to original block if the realloc failed. */
116 (
117  size_t nitems_new, /* new number of items in the object */
118  size_t nitems_old, /* old number of items in the object */
119  size_t size_of_item, /* sizeof each item */
120  void *p, /* old object to reallocate */
121  int *ok /* 1 if successful, 0 otherwise */
122 ) ;
123 
124 void *SuiteSparse_free /* always returns NULL */
125 (
126  void *p /* block to free */
127 ) ;
128 
129 void SuiteSparse_tic /* start the timer */
130 (
131  double tic [2] /* output, contents undefined on input */
132 ) ;
133 
134 double SuiteSparse_toc /* return time in seconds since last tic */
135 (
136  double tic [2] /* input: from last call to SuiteSparse_tic */
137 ) ;
138 
139 double SuiteSparse_time /* returns current wall clock time in seconds */
140 (
141  void
142 ) ;
143 
144 /* returns sqrt (x^2 + y^2), computed reliably */
145 double SuiteSparse_hypot (double x, double y) ;
146 
147 /* complex division of c = a/b */
149 (
150  double ar, double ai, /* real and imaginary parts of a */
151  double br, double bi, /* real and imaginary parts of b */
152  double *cr, double *ci /* real and imaginary parts of c */
153 ) ;
154 
155 /* determine which timer to use, if any */
156 #ifndef NTIMER
157 #ifdef _POSIX_C_SOURCE
158 #if _POSIX_C_SOURCE >= 199309L
159 #define SUITESPARSE_TIMER_ENABLED
160 #endif
161 #endif
162 #endif
163 
164 /* SuiteSparse printf macro */
165 #define SUITESPARSE_PRINTF(params) \
166 { \
167  if (SuiteSparse_config.printf_func != NULL) \
168  { \
169  (void) (SuiteSparse_config.printf_func) params ; \
170  } \
171 }
172 
173 /* ========================================================================== */
174 /* === SuiteSparse version ================================================== */
175 /* ========================================================================== */
176 
177 /* SuiteSparse is not a package itself, but a collection of packages, some of
178  * which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD,
179  * COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the
180  * collection itself. The versions of packages within each version of
181  * SuiteSparse are meant to work together. Combining one package from one
182  * version of SuiteSparse, with another package from another version of
183  * SuiteSparse, may or may not work.
184  *
185  * SuiteSparse contains the following packages:
186  *
187  * SuiteSparse_config version 4.5.4 (version always the same as SuiteSparse)
188  * AMD version 2.4.6
189  * BTF version 1.2.6
190  * CAMD version 2.4.6
191  * CCOLAMD version 2.9.6
192  * CHOLMOD version 3.0.11
193  * COLAMD version 2.9.6
194  * CSparse version 3.1.9
195  * CXSparse version 3.1.9
196  * GPUQREngine version 1.0.5
197  * KLU version 1.3.8
198  * LDL version 2.2.6
199  * RBio version 2.2.6
200  * SPQR version 2.0.8
201  * SuiteSparse_GPURuntime version 1.0.5
202  * UMFPACK version 5.7.6
203  * MATLAB_Tools various packages & M-files
204  * xerbla version 1.0.3
205  *
206  * Other package dependencies:
207  * BLAS required by CHOLMOD and UMFPACK
208  * LAPACK required by CHOLMOD
209  * METIS 5.1.0 required by CHOLMOD (optional) and KLU (optional)
210  * CUBLAS, CUDART NVIDIA libraries required by CHOLMOD and SPQR when
211  * they are compiled with GPU acceleration.
212  */
213 
214 int SuiteSparse_version /* returns SUITESPARSE_VERSION */
215 (
216  /* output, not defined on input. Not used if NULL. Returns
217  the three version codes in version [0..2]:
218  version [0] is SUITESPARSE_MAIN_VERSION
219  version [1] is SUITESPARSE_SUB_VERSION
220  version [2] is SUITESPARSE_SUBSUB_VERSION
221  */
222  int version [3]
223 ) ;
224 
225 /* Versions prior to 4.2.0 do not have the above function. The following
226  code fragment will work with any version of SuiteSparse:
227 
228  #ifdef SUITESPARSE_HAS_VERSION_FUNCTION
229  v = SuiteSparse_version (NULL) ;
230  #else
231  v = SUITESPARSE_VERSION ;
232  #endif
233 */
234 #define SUITESPARSE_HAS_VERSION_FUNCTION
235 
236 #define SUITESPARSE_DATE "Dec 8, 2016"
237 #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub))
238 #define SUITESPARSE_MAIN_VERSION 4
239 #define SUITESPARSE_SUB_VERSION 5
240 #define SUITESPARSE_SUBSUB_VERSION 4
241 #define SUITESPARSE_VERSION \
242  SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION)
243 
244 #ifdef __cplusplus
245 }
246 #endif
247 #endif
void SuiteSparse_finish(void)
void * SuiteSparse_calloc(size_t nitems, size_t size_of_item)
int(* divcomplex_func)(double, double, double, double, double *, double *)
double SuiteSparse_hypot(double x, double y)
void * SuiteSparse_realloc(size_t nitems_new, size_t nitems_old, size_t size_of_item, void *p, int *ok)
double(* hypot_func)(double, double)
double SuiteSparse_time(void)
void SuiteSparse_start(void)
void * SuiteSparse_malloc(size_t nitems, size_t size_of_item)
void * SuiteSparse_free(void *p)
struct SuiteSparse_config_struct SuiteSparse_config
void SuiteSparse_tic(double tic[2])
int(* printf_func)(const char *,...)
int SuiteSparse_version(int version[3])
int SuiteSparse_divcomplex(double ar, double ai, double br, double bi, double *cr, double *ci)
double SuiteSparse_toc(double tic[2])