diff --git a/include/armadillo_bits/Cube_meat.hpp b/include/armadillo_bits/Cube_meat.hpp index 9b68ccdc..6dc19ce9 100644 --- a/include/armadillo_bits/Cube_meat.hpp +++ b/include/armadillo_bits/Cube_meat.hpp @@ -296,7 +296,7 @@ inline void Cube::init_cold() { - arma_debug_sigprint( arma_str::format("n_rows = %u, n_cols = %u, n_slices = %u") % n_rows % n_cols % n_slices ); + arma_debug_sigprint( arma_str::format("n_rows: %u; n_cols: %u; n_slices: %u") % n_rows % n_cols % n_slices ); #if defined(ARMA_64BIT_WORD) const char* error_message = "Cube::init(): requested size is too large"; @@ -340,7 +340,7 @@ inline void Cube::init_warm(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices) { - arma_debug_sigprint( arma_str::format("in_n_rows = %u, in_n_cols = %u, in_n_slices = %u") % in_n_rows % in_n_cols % in_n_slices ); + arma_debug_sigprint( arma_str::format("in_n_rows: %u; in_n_cols: %u; in_n_slices: %u") % in_n_rows % in_n_cols % in_n_slices ); if( (n_rows == in_n_rows) && (n_cols == in_n_cols) && (n_slices == in_n_slices) ) { return; } diff --git a/include/armadillo_bits/Mat_meat.hpp b/include/armadillo_bits/Mat_meat.hpp index 178df007..aec54271 100644 --- a/include/armadillo_bits/Mat_meat.hpp +++ b/include/armadillo_bits/Mat_meat.hpp @@ -294,7 +294,7 @@ inline void Mat::init_cold() { - arma_debug_sigprint( arma_str::format("n_rows = %u, n_cols = %u") % n_rows % n_cols ); + arma_debug_sigprint( arma_str::format("n_rows: %u; n_cols: %u") % n_rows % n_cols ); // ensure that n_elem can hold the result of (n_rows * n_cols) @@ -337,7 +337,7 @@ inline void Mat::init_warm(uword in_n_rows, uword in_n_cols) { - arma_debug_sigprint( arma_str::format("in_n_rows = %u, in_n_cols = %u") % in_n_rows % in_n_cols ); + arma_debug_sigprint( arma_str::format("in_n_rows: %u; in_n_cols: %u") % in_n_rows % in_n_cols ); if( (n_rows == in_n_rows) && (n_cols == in_n_cols) ) { return; } diff --git a/include/armadillo_bits/config.hpp b/include/armadillo_bits/config.hpp index 9cba2fa5..93b25ef9 100644 --- a/include/armadillo_bits/config.hpp +++ b/include/armadillo_bits/config.hpp @@ -201,7 +201,13 @@ //// 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_DEBUG) || defined(ARMA_EXTRA_DEBUG) +#if defined(ARMA_EXTRA_DEBUG) + // for compatibility with earlier versions of Armadillo + #undef ARMA_DEBUG + #define ARMA_DEBUG +#endif + +#if defined(ARMA_DEBUG) #undef ARMA_DONT_CHECK_CONFORMANCE #undef ARMA_DONT_CHECK_NONFINITE #undef ARMA_WARN_LEVEL diff --git a/include/armadillo_bits/config.hpp.cmake b/include/armadillo_bits/config.hpp.cmake index f1d536a9..a1ad9db1 100644 --- a/include/armadillo_bits/config.hpp.cmake +++ b/include/armadillo_bits/config.hpp.cmake @@ -201,7 +201,13 @@ //// 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_DEBUG) || defined(ARMA_EXTRA_DEBUG) +#if defined(ARMA_EXTRA_DEBUG) + // for compatibility with earlier versions of Armadillo + #undef ARMA_DEBUG + #define ARMA_DEBUG +#endif + +#if defined(ARMA_DEBUG) #undef ARMA_DONT_CHECK_CONFORMANCE #undef ARMA_DONT_CHECK_NONFINITE #undef ARMA_WARN_LEVEL diff --git a/include/armadillo_bits/debug.hpp b/include/armadillo_bits/debug.hpp index f96e2585..299654c2 100644 --- a/include/armadillo_bits/debug.hpp +++ b/include/armadillo_bits/debug.hpp @@ -317,7 +317,7 @@ inline void arma_thisprint(const void* this_ptr) { - get_cerr_stream() << " [this = " << this_ptr << ']' << std::endl; + get_cerr_stream() << " [this: " << this_ptr << ']' << std::endl; } @@ -1369,7 +1369,7 @@ arma_assert_atlas_size(const T1& A, const T2& B) -#if defined(ARMA_DEBUG) || defined(ARMA_EXTRA_DEBUG) +#if defined(ARMA_DEBUG) #define arma_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint #define arma_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_thisprint diff --git a/include/armadillo_bits/field_meat.hpp b/include/armadillo_bits/field_meat.hpp index 0cc4acd7..de75ac2a 100644 --- a/include/armadillo_bits/field_meat.hpp +++ b/include/armadillo_bits/field_meat.hpp @@ -205,7 +205,7 @@ inline field& field::set_size(const uword n_elem_in) { - arma_debug_sigprint(arma_str::format("n_elem_in = %u") % n_elem_in); + arma_debug_sigprint(arma_str::format("n_elem_in: %u") % n_elem_in); init(n_elem_in, 1); @@ -220,7 +220,7 @@ inline field& field::set_size(const uword n_rows_in, const uword n_cols_in) { - arma_debug_sigprint(arma_str::format("n_rows_in = %u, n_cols_in = %u") % n_rows_in % n_cols_in); + arma_debug_sigprint(arma_str::format("n_rows_in: %u; n_cols_in: %u") % n_rows_in % n_cols_in); init(n_rows_in, n_cols_in); @@ -235,7 +235,7 @@ inline field& field::set_size(const uword n_rows_in, const uword n_cols_in, const uword n_slices_in) { - arma_debug_sigprint(arma_str::format("n_rows_in = %u, n_cols_in = %u, n_slices_in = %u") % n_rows_in % n_cols_in % n_slices_in); + arma_debug_sigprint(arma_str::format("n_rows_in: %u; n_cols_in: %u; n_slices_in: %u") % n_rows_in % n_cols_in % n_slices_in); init(n_rows_in, n_cols_in, n_slices_in); @@ -2014,7 +2014,7 @@ inline void field::init(const uword n_rows_in, const uword n_cols_in, const uword n_slices_in) { - arma_debug_sigprint( arma_str::format("n_rows_in = %u, n_cols_in = %u, n_slices_in = %u") % n_rows_in % n_cols_in % n_slices_in ); + arma_debug_sigprint( arma_str::format("n_rows_in: %u; n_cols_in: %u; n_slices_in: %u") % n_rows_in % n_cols_in % n_slices_in ); #if defined(ARMA_64BIT_WORD) const char* error_message = "field::init(): requested size is too large"; @@ -2075,7 +2075,7 @@ inline void field::delete_objects() { - arma_debug_sigprint( arma_str::format("n_elem = %u") % n_elem ); + arma_debug_sigprint( arma_str::format("n_elem: %u") % n_elem ); for(uword i=0; i::create_objects() { - arma_debug_sigprint( arma_str::format("n_elem = %u") % n_elem ); + arma_debug_sigprint( arma_str::format("n_elem: %u") % n_elem ); for(uword i=0; i& X, const typename arma_not_cx >::num; - arma_debug_print(arma_str::format("N_mat = %u") % N_mat); + arma_debug_print(arma_str::format("N_mat: %u") % N_mat); return as_scalar_redirect::apply(X); } diff --git a/include/armadillo_bits/glue_times_meat.hpp b/include/armadillo_bits/glue_times_meat.hpp index 5bf6b5f5..6eed7d39 100644 --- a/include/armadillo_bits/glue_times_meat.hpp +++ b/include/armadillo_bits/glue_times_meat.hpp @@ -483,7 +483,7 @@ glue_times::apply(Mat& out, const Glue constexpr uword N_mat = 1 + depth_lhs< glue_times, Glue >::num; - arma_debug_print(arma_str::format("N_mat = %u") % N_mat); + arma_debug_print(arma_str::format("N_mat: %u") % N_mat); glue_times_redirect::apply(out, X); } diff --git a/include/armadillo_bits/subview_cube_meat.hpp b/include/armadillo_bits/subview_cube_meat.hpp index 7969b3fd..6edd431b 100644 --- a/include/armadillo_bits/subview_cube_meat.hpp +++ b/include/armadillo_bits/subview_cube_meat.hpp @@ -1712,7 +1712,7 @@ subview_cube::extract(Cube& out, const subview_cube& in) const uword n_cols = in.n_cols; const uword n_slices = in.n_slices; - arma_debug_print(arma_str::format("out.n_rows = %u out.n_cols = %u out.n_slices = %u in.m.n_rows = %u in.m.n_cols = %u in.m.n_slices = %u") % out.n_rows % out.n_cols % out.n_slices % in.m.n_rows % in.m.n_cols % in.m.n_slices); + arma_debug_print(arma_str::format("out.n_rows: %u; out.n_cols: %u; out.n_slices: %u; in.m.n_rows: %u; in.m.n_cols: %u; in.m.n_slices: %u") % out.n_rows % out.n_cols % out.n_slices % in.m.n_rows % in.m.n_cols % in.m.n_slices); if( (in.aux_row1 == 0) && (n_rows == in.m.n_rows) ) { diff --git a/include/armadillo_bits/subview_field_meat.hpp b/include/armadillo_bits/subview_field_meat.hpp index 5b427a57..7a402e19 100644 --- a/include/armadillo_bits/subview_field_meat.hpp +++ b/include/armadillo_bits/subview_field_meat.hpp @@ -525,7 +525,7 @@ subview_field::extract(field& actual_out, const subview_field& in) out.set_size(n_rows, n_cols, n_slices); - arma_debug_print(arma_str::format("out.n_rows = %u out.n_cols = %u out.n_slices = %u in.m.n_rows = %u in.m.n_cols = %u in.m.n_slices = %u") % out.n_rows % out.n_cols % out.n_slices % in.f.n_rows % in.f.n_cols % in.f.n_slices); + arma_debug_print(arma_str::format("out.n_rows: %u; out.n_cols: %u; out.n_slices: %u; n.m.n_rows: %u; in.m.n_cols: %u; in.m.n_slices: %u") % out.n_rows % out.n_cols % out.n_slices % in.f.n_rows % in.f.n_cols % in.f.n_slices); if(n_slices == 1) { diff --git a/include/armadillo_bits/subview_meat.hpp b/include/armadillo_bits/subview_meat.hpp index 5079c6b2..6535eb9b 100644 --- a/include/armadillo_bits/subview_meat.hpp +++ b/include/armadillo_bits/subview_meat.hpp @@ -1600,7 +1600,7 @@ subview::extract(Mat& out, const subview& in) const uword n_rows = in.n_rows; // number of rows in the subview const uword n_cols = in.n_cols; // number of columns in the subview - arma_debug_print(arma_str::format("out.n_rows = %u out.n_cols = %u in.m.n_rows = %u in.m.n_cols = %u") % out.n_rows % out.n_cols % in.m.n_rows % in.m.n_cols ); + arma_debug_print(arma_str::format("out.n_rows: %u; out.n_cols: %u; in.m.n_rows: %u; in.m.n_cols: %u") % out.n_rows % out.n_cols % in.m.n_rows % in.m.n_cols ); if(in.is_vec())