rework ARMA_NO_DEBUG to ARMA_DONT_CHECK_CONFORMANCE
This commit is contained in:
@@ -35,7 +35,7 @@ Cube<eT>::~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<eT>::value == false ));
|
||||
}
|
||||
@@ -2264,7 +2264,7 @@ Cube<eT>::shed_slices(const Base<uword, T1>& 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<N; ++i)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ MapMat<eT>::~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<eT>::value == false ));
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ Mat<eT>::~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<eT>::value == false ));
|
||||
}
|
||||
@@ -4425,7 +4425,7 @@ Mat<eT>::shed_rows(const Base<uword, T1>& 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<N; ++i)
|
||||
{
|
||||
@@ -4495,7 +4495,7 @@ Mat<eT>::shed_cols(const Base<uword, T1>& 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<N; ++i)
|
||||
{
|
||||
|
||||
@@ -65,6 +65,13 @@ struct arma_config
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_CHECK_CONFORMANCE)
|
||||
static constexpr bool check_conformance = true;
|
||||
#else
|
||||
static constexpr bool check_conformance = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_CHECK_NONFINITE)
|
||||
static constexpr bool check_nonfinite = true;
|
||||
#else
|
||||
@@ -121,20 +128,6 @@ struct arma_config
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_NO_DEBUG)
|
||||
static constexpr bool debug = false;
|
||||
#else
|
||||
static constexpr bool debug = true;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_EXTRA_DEBUG)
|
||||
static constexpr bool extra_debug = true;
|
||||
#else
|
||||
static constexpr bool extra_debug = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_GOOD_COMPILER)
|
||||
static constexpr bool good_comp = true;
|
||||
#else
|
||||
|
||||
@@ -1988,7 +1988,7 @@ auxlib::eig_sym(Col<eT>& eigval, Mat<eT>& 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<T>& eigval, Mat< std::complex<T> >& 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");
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,7 +31,7 @@ field<oT>::~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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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<eT>::no ) { arma_debug_warn_level(1, "chol(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "chol(): given matrix is not hermitian"); }
|
||||
|
||||
@@ -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<eT>::no ) { arma_debug_warn_level(1, caller_sig, ": given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, caller_sig, ": given matrix is not hermitian"); }
|
||||
|
||||
@@ -85,7 +85,7 @@ glue_mvnrnd::apply_direct(Mat<typename T1::elem_type>& out, const Base<typename
|
||||
return true;
|
||||
}
|
||||
|
||||
if((arma_config::debug) && (auxlib::rudimentary_sym_check(UC.M) == false))
|
||||
if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(UC.M) == false))
|
||||
{
|
||||
arma_debug_warn_level(1, "mvnrnd(): given matrix is not symmetric");
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ glue_times_redirect2_helper<true>::apply(Mat<typename T1::elem_type>& out, const
|
||||
|
||||
arma_debug_check( (A.is_square() == false), "inv(): given matrix must be square sized" );
|
||||
|
||||
if( (strip_inv<T1>::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false) )
|
||||
if( (strip_inv<T1>::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) )
|
||||
{
|
||||
if(is_cx<eT>::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); }
|
||||
@@ -130,7 +130,7 @@ glue_times_redirect2_helper<true>::apply(Mat<typename T1::elem_type>& 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<eT>::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); }
|
||||
@@ -257,7 +257,7 @@ glue_times_redirect3_helper<true>::apply(Mat<typename T1::elem_type>& out, const
|
||||
|
||||
arma_debug_assert_mul_size(A, BC, "matrix multiplication");
|
||||
|
||||
if( (strip_inv<T1>::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false) )
|
||||
if( (strip_inv<T1>::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false) )
|
||||
{
|
||||
if(is_cx<eT>::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); }
|
||||
@@ -292,7 +292,7 @@ glue_times_redirect3_helper<true>::apply(Mat<typename T1::elem_type>& out, const
|
||||
|
||||
arma_debug_assert_mul_size(B, C, "matrix multiplication");
|
||||
|
||||
if( (strip_inv<T2>::do_inv_spd) && (arma_config::debug) && (auxlib::rudimentary_sym_check(B) == false) )
|
||||
if( (strip_inv<T2>::do_inv_spd) && (arma_config::check_conformance) && (auxlib::rudimentary_sym_check(B) == false) )
|
||||
{
|
||||
if(is_cx<eT>::no ) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "inv_sympd(): given matrix is not hermitian"); }
|
||||
|
||||
@@ -54,7 +54,7 @@ op_chol::apply_direct(Mat<typename T1::elem_type>& out, const Base<typename T1::
|
||||
|
||||
if(out.is_empty()) { 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<eT>::no ) { arma_debug_warn_level(1, "chol(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "chol(): given matrix is not hermitian"); }
|
||||
|
||||
@@ -200,7 +200,7 @@ op_expmat_sym::apply_direct(Mat<typename T1::elem_type>& out, const Base<typenam
|
||||
|
||||
arma_debug_check( (X.is_square() == false), "expmat_sym(): given matrix must be square sized" );
|
||||
|
||||
if((arma_config::debug) && (arma_config::warn_level > 0) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(X) == false))
|
||||
if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(X) == false))
|
||||
{
|
||||
arma_debug_warn_level(1, "inv_sympd(): imaginary components on diagonal are non-zero");
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ op_find::helper
|
||||
|
||||
const eT val = X.aux;
|
||||
|
||||
if((is_same_type<op_type, op_rel_eq>::yes || is_same_type<op_type, op_rel_noteq>::yes) && arma_config::debug && arma_isnan(val))
|
||||
if((is_same_type<op_type, op_rel_eq>::yes || is_same_type<op_type, op_rel_noteq>::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<op_type, op_rel_eq>::yes || is_same_type<op_type, op_rel_noteq>::yes) && arma_config::debug && arma_isnan(val))
|
||||
if((is_same_type<op_type, op_rel_eq>::yes || is_same_type<op_type, op_rel_noteq>::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");
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ op_inv_spd_full::apply_direct(Mat<typename T1::elem_type>& out, const Base<typen
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -284,7 +284,7 @@ op_inv_spd_rcond::apply_direct(Mat<typename T1::elem_type>& 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)
|
||||
{
|
||||
|
||||
@@ -195,7 +195,7 @@ op_log_det_sympd::apply_direct(typename T1::pod_type& out_val, const Base<typena
|
||||
|
||||
arma_debug_check( (A.is_square() == false), "log_det_sympd(): given matrix must be square sized" );
|
||||
|
||||
if((arma_config::debug) && (arma_config::warn_level > 0) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(A) == false))
|
||||
if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx<eT>::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<typena
|
||||
return true;
|
||||
}
|
||||
|
||||
if((arma_config::debug) && (auxlib::rudimentary_sym_check(A) == false))
|
||||
if((arma_config::check_conformance) && (auxlib::rudimentary_sym_check(A) == false))
|
||||
{
|
||||
if(is_cx<eT>::no ) { arma_debug_warn_level(1, "log_det_sympd(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "log_det_sympd(): given matrix is not hermitian"); }
|
||||
|
||||
@@ -505,7 +505,7 @@ op_logmat_sympd::apply_direct(Mat<typename T1::elem_type>& out, const Base<typen
|
||||
|
||||
arma_debug_check( (X.is_square() == false), "logmat_sympd(): given matrix must be square sized" );
|
||||
|
||||
if((arma_config::debug) && (arma_config::warn_level > 0) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(X) == false))
|
||||
if((arma_config::check_conformance) && (arma_config::warn_level > 0) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(X) == false))
|
||||
{
|
||||
arma_debug_warn_level(1, "logmat_sympd(): imaginary components on diagonal are non-zero");
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ op_sqrtmat_sympd::apply_direct(Mat<typename T1::elem_type>& out, const Base<type
|
||||
|
||||
arma_debug_check( (X.is_square() == false), "sqrtmat_sympd(): given matrix must be square sized" );
|
||||
|
||||
if((arma_config::debug) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(X) == false))
|
||||
if((arma_config::check_conformance) && (is_cx<eT>::yes) && (sym_helper::check_diag_imag(X) == false))
|
||||
{
|
||||
arma_debug_warn_level(1, "sqrtmat_sympd(): imaginary components on the diagonal are non-zero");
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ sp_auxlib::eigs_sym(Col<eT>& eigval, Mat<eT>& eigvec, const SpBase<eT, T1>& 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<eT>::no ) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not hermitian"); }
|
||||
@@ -120,7 +120,7 @@ sp_auxlib::eigs_sym(Col<eT>& eigval, Mat<eT>& eigvec, const SpBase<eT, T1>& 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<eT>::no ) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not symmetric"); }
|
||||
if(is_cx<eT>::yes) { arma_debug_warn_level(1, "eigs_sym(): given matrix is not hermitian"); }
|
||||
@@ -1202,7 +1202,7 @@ sp_auxlib::spsolve_simple(Mat<typename T1::elem_type>& X, const SpBase<typename
|
||||
return false;
|
||||
}
|
||||
|
||||
if(arma_config::debug)
|
||||
if(arma_config::check_conformance)
|
||||
{
|
||||
bool overflow = false;
|
||||
|
||||
@@ -1327,7 +1327,7 @@ sp_auxlib::spsolve_refine(Mat<typename T1::elem_type>& X, typename T1::pod_type&
|
||||
return false;
|
||||
}
|
||||
|
||||
if(arma_config::debug)
|
||||
if(arma_config::check_conformance)
|
||||
{
|
||||
bool overflow;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ inline
|
||||
void
|
||||
subview_cube_each_common<eT>::check_size(const Mat<eT2>& A) const
|
||||
{
|
||||
if(arma_config::debug)
|
||||
if(arma_config::check_conformance)
|
||||
{
|
||||
if( (A.n_rows != P.n_rows) || (A.n_cols != P.n_cols) )
|
||||
{
|
||||
|
||||
@@ -560,7 +560,7 @@ subview_cube<eT>::operator= (const Base<eT,T1>& 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<eT>::operator+= (const Base<eT,T1>& 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<eT>::operator-= (const Base<eT,T1>& 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<eT>::operator%= (const Base<eT,T1>& 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<eT>::operator/= (const Base<eT,T1>& 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<eT>::plus_inplace(Mat<eT>& out, const subview_cube<eT>& 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<eT>::minus_inplace(Mat<eT>& out, const subview_cube<eT>& 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<eT>::schur_inplace(Mat<eT>& out, const subview_cube<eT>& 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<eT>::div_inplace(Mat<eT>& out, const subview_cube<eT>& 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;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ inline
|
||||
void
|
||||
subview_each_common<parent,mode>::check_size(const Mat<eT2>& A) const
|
||||
{
|
||||
if(arma_config::debug)
|
||||
if(arma_config::check_conformance)
|
||||
{
|
||||
if(mode == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user