qpSWIFT
A Sparse Quadratic Programming Solver
SuiteSparse_config.h
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 _SUITESPARSECONFIG_H
39 #define _SUITESPARSECONFIG_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 /*#if _WIN64 && !(defined PYTHON) && (defined _MSC_VER) */
55 
56 #ifdef _WIN64
57 #define SuiteSparse_long __int64
58 #define SuiteSparse_long_max _I64_MAX
59 #define SuiteSparse_long_idd "I64d"
60 
61 #else
62 
63 #define SuiteSparse_long long
64 #define SuiteSparse_long_max LONG_MAX
65 #define SuiteSparse_long_idd "ld"
66 
67 #endif
68 #define SuiteSparse_long_id "%" SuiteSparse_long_idd
69 #endif
70 
71 /* For backward compatibility with prior versions of SuiteSparse. The UF_*
72  * macros are deprecated and will be removed in a future version. */
73 #ifndef UF_long
74 #define UF_long SuiteSparse_long
75 #define UF_long_max SuiteSparse_long_max
76 #define UF_long_idd SuiteSparse_long_idd
77 #define UF_long_id SuiteSparse_long_id
78 #endif
79 
80 /* ========================================================================== */
81 /* === SuiteSparse_config parameters and functions ========================== */
82 /* ========================================================================== */
83 
84 /* SuiteSparse-wide parameters will be placed in this struct. */
85 
87 {
88  void *(*malloc_memory) (size_t) ; /* pointer to malloc */
89  void *(*realloc_memory) (void *, size_t) ; /* pointer to realloc */
90  void (*free_memory) (void *) ; /* pointer to free */
91  void *(*calloc_memory) (size_t, size_t) ; /* pointer to calloc */
92 
94 
95 void *SuiteSparse_malloc /* pointer to allocated block of memory */
96 (
97  size_t nitems, /* number of items to malloc (>=1 is enforced) */
98  size_t size_of_item, /* sizeof each item */
99  int *ok, /* TRUE if successful, FALSE otherwise */
100  SuiteSparse_config *config /* SuiteSparse-wide configuration */
101 ) ;
102 
103 void *SuiteSparse_free /* always returns NULL */
104 (
105  void *p, /* block to free */
106  SuiteSparse_config *config /* SuiteSparse-wide configuration */
107 ) ;
108 
109 void SuiteSparse_tic /* start the timer */
110 (
111  double tic [2] /* output, contents undefined on input */
112 ) ;
113 
114 double SuiteSparse_toc /* return time in seconds since last tic */
115 (
116  double tic [2] /* input: from last call to SuiteSparse_tic */
117 ) ;
118 
119 double SuiteSparse_time /* returns current wall clock time in seconds */
120 (
121  void
122 ) ;
123 
124 /* determine which timer to use, if any */
125 #ifndef NTIMER
126 #ifdef _POSIX_C_SOURCE
127 #if _POSIX_C_SOURCE >= 199309L
128 #define SUITESPARSE_TIMER_ENABLED
129 #endif
130 #endif
131 #endif
132 
133 /* ========================================================================== */
134 /* === SuiteSparse version ================================================== */
135 /* ========================================================================== */
136 
137 /* SuiteSparse is not a package itself, but a collection of packages, some of
138  * which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD,
139  * COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the
140  * collection itself. The versions of packages within each version of
141  * SuiteSparse are meant to work together. Combining one packge from one
142  * version of SuiteSparse, with another package from another version of
143  * SuiteSparse, may or may not work.
144  *
145  * SuiteSparse contains the following packages:
146  *
147  * SuiteSparse_config version 4.0.2 (version always the same as SuiteSparse)
148  * AMD version 2.3.1
149  * BTF version 1.2.0
150  * CAMD version 2.3.1
151  * CCOLAMD version 2.8.0
152  * CHOLMOD version 2.0.1
153  * COLAMD version 2.8.0
154  * CSparse version 3.1.1
155  * CXSparse version 3.1.1
156  * KLU version 1.2.1
157  * LDL version 2.1.0
158  * RBio version 2.1.1
159  * SPQR version 1.3.1 (full name is SuiteSparseQR)
160  * UMFPACK version 5.6.1
161  * MATLAB_Tools various packages & M-files
162  *
163  * Other package dependencies:
164  * BLAS required by CHOLMOD and UMFPACK
165  * LAPACK required by CHOLMOD
166  * METIS 4.0.1 required by CHOLMOD (optional) and KLU (optional)
167  */
168 
169 #define SUITESPARSE_DATE "July 17, 2012"
170 #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub))
171 #define SUITESPARSE_MAIN_VERSION 4
172 #define SUITESPARSE_SUB_VERSION 0
173 #define SUITESPARSE_SUBSUB_VERSION 2
174 #define SUITESPARSE_VERSION \
175  SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION)
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 #endif
SuiteSparse_config_struct
Definition: SuiteSparse_config.h:86
tic
void tic(qp_timer *t)
timer tic functions, similar to matlab tic, starts recording time from the instant the function is in...
Definition: timer.c:46