From 6fb8a00dba7575cfbf3d5266603ecbbd2ae5fd15 Mon Sep 17 00:00:00 2001 From: conrad Date: Mon, 28 Mar 2022 11:54:47 +1000 Subject: [PATCH] add check_nonfinite config option --- include/armadillo_bits/arma_config.hpp | 7 +++++++ include/armadillo_bits/config.hpp | 5 +++++ include/armadillo_bits/config.hpp.cmake | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/armadillo_bits/arma_config.hpp b/include/armadillo_bits/arma_config.hpp index a9eee6b6..d6a855ee 100644 --- a/include/armadillo_bits/arma_config.hpp +++ b/include/armadillo_bits/arma_config.hpp @@ -65,6 +65,13 @@ struct arma_config #endif + #if defined(ARMA_CHECK_NONFINITE) + static constexpr bool check_nonfinite = true; + #else + static constexpr bool check_nonfinite = false; + #endif + + #if defined(ARMA_USE_LAPACK) static constexpr bool lapack = true; #else diff --git a/include/armadillo_bits/config.hpp b/include/armadillo_bits/config.hpp index 8055a584..73188753 100644 --- a/include/armadillo_bits/config.hpp +++ b/include/armadillo_bits/config.hpp @@ -154,6 +154,11 @@ //// of inv() and inv_sympd() within compound expressions #endif +#if !defined(ARMA_CHECK_NONFINITE) + #define ARMA_CHECK_NONFINITE + //// Comment out the above line if you don't want automatic checking for nonfinite matrices +#endif + // #define ARMA_USE_HDF5_ALT #if defined(ARMA_USE_HDF5_ALT) && defined(ARMA_USE_WRAPPER) #undef ARMA_USE_HDF5 diff --git a/include/armadillo_bits/config.hpp.cmake b/include/armadillo_bits/config.hpp.cmake index e9aa2528..8063832c 100644 --- a/include/armadillo_bits/config.hpp.cmake +++ b/include/armadillo_bits/config.hpp.cmake @@ -154,7 +154,12 @@ //// of inv() and inv_sympd() within compound expressions #endif -#cmakedefine ARMA_USE_HDF5_ALT +#if !defined(ARMA_CHECK_NONFINITE) + #define ARMA_CHECK_NONFINITE + //// Comment out the above line if you don't want automatic checking for nonfinite matrices +#endif + +// #define ARMA_USE_HDF5_ALT #if defined(ARMA_USE_HDF5_ALT) && defined(ARMA_USE_WRAPPER) #undef ARMA_USE_HDF5 #define ARMA_USE_HDF5