SuiteSparse_config.h 6.4 KB

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