SuiteSparse_config.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /* ========================================================================== */
  2. /* === SuiteSparse_config =================================================== */
  3. /* ========================================================================== */
  4. /* Configuration file for SuiteSparse: a Suite of Sparse matrix packages
  5. * (AMD, COLAMD, CCOLAMD, CAMD, CHOLMOD, UMFPACK, CXSparse, and others).
  6. *
  7. * SuiteSparse_config.h provides the definition of the long integer. On most
  8. * systems, a C program can be compiled in LP64 mode, in which long's and
  9. * pointers are both 64-bits, and int's are 32-bits. Windows 64, however, uses
  10. * the LLP64 model, in which int's and long's are 32-bits, and long long's and
  11. * pointers are 64-bits.
  12. *
  13. * SuiteSparse packages that include long integer versions are
  14. * intended for the LP64 mode. However, as a workaround for Windows 64
  15. * (and perhaps other systems), the long integer can be redefined.
  16. *
  17. * If _WIN64 is defined, then the __int64 type is used instead of long.
  18. *
  19. * The long integer can also be defined at compile time. For example, this
  20. * could be added to SuiteSparse_config.mk:
  21. *
  22. * CFLAGS = -O -D'SuiteSparse_long=long long' \
  23. * -D'SuiteSparse_long_max=9223372036854775801' -D'SuiteSparse_long_idd="lld"'
  24. *
  25. * This file defines SuiteSparse_long as either long (on all but _WIN64) or
  26. * __int64 on Windows 64. The intent is that a SuiteSparse_long is always a
  27. * 64-bit integer in a 64-bit code. ptrdiff_t might be a better choice than
  28. * long; it is always the same size as a pointer.
  29. *
  30. * This file also defines the SUITESPARSE_VERSION and related definitions.
  31. *
  32. * Copyright (c) 2012, Timothy A. Davis. No licensing restrictions apply
  33. * to this file or to the SuiteSparse_config directory.
  34. * Author: Timothy A. Davis.
  35. */
  36. #ifndef _SUITESPARSECONFIG_H
  37. #define _SUITESPARSECONFIG_H
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. #include <limits.h>
  42. #include <stdlib.h>
  43. /* ========================================================================== */
  44. /* === SuiteSparse_long ===================================================== */
  45. /* ========================================================================== */
  46. #ifndef SuiteSparse_long
  47. #if _WIN64
  48. #define SuiteSparse_long __int64
  49. #define SuiteSparse_long_max _I64_MAX
  50. #define SuiteSparse_long_idd "I64d"
  51. #else
  52. #define SuiteSparse_long long
  53. #define SuiteSparse_long_max LONG_MAX
  54. #define SuiteSparse_long_idd "ld"
  55. #endif
  56. #define SuiteSparse_long_id "%" SuiteSparse_long_idd
  57. #endif
  58. /* For backward compatibility with prior versions of SuiteSparse. The UF_*
  59. * macros are deprecated and will be removed in a future version. */
  60. #ifndef UF_long
  61. #define UF_long SuiteSparse_long
  62. #define UF_long_max SuiteSparse_long_max
  63. #define UF_long_idd SuiteSparse_long_idd
  64. #define UF_long_id SuiteSparse_long_id
  65. #endif
  66. /* ========================================================================== */
  67. /* === SuiteSparse_config parameters and functions ========================== */
  68. /* ========================================================================== */
  69. /* SuiteSparse-wide parameters will be placed in this struct. */
  70. typedef struct SuiteSparse_config_struct
  71. {
  72. void *(*malloc_memory) (size_t) ; /* pointer to malloc */
  73. void *(*realloc_memory) (void *, size_t) ; /* pointer to realloc */
  74. void (*free_memory) (void *) ; /* pointer to free */
  75. void *(*calloc_memory) (size_t, size_t) ; /* pointer to calloc */
  76. } SuiteSparse_config ;
  77. void *SuiteSparse_malloc /* pointer to allocated block of memory */
  78. (
  79. size_t nitems, /* number of items to malloc (>=1 is enforced) */
  80. size_t size_of_item, /* sizeof each item */
  81. int *ok, /* TRUE if successful, FALSE otherwise */
  82. SuiteSparse_config *config /* SuiteSparse-wide configuration */
  83. ) ;
  84. void *SuiteSparse_free /* always returns NULL */
  85. (
  86. void *p, /* block to free */
  87. SuiteSparse_config *config /* SuiteSparse-wide configuration */
  88. ) ;
  89. void SuiteSparse_tic /* start the timer */
  90. (
  91. double tic [2] /* output, contents undefined on input */
  92. ) ;
  93. double SuiteSparse_toc /* return time in seconds since last tic */
  94. (
  95. double tic [2] /* input: from last call to SuiteSparse_tic */
  96. ) ;
  97. double SuiteSparse_time /* returns current wall clock time in seconds */
  98. (
  99. void
  100. ) ;
  101. /* determine which timer to use, if any */
  102. #ifndef NTIMER
  103. #ifdef _POSIX_C_SOURCE
  104. #if _POSIX_C_SOURCE >= 199309L
  105. #define SUITESPARSE_TIMER_ENABLED
  106. #endif
  107. #endif
  108. #endif
  109. /* ========================================================================== */
  110. /* === SuiteSparse version ================================================== */
  111. /* ========================================================================== */
  112. /* SuiteSparse is not a package itself, but a collection of packages, some of
  113. * which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD,
  114. * COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the
  115. * collection itself. The versions of packages within each version of
  116. * SuiteSparse are meant to work together. Combining one packge from one
  117. * version of SuiteSparse, with another package from another version of
  118. * SuiteSparse, may or may not work.
  119. *
  120. * SuiteSparse contains the following packages:
  121. *
  122. * SuiteSparse_config version 4.0.2 (version always the same as SuiteSparse)
  123. * AMD version 2.3.1
  124. * BTF version 1.2.0
  125. * CAMD version 2.3.1
  126. * CCOLAMD version 2.8.0
  127. * CHOLMOD version 2.0.1
  128. * COLAMD version 2.8.0
  129. * CSparse version 3.1.1
  130. * CXSparse version 3.1.1
  131. * KLU version 1.2.1
  132. * LDL version 2.1.0
  133. * RBio version 2.1.1
  134. * SPQR version 1.3.1 (full name is SuiteSparseQR)
  135. * UMFPACK version 5.6.1
  136. * MATLAB_Tools various packages & M-files
  137. *
  138. * Other package dependencies:
  139. * BLAS required by CHOLMOD and UMFPACK
  140. * LAPACK required by CHOLMOD
  141. * METIS 4.0.1 required by CHOLMOD (optional) and KLU (optional)
  142. */
  143. #define SUITESPARSE_DATE "July 17, 2012"
  144. #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub))
  145. #define SUITESPARSE_MAIN_VERSION 4
  146. #define SUITESPARSE_SUB_VERSION 0
  147. #define SUITESPARSE_SUBSUB_VERSION 2
  148. #define SUITESPARSE_VERSION \
  149. SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION)
  150. #ifdef __cplusplus
  151. }
  152. #endif
  153. #endif