diff --git a/include/armadillo_bits/Cube_meat.hpp b/include/armadillo_bits/Cube_meat.hpp index ddd92bc6..393e5634 100644 --- a/include/armadillo_bits/Cube_meat.hpp +++ b/include/armadillo_bits/Cube_meat.hpp @@ -35,7 +35,7 @@ Cube::~Cube() } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { access::rw(mem) = nullptr; } + access::rw(mem) = nullptr; arma_type_check(( is_supported_elem_type::value == false )); } @@ -2264,7 +2264,7 @@ Cube::shed_slices(const Base& indices) const uword* slices_to_shed_mem = slices_to_shed.memptr(); const uword N = slices_to_shed.n_elem; - if(arma_config::debug) + if(arma_config::check_conformance) { for(uword i=0; i::~MapMat() if(map_ptr) { (*map_ptr).clear(); delete map_ptr; } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { map_ptr = nullptr; } + map_ptr = nullptr; arma_type_check(( is_supported_elem_type::value == false )); } diff --git a/include/armadillo_bits/Mat_meat.hpp b/include/armadillo_bits/Mat_meat.hpp index b94f1035..35c24f91 100644 --- a/include/armadillo_bits/Mat_meat.hpp +++ b/include/armadillo_bits/Mat_meat.hpp @@ -33,7 +33,7 @@ Mat::~Mat() } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { access::rw(mem) = nullptr; } + access::rw(mem) = nullptr; arma_type_check(( is_supported_elem_type::value == false )); } @@ -4425,7 +4425,7 @@ Mat::shed_rows(const Base& indices) const uword* rows_to_shed_mem = rows_to_shed.memptr(); const uword N = rows_to_shed.n_elem; - if(arma_config::debug) + if(arma_config::check_conformance) { for(uword i=0; i::shed_cols(const Base& indices) const uword* cols_to_shed_mem = cols_to_shed.memptr(); const uword N = cols_to_shed.n_elem; - if(arma_config::debug) + if(arma_config::check_conformance) { for(uword i=0; i& eigval, Mat& A) if(A.is_empty()) { eigval.reset(); return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false)) { arma_debug_warn_level(1, "eig_sym(): given matrix is not symmetric"); } @@ -2041,7 +2041,7 @@ auxlib::eig_sym(Col& eigval, Mat< std::complex >& A) if(A.is_empty()) { eigval.reset(); return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false)) { arma_debug_warn_level(1, "eig_sym(): given matrix is not hermitian"); } diff --git a/include/armadillo_bits/config.hpp b/include/armadillo_bits/config.hpp index 3a482a92..9cba2fa5 100644 --- a/include/armadillo_bits/config.hpp +++ b/include/armadillo_bits/config.hpp @@ -164,6 +164,14 @@ //// of inv() and inv_sympd() within compound expressions #endif +#if !defined(ARMA_CHECK_CONFORMANCE) + #define ARMA_CHECK_CONFORMANCE + //// Comment out the above line to disable conformance checks for bounds and size. + //// This is NOT RECOMMENDED. + //// It is strongly recommended that conformance checks are enabled during development, + //// as this greatly aids in finding mistakes in your code. +#endif + #if !defined(ARMA_CHECK_NONFINITE) #define ARMA_CHECK_NONFINITE //// Comment out the above line to disable checking for nonfinite matrices @@ -189,18 +197,13 @@ //// The maximum number of threads to use for OpenMP based parallelisation; //// it must be an integer that is at least 1. -// #define ARMA_NO_DEBUG -//// Uncomment the above line to disable all run-time checks. NOT RECOMMENDED. -//// It is strongly recommended that run-time checks are enabled during development, -//// as this greatly aids in finding mistakes in your code. - -// #define ARMA_EXTRA_DEBUG +// #define ARMA_DEBUG //// Uncomment the above line to see the function traces of how Armadillo evaluates expressions. //// This is mainly useful for debugging of the library. - -#if defined(ARMA_EXTRA_DEBUG) - #undef ARMA_NO_DEBUG +#if defined(ARMA_DEBUG) || defined(ARMA_EXTRA_DEBUG) + #undef ARMA_DONT_CHECK_CONFORMANCE + #undef ARMA_DONT_CHECK_NONFINITE #undef ARMA_WARN_LEVEL #define ARMA_WARN_LEVEL 3 #endif @@ -313,10 +316,19 @@ #undef ARMA_OPTIMISE_INVEXPR #endif +#if defined(ARMA_DONT_CHECK_CONFORMANCE) + #undef ARMA_CHECK_CONFORMANCE +#endif + #if defined(ARMA_DONT_CHECK_NONFINITE) #undef ARMA_CHECK_NONFINITE #endif +#if defined(ARMA_NO_DEBUG) + #undef ARMA_DEBUG + #undef ARMA_EXTRA_DEBUG +#endif + #if defined(ARMA_DONT_PRINT_ERRORS) #pragma message ("INFO: support for ARMA_DONT_PRINT_ERRORS option has been removed") diff --git a/include/armadillo_bits/config.hpp.cmake b/include/armadillo_bits/config.hpp.cmake index 7dce785d..f1d536a9 100644 --- a/include/armadillo_bits/config.hpp.cmake +++ b/include/armadillo_bits/config.hpp.cmake @@ -164,6 +164,14 @@ //// of inv() and inv_sympd() within compound expressions #endif +#if !defined(ARMA_CHECK_CONFORMANCE) + #define ARMA_CHECK_CONFORMANCE + //// Comment out the above line to disable conformance checks for bounds and size. + //// This is NOT RECOMMENDED. + //// It is strongly recommended that conformance checks are enabled during development, + //// as this greatly aids in finding mistakes in your code. +#endif + #if !defined(ARMA_CHECK_NONFINITE) #define ARMA_CHECK_NONFINITE //// Comment out the above line to disable checking for nonfinite matrices @@ -189,18 +197,13 @@ //// The maximum number of threads to use for OpenMP based parallelisation; //// it must be an integer that is at least 1. -// #define ARMA_NO_DEBUG -//// Uncomment the above line to disable all run-time checks. NOT RECOMMENDED. -//// It is strongly recommended that run-time checks are enabled during development, -//// as this greatly aids in finding mistakes in your code. - -// #define ARMA_EXTRA_DEBUG +// #define ARMA_DEBUG //// Uncomment the above line to see the function traces of how Armadillo evaluates expressions. //// This is mainly useful for debugging of the library. - -#if defined(ARMA_EXTRA_DEBUG) - #undef ARMA_NO_DEBUG +#if defined(ARMA_DEBUG) || defined(ARMA_EXTRA_DEBUG) + #undef ARMA_DONT_CHECK_CONFORMANCE + #undef ARMA_DONT_CHECK_NONFINITE #undef ARMA_WARN_LEVEL #define ARMA_WARN_LEVEL 3 #endif @@ -313,10 +316,19 @@ #undef ARMA_OPTIMISE_INVEXPR #endif +#if defined(ARMA_DONT_CHECK_CONFORMANCE) + #undef ARMA_CHECK_CONFORMANCE +#endif + #if defined(ARMA_DONT_CHECK_NONFINITE) #undef ARMA_CHECK_NONFINITE #endif +#if defined(ARMA_NO_DEBUG) + #undef ARMA_DEBUG + #undef ARMA_EXTRA_DEBUG +#endif + #if defined(ARMA_DONT_PRINT_ERRORS) #pragma message ("INFO: support for ARMA_DONT_PRINT_ERRORS option has been removed") diff --git a/include/armadillo_bits/debug.hpp b/include/armadillo_bits/debug.hpp index 6d463720..ab2a0e36 100644 --- a/include/armadillo_bits/debug.hpp +++ b/include/armadillo_bits/debug.hpp @@ -1339,22 +1339,8 @@ arma_assert_atlas_size(const T1& A, const T2& B) // #define ARMA_FILELINE __FILE__ ": " ARMA_STRING2(__LINE__) -#if defined(ARMA_NO_DEBUG) - - #define arma_debug_print true ? (void)0 : arma_print - #define arma_debug_warn true ? (void)0 : arma_warn - #define arma_debug_warn_level true ? (void)0 : arma_warn_level - #define arma_debug_check true ? (void)0 : arma_check - #define arma_debug_check_bounds true ? (void)0 : arma_check_bounds - #define arma_debug_set_error true ? (void)0 : arma_set_error - #define arma_debug_assert_same_size true ? (void)0 : arma_assert_same_size - #define arma_debug_assert_mul_size true ? (void)0 : arma_assert_mul_size - #define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size - #define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat - #define arma_debug_assert_blas_size true ? (void)0 : arma_assert_blas_size - #define arma_debug_assert_atlas_size true ? (void)0 : arma_assert_atlas_size - -#else +// TODO: rename arma_debug_* to arma_conf_* here and throughout the codebase +#if defined(ARMA_CHECK_CONFORMANCE) #define arma_debug_print arma_print #define arma_debug_warn arma_warn @@ -1369,11 +1355,27 @@ arma_assert_atlas_size(const T1& A, const T2& B) #define arma_debug_assert_blas_size arma_assert_blas_size #define arma_debug_assert_atlas_size arma_assert_atlas_size +#else + + #define arma_debug_print true ? (void)0 : arma_print + #define arma_debug_warn true ? (void)0 : arma_warn + #define arma_debug_warn_level true ? (void)0 : arma_warn_level + #define arma_debug_check true ? (void)0 : arma_check + #define arma_debug_check_bounds true ? (void)0 : arma_check_bounds + #define arma_debug_set_error true ? (void)0 : arma_set_error + #define arma_debug_assert_same_size true ? (void)0 : arma_assert_same_size + #define arma_debug_assert_mul_size true ? (void)0 : arma_assert_mul_size + #define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size + #define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat + #define arma_debug_assert_blas_size true ? (void)0 : arma_assert_blas_size + #define arma_debug_assert_atlas_size true ? (void)0 : arma_assert_atlas_size + #endif -#if defined(ARMA_EXTRA_DEBUG) +// TODO: rename arma_extra_debug_* to arma_debug_* here and throughout the codebase +#if defined(ARMA_DEBUG) || defined(ARMA_EXTRA_DEBUG) #define arma_extra_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint #define arma_extra_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_thisprint @@ -1390,16 +1392,16 @@ arma_assert_atlas_size(const T1& A, const T2& B) -#if defined(ARMA_EXTRA_DEBUG) +#if defined(ARMA_DEBUG) namespace junk { - class arma_first_extra_debug_message + class arma_first_debug_message { public: inline - arma_first_extra_debug_message() + arma_first_debug_message() { const char* nickname = ARMA_VERSION_NAME; @@ -1444,7 +1446,7 @@ arma_assert_atlas_size(const T1& A, const T2& B) } }; - static arma_first_extra_debug_message arma_first_extra_debug_message_run; + static arma_first_debug_message arma_first_debug_message_run; } #endif diff --git a/include/armadillo_bits/field_meat.hpp b/include/armadillo_bits/field_meat.hpp index 6f88311e..c796a6c0 100644 --- a/include/armadillo_bits/field_meat.hpp +++ b/include/armadillo_bits/field_meat.hpp @@ -31,7 +31,7 @@ field::~field() if(n_elem > field_prealloc_n_elem::val) { delete [] mem; } // try to expose buggy user code that accesses deleted objects - if(arma_config::debug) { mem = nullptr; } + mem = nullptr; } diff --git a/include/armadillo_bits/fn_chol.hpp b/include/armadillo_bits/fn_chol.hpp index dfd9e6e4..a74d8c42 100644 --- a/include/armadillo_bits/fn_chol.hpp +++ b/include/armadillo_bits/fn_chol.hpp @@ -103,7 +103,7 @@ chol return true; } - if((arma_config::debug) && (auxlib::rudimentary_sym_check(out) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(out) == false)) { if(is_cx::no ) { arma_debug_warn_level(1, "chol(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "chol(): given matrix is not hermitian"); } diff --git a/include/armadillo_bits/fn_eig_sym.hpp b/include/armadillo_bits/fn_eig_sym.hpp index 12043b6f..6e5380a7 100644 --- a/include/armadillo_bits/fn_eig_sym.hpp +++ b/include/armadillo_bits/fn_eig_sym.hpp @@ -95,7 +95,7 @@ eig_sym_helper { arma_extra_debug_sigprint(); - if((arma_config::debug) && (auxlib::rudimentary_sym_check(X) == false)) + if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(X) == false)) { if(is_cx::no ) { arma_debug_warn_level(1, caller_sig, ": given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, caller_sig, ": given matrix is not hermitian"); } diff --git a/include/armadillo_bits/glue_mvnrnd_meat.hpp b/include/armadillo_bits/glue_mvnrnd_meat.hpp index 3c3019fb..dd4e2de8 100644 --- a/include/armadillo_bits/glue_mvnrnd_meat.hpp +++ b/include/armadillo_bits/glue_mvnrnd_meat.hpp @@ -85,7 +85,7 @@ glue_mvnrnd::apply_direct(Mat& out, const Base::apply(Mat& out, const arma_debug_check( (A.is_square() == false), "inv(): given matrix must be square sized" ); - if( (strip_inv::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) ) { if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } @@ -130,7 +130,7 @@ glue_times_redirect2_helper::apply(Mat& out, const arma_debug_check( (B.is_square() == false), "inv_sympd(): given matrix must be square sized" ); - if( (arma_config::debug) && (auxlib::rudimentary_sym_check(B) == false) ) + if( (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) ) { if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } @@ -257,7 +257,7 @@ glue_times_redirect3_helper::apply(Mat& out, const arma_debug_assert_mul_size(A, BC, "matrix multiplication"); - if( (strip_inv::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) ) { if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } @@ -292,7 +292,7 @@ glue_times_redirect3_helper::apply(Mat& out, const arma_debug_assert_mul_size(B, C, "matrix multiplication"); - if( (strip_inv::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(B) == false) ) + if( (strip_inv::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) ) { if(is_cx::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); } diff --git a/include/armadillo_bits/op_chol_meat.hpp b/include/armadillo_bits/op_chol_meat.hpp index ebc6448b..20eb9f92 100644 --- a/include/armadillo_bits/op_chol_meat.hpp +++ b/include/armadillo_bits/op_chol_meat.hpp @@ -54,7 +54,7 @@ op_chol::apply_direct(Mat& out, const Base::no ) { arma_debug_warn_level(1, "chol(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "chol(): given matrix is not hermitian"); } diff --git a/include/armadillo_bits/op_expmat_meat.hpp b/include/armadillo_bits/op_expmat_meat.hpp index d45fb36d..742c371d 100644 --- a/include/armadillo_bits/op_expmat_meat.hpp +++ b/include/armadillo_bits/op_expmat_meat.hpp @@ -200,7 +200,7 @@ op_expmat_sym::apply_direct(Mat& out, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { arma_debug_warn_level(1, "inv_sympd(): imaginary components on diagonal are non-zero"); } diff --git a/include/armadillo_bits/op_find_meat.hpp b/include/armadillo_bits/op_find_meat.hpp index b2fd6dde..d455a983 100644 --- a/include/armadillo_bits/op_find_meat.hpp +++ b/include/armadillo_bits/op_find_meat.hpp @@ -93,7 +93,7 @@ op_find::helper const eT val = X.aux; - if((is_same_type::yes || is_same_type::yes) && arma_config::debug && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::check_conformance && arma_isnan(val)) { arma_debug_warn_level(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } @@ -226,7 +226,7 @@ op_find::helper const eT val = X.aux; - if((is_same_type::yes || is_same_type::yes) && arma_config::debug && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::check_conformance && arma_isnan(val)) { arma_debug_warn_level(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } diff --git a/include/armadillo_bits/op_inv_spd_meat.hpp b/include/armadillo_bits/op_inv_spd_meat.hpp index 0c609745..5225f267 100644 --- a/include/armadillo_bits/op_inv_spd_meat.hpp +++ b/include/armadillo_bits/op_inv_spd_meat.hpp @@ -150,7 +150,7 @@ op_inv_spd_full::apply_direct(Mat& out, const Base 0)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0)) { if(auxlib::rudimentary_sym_check(out) == false) { @@ -284,7 +284,7 @@ op_inv_spd_rcond::apply_direct(Mat& out, op_inv_spd_stat arma_debug_check( (out.is_square() == false), "inv_sympd(): given matrix must be square sized", [&](){ out.soft_reset(); } ); - if((arma_config::debug) && (arma_config::warn_level > 0)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0)) { if(auxlib::rudimentary_sym_check(out) == false) { diff --git a/include/armadillo_bits/op_log_det_meat.hpp b/include/armadillo_bits/op_log_det_meat.hpp index 7b888592..0df3fe6e 100644 --- a/include/armadillo_bits/op_log_det_meat.hpp +++ b/include/armadillo_bits/op_log_det_meat.hpp @@ -195,7 +195,7 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(A) == false)) { arma_debug_warn_level(1, "log_det_sympd(): imaginary components on diagonal are non-zero"); } @@ -225,7 +225,7 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base::no ) { arma_debug_warn_level(1, "log_det_sympd(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "log_det_sympd(): given matrix is not hermitian"); } diff --git a/include/armadillo_bits/op_logmat_meat.hpp b/include/armadillo_bits/op_logmat_meat.hpp index 494f747a..aed0a979 100644 --- a/include/armadillo_bits/op_logmat_meat.hpp +++ b/include/armadillo_bits/op_logmat_meat.hpp @@ -505,7 +505,7 @@ op_logmat_sympd::apply_direct(Mat& out, const Base 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { arma_debug_warn_level(1, "logmat_sympd(): imaginary components on diagonal are non-zero"); } diff --git a/include/armadillo_bits/op_sqrtmat_meat.hpp b/include/armadillo_bits/op_sqrtmat_meat.hpp index 3c2fae50..6317ceb6 100644 --- a/include/armadillo_bits/op_sqrtmat_meat.hpp +++ b/include/armadillo_bits/op_sqrtmat_meat.hpp @@ -482,7 +482,7 @@ op_sqrtmat_sympd::apply_direct(Mat& out, const Base::yes) && (sym_helper::check_diag_imag(X) == false)) + if((arma_config::check_conformance) && (is_cx::yes) && (sym_helper::check_diag_imag(X) == false)) { arma_debug_warn_level(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero"); } diff --git a/include/armadillo_bits/sp_auxlib_meat.hpp b/include/armadillo_bits/sp_auxlib_meat.hpp index 97df7e8c..b256dcfb 100644 --- a/include/armadillo_bits/sp_auxlib_meat.hpp +++ b/include/armadillo_bits/sp_auxlib_meat.hpp @@ -67,7 +67,7 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c arma_debug_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); - if((arma_config::debug) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) + if((arma_config::check_conformance) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { if(is_cx::no ) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not hermitian"); } @@ -120,7 +120,7 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c arma_debug_check( (U.M.is_square() == false), "eigs_sym(): given matrix must be square sized" ); - if((arma_config::debug) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) + if((arma_config::check_conformance) && (sp_auxlib::rudimentary_sym_check(U.M) == false)) { if(is_cx::no ) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not symmetric"); } if(is_cx::yes) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not hermitian"); } @@ -1202,7 +1202,7 @@ sp_auxlib::spsolve_simple(Mat& X, const SpBase& X, typename T1::pod_type& return false; } - if(arma_config::debug) + if(arma_config::check_conformance) { bool overflow; diff --git a/include/armadillo_bits/subview_cube_each_meat.hpp b/include/armadillo_bits/subview_cube_each_meat.hpp index a3069182..c5fdec6a 100644 --- a/include/armadillo_bits/subview_cube_each_meat.hpp +++ b/include/armadillo_bits/subview_cube_each_meat.hpp @@ -40,7 +40,7 @@ inline void subview_cube_each_common::check_size(const Mat& A) const { - if(arma_config::debug) + if(arma_config::check_conformance) { if( (A.n_rows != P.n_rows) || (A.n_cols != P.n_cols) ) { diff --git a/include/armadillo_bits/subview_cube_meat.hpp b/include/armadillo_bits/subview_cube_meat.hpp index 52cfb07a..2b5f228e 100644 --- a/include/armadillo_bits/subview_cube_meat.hpp +++ b/include/armadillo_bits/subview_cube_meat.hpp @@ -560,7 +560,7 @@ subview_cube::operator= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "copy into subcube") ); } @@ -663,7 +663,7 @@ subview_cube::operator+= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "addition") ); } @@ -766,7 +766,7 @@ subview_cube::operator-= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "subtraction") ); } @@ -869,7 +869,7 @@ subview_cube::operator%= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "element-wise multiplication") ); } @@ -972,7 +972,7 @@ subview_cube::operator/= (const Base& in) } else { - if(arma_config::debug) + if(arma_config::check_conformance) { arma_stop_logic_error( arma_incompat_size_string(t, x, "element-wise division") ); } @@ -1947,7 +1947,7 @@ subview_cube::plus_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2048,7 +2048,7 @@ subview_cube::minus_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2149,7 +2149,7 @@ subview_cube::schur_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; @@ -2250,7 +2250,7 @@ subview_cube::div_inplace(Mat& out, const subview_cube& in) if(in_n_slices == 1) { - if( (arma_config::debug) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) + if( (arma_config::check_conformance) && ((out_n_rows != in_n_rows) || (out_n_cols != in_n_cols)) ) { std::ostringstream tmp; diff --git a/include/armadillo_bits/subview_each_meat.hpp b/include/armadillo_bits/subview_each_meat.hpp index 12d263ef..55295d6b 100644 --- a/include/armadillo_bits/subview_each_meat.hpp +++ b/include/armadillo_bits/subview_each_meat.hpp @@ -70,7 +70,7 @@ inline void subview_each_common::check_size(const Mat& A) const { - if(arma_config::debug) + if(arma_config::check_conformance) { if(mode == 0) {