config.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
  2. // Copyright 2008-2016 National ICT Australia (NICTA)
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // ------------------------------------------------------------------------
  15. #if !defined(ARMA_USE_LAPACK)
  16. #define ARMA_USE_LAPACK
  17. //// Comment out the above line if you don't have LAPACK or a high-speed replacement for LAPACK,
  18. //// such as Intel MKL, AMD ACML, or the Accelerate framework.
  19. //// LAPACK is required for matrix decompositions (eg. SVD) and matrix inverse.
  20. #endif
  21. #if !defined(ARMA_USE_BLAS)
  22. #define ARMA_USE_BLAS
  23. //// Comment out the above line if you don't have BLAS or a high-speed replacement for BLAS,
  24. //// such as OpenBLAS, GotoBLAS, Intel MKL, AMD ACML, or the Accelerate framework.
  25. //// BLAS is used for matrix multiplication.
  26. //// Without BLAS, matrix multiplication will still work, but might be slower.
  27. #endif
  28. #if !defined(ARMA_USE_NEWARP)
  29. #define ARMA_USE_NEWARP
  30. //// Uncomment the above line to enable the built-in partial emulation of ARPACK.
  31. //// This is used for eigen decompositions of real (non-complex) sparse matrices, eg. eigs_sym(), svds()
  32. #endif
  33. #if !defined(ARMA_USE_ARPACK)
  34. // #define ARMA_USE_ARPACK
  35. //// Uncomment the above line if you have ARPACK or a high-speed replacement for ARPACK.
  36. //// ARPACK is required for eigen decompositions of complex sparse matrices
  37. #endif
  38. #if !defined(ARMA_USE_SUPERLU)
  39. // #define ARMA_USE_SUPERLU
  40. //// Uncomment the above line if you have SuperLU.
  41. //// SuperLU is used for solving sparse linear systems via spsolve()
  42. //// Caveat: only SuperLU version 5.2 can be used!
  43. #endif
  44. #if !defined(ARMA_SUPERLU_INCLUDE_DIR)
  45. // #define ARMA_SUPERLU_INCLUDE_DIR /usr/include/
  46. //// If you're using SuperLU and want to explicitly include the SuperLU headers,
  47. //// uncomment the above define and specify the appropriate include directory.
  48. //// Make sure the directory has a trailing /
  49. #endif
  50. // #define ARMA_USE_WRAPPER
  51. //// Comment out the above line if you're getting linking errors when compiling your programs,
  52. //// or if you prefer to directly link with LAPACK, BLAS + etc instead of the Armadillo runtime library.
  53. //// You will then need to link your programs directly with -llapack -lblas instead of -larmadillo
  54. // #define ARMA_BLAS_CAPITALS
  55. //// Uncomment the above line if your BLAS and LAPACK libraries have capitalised function names (eg. ACML on 64-bit Windows)
  56. #define ARMA_BLAS_UNDERSCORE
  57. //// Uncomment the above line if your BLAS and LAPACK libraries have function names with a trailing underscore.
  58. //// Conversely, comment it out if the function names don't have a trailing underscore.
  59. // #define ARMA_BLAS_LONG
  60. //// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int"
  61. // #define ARMA_BLAS_LONG_LONG
  62. //// Uncomment the above line if your BLAS and LAPACK libraries use "long long" instead of "int"
  63. #define ARMA_USE_FORTRAN_HIDDEN_ARGS
  64. //// Comment out the above line to call BLAS and LAPACK functions without using so-called "hidden" arguments.
  65. //// Fortran functions (compiled without a BIND(C) declaration) that have char arguments
  66. //// (like many BLAS and LAPACK functions) also have associated "hidden" arguments.
  67. //// For each char argument, the corresponding "hidden" argument specifies the number of characters.
  68. //// These "hidden" arguments are typically tacked onto the end of function definitions.
  69. // #define ARMA_USE_TBB_ALLOC
  70. //// Uncomment the above line if you want to use Intel TBB scalable_malloc() and scalable_free() instead of standard malloc() and free()
  71. // #define ARMA_USE_MKL_ALLOC
  72. //// Uncomment the above line if you want to use Intel MKL mkl_malloc() and mkl_free() instead of standard malloc() and free()
  73. // #define ARMA_USE_MKL_TYPES
  74. //// Uncomment the above line if you want to use Intel MKL types for complex numbers.
  75. //// You will need to include appropriate MKL headers before the Armadillo header.
  76. //// You may also need to enable or disable the following options:
  77. //// ARMA_BLAS_LONG, ARMA_BLAS_LONG_LONG, ARMA_USE_FORTRAN_HIDDEN_ARGS
  78. // #define ARMA_USE_ATLAS
  79. // #define ARMA_ATLAS_INCLUDE_DIR /usr/include/
  80. //// If you're using ATLAS and the compiler can't find cblas.h and/or clapack.h
  81. //// uncomment the above define and specify the appropriate include directory.
  82. //// Make sure the directory has a trailing /
  83. #if !defined(ARMA_USE_CXX11)
  84. // #define ARMA_USE_CXX11
  85. //// Uncomment the above line to forcefully enable use of C++11 features.
  86. //// Note that ARMA_USE_CXX11 is automatically enabled when a C++11 compiler is detected.
  87. #endif
  88. #if !defined(ARMA_USE_OPENMP)
  89. // #define ARMA_USE_OPENMP
  90. //// Uncomment the above line to forcefully enable use of OpenMP for parallelisation.
  91. //// Note that ARMA_USE_OPENMP is automatically enabled when a compiler supporting OpenMP 3.1 is detected.
  92. #endif
  93. #if !defined(ARMA_64BIT_WORD)
  94. // LUOYC20220530
  95. // #define ARMA_64BIT_WORD
  96. //// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements.
  97. //// Your machine and compiler must have support for 64 bit integers (eg. via "long" or "long long").
  98. //// Note that ARMA_64BIT_WORD is automatically enabled when a C++11 compiler is detected and std::size_t has 64 bits.
  99. #endif
  100. #if !defined(ARMA_USE_HDF5)
  101. // #define ARMA_USE_HDF5
  102. //// Uncomment the above line to allow the ability to save and load matrices stored in HDF5 format;
  103. //// the hdf5.h header file must be available on your system,
  104. //// and you will need to link with the hdf5 library (eg. -lhdf5)
  105. #endif
  106. #if !defined(ARMA_OPTIMISE_BAND)
  107. #define ARMA_OPTIMISE_BAND
  108. //// Comment out the above line if you don't want automatically optimised handling
  109. //// of band matrices by solve() and chol()
  110. #endif
  111. #if !defined(ARMA_OPTIMISE_SYMPD)
  112. #define ARMA_OPTIMISE_SYMPD
  113. //// Comment out the above line if you don't want automatically optimised handling
  114. //// of symmetric/hermitian positive definite matrices by various functions:
  115. //// solve(), inv(), expmat(), logmat(), sqrtmat(), rcond()
  116. #endif
  117. // #define ARMA_USE_HDF5_ALT
  118. #if defined(ARMA_USE_HDF5_ALT) && defined(ARMA_USE_WRAPPER)
  119. #undef ARMA_USE_HDF5
  120. #define ARMA_USE_HDF5
  121. // #define ARMA_HDF5_INCLUDE_DIR /usr/include/
  122. #endif
  123. #if !defined(ARMA_MAT_PREALLOC)
  124. #define ARMA_MAT_PREALLOC 16
  125. #endif
  126. //// This is the number of preallocated elements used by matrices and vectors;
  127. //// it must be an integer that is at least 1.
  128. //// If you mainly use lots of very small vectors (eg. <= 4 elements),
  129. //// change the number to the size of your vectors.
  130. #if !defined(ARMA_OPENMP_THRESHOLD)
  131. #define ARMA_OPENMP_THRESHOLD 240
  132. #endif
  133. //// The minimum number of elements in a matrix to allow OpenMP based parallelisation;
  134. //// it must be an integer that is at least 1.
  135. #if !defined(ARMA_OPENMP_THREADS)
  136. #define ARMA_OPENMP_THREADS 10
  137. #endif
  138. //// The maximum number of threads to use for OpenMP based parallelisation;
  139. //// it must be an integer that is at least 1.
  140. // #define ARMA_NO_DEBUG
  141. //// Uncomment the above line if you want to disable all run-time checks.
  142. //// This will result in faster code, but you first need to make sure that your code runs correctly!
  143. //// We strongly recommend to have the run-time checks enabled during development,
  144. //// as this greatly aids in finding mistakes in your code, and hence speeds up development.
  145. //// We recommend that run-time checks be disabled _only_ for the shipped version of your program.
  146. // #define ARMA_EXTRA_DEBUG
  147. //// Uncomment the above line if you want to see the function traces of how Armadillo evaluates expressions.
  148. //// This is mainly useful for debugging of the library.
  149. #if defined(ARMA_DEFAULT_OSTREAM)
  150. #pragma message ("WARNING: support for ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
  151. #pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
  152. #endif
  153. #if !defined(ARMA_COUT_STREAM)
  154. #if defined(ARMA_DEFAULT_OSTREAM)
  155. // for compatibility with earlier versions of Armadillo
  156. #define ARMA_COUT_STREAM ARMA_DEFAULT_OSTREAM
  157. #else
  158. #define ARMA_COUT_STREAM std::cout
  159. #endif
  160. #endif
  161. #if !defined(ARMA_CERR_STREAM)
  162. #if defined(ARMA_DEFAULT_OSTREAM)
  163. // for compatibility with earlier versions of Armadillo
  164. #define ARMA_CERR_STREAM ARMA_DEFAULT_OSTREAM
  165. #else
  166. #define ARMA_CERR_STREAM std::cerr
  167. #endif
  168. #endif
  169. #if !defined(ARMA_PRINT_ERRORS)
  170. #define ARMA_PRINT_ERRORS
  171. //// Comment out the above line if you don't want errors and warnings printed (eg. failed decompositions)
  172. #endif
  173. #if !defined(ARMA_PRINT_HDF5_ERRORS)
  174. // #define ARMA_PRINT_HDF5_ERRORS
  175. #endif
  176. #if defined(ARMA_DONT_USE_LAPACK)
  177. #undef ARMA_USE_LAPACK
  178. #endif
  179. #if defined(ARMA_DONT_USE_BLAS)
  180. #undef ARMA_USE_BLAS
  181. #endif
  182. #if defined(ARMA_DONT_USE_NEWARP) || !defined(ARMA_USE_LAPACK)
  183. #undef ARMA_USE_NEWARP
  184. #endif
  185. #if defined(ARMA_DONT_USE_ARPACK)
  186. #undef ARMA_USE_ARPACK
  187. #endif
  188. #if defined(ARMA_DONT_USE_SUPERLU)
  189. #undef ARMA_USE_SUPERLU
  190. #undef ARMA_SUPERLU_INCLUDE_DIR
  191. #endif
  192. #if defined(ARMA_DONT_USE_ATLAS)
  193. #undef ARMA_USE_ATLAS
  194. #undef ARMA_ATLAS_INCLUDE_DIR
  195. #endif
  196. #if defined(ARMA_DONT_USE_WRAPPER)
  197. #undef ARMA_USE_WRAPPER
  198. #undef ARMA_USE_HDF5_ALT
  199. #endif
  200. #if defined(ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS)
  201. #undef ARMA_USE_FORTRAN_HIDDEN_ARGS
  202. #endif
  203. #if defined(ARMA_DONT_USE_CXX11)
  204. #undef ARMA_USE_CXX11
  205. #undef ARMA_USE_EXTERN_CXX11_RNG
  206. #endif
  207. #if !defined(ARMA_DONT_USE_CXX11_MUTEX)
  208. // #define ARMA_DONT_USE_CXX11_MUTEX
  209. //// Uncomment the above line to disable use of std::mutex in C++11
  210. #endif
  211. #if defined(ARMA_DONT_USE_STD_MUTEX)
  212. #undef ARMA_DONT_USE_CXX11_MUTEX
  213. #define ARMA_DONT_USE_CXX11_MUTEX
  214. #endif
  215. #if defined(ARMA_DONT_USE_OPENMP)
  216. #undef ARMA_USE_OPENMP
  217. #endif
  218. #if defined(ARMA_USE_WRAPPER)
  219. #if defined(ARMA_USE_CXX11)
  220. #if !defined(ARMA_USE_EXTERN_CXX11_RNG)
  221. // #define ARMA_USE_EXTERN_CXX11_RNG
  222. #endif
  223. #endif
  224. #endif
  225. #if defined(ARMA_DONT_USE_EXTERN_CXX11_RNG)
  226. #undef ARMA_USE_EXTERN_CXX11_RNG
  227. #endif
  228. #if defined(ARMA_32BIT_WORD)
  229. #undef ARMA_64BIT_WORD
  230. #endif
  231. #if defined(ARMA_DONT_USE_HDF5)
  232. #undef ARMA_USE_HDF5
  233. #undef ARMA_USE_HDF5_ALT
  234. #endif
  235. #if defined(ARMA_DONT_OPTIMISE_BAND) || defined(ARMA_DONT_OPTIMISE_SOLVE_BAND)
  236. #undef ARMA_OPTIMISE_BAND
  237. #endif
  238. #if defined(ARMA_DONT_OPTIMISE_SYMPD) || defined(ARMA_DONT_OPTIMISE_SOLVE_SYMPD)
  239. #undef ARMA_OPTIMISE_SYMPD
  240. #endif
  241. #if defined(ARMA_DONT_PRINT_ERRORS)
  242. #undef ARMA_PRINT_ERRORS
  243. #endif
  244. #if defined(ARMA_DONT_PRINT_HDF5_ERRORS)
  245. #undef ARMA_PRINT_HDF5_ERRORS
  246. #endif
  247. #if defined(ARMA_NO_CRIPPLED_LAPACK)
  248. #undef ARMA_CRIPPLED_LAPACK
  249. #endif
  250. #if defined(ARMA_WARN_LEVEL)
  251. #pragma message ("WARNING: the ARMA_WARN_LEVEL option is not supported in this version of Armadillo")
  252. #endif
  253. // if Armadillo was installed on this system via CMake and ARMA_USE_WRAPPER is not defined,
  254. // ARMA_AUX_LIBS lists the libraries required by Armadillo on this system, and
  255. // ARMA_AUX_INCDIRS lists the include directories required by Armadillo on this system.
  256. // Do not use these unless you know what you are doing.
  257. #define ARMA_AUX_LIBS
  258. #define ARMA_AUX_INCDIRS