diff --git a/include/armadillo_bits/Cube_meat.hpp b/include/armadillo_bits/Cube_meat.hpp index e196df45..9d60858b 100644 --- a/include/armadillo_bits/Cube_meat.hpp +++ b/include/armadillo_bits/Cube_meat.hpp @@ -3467,7 +3467,7 @@ Cube::in_range(const span& x) const { arma_extra_debug_sigprint(); - if(x.whole == true) + if(x.whole) { return true; } @@ -3517,7 +3517,7 @@ Cube::in_range(const span& row_span, const span& col_span, const span& slice const bool slices_ok = slice_span.whole ? true : ( (in_slice1 <= in_slice2) && (in_slice2 < n_slices) ); - return ( (rows_ok == true) && (cols_ok == true) && (slices_ok == true) ); + return ( (rows_ok) && (cols_ok) && (slices_ok) ); } @@ -4346,7 +4346,7 @@ Cube::save(const hdf5_name& spec, const file_type type, const bool print_sta save_okay = diskio::save_hdf5_binary(*this, spec, err_msg); } - if((print_status == true) && (save_okay == false)) + if(print_status) && (save_okay == false)) { if(err_msg.length() > 0) { @@ -4459,7 +4459,7 @@ Cube::load(const std::string name, const file_type type, const bool print_st load_okay = false; } - if( (print_status == true) && (load_okay == false) ) + if( print_status && (load_okay == false) ) { if(err_msg.length() > 0) { @@ -4515,7 +4515,7 @@ Cube::load(const hdf5_name& spec, const file_type type, const bool print_sta } - if( (print_status == true) && (load_okay == false) ) + if( print_status && (load_okay == false) ) { if(err_msg.length() > 0) { @@ -4580,7 +4580,7 @@ Cube::load(std::istream& is, const file_type type, const bool print_status) load_okay = false; } - if( (print_status == true) && (load_okay == false) ) + if( print_status && (load_okay == false) ) { if(err_msg.length() > 0) { diff --git a/include/armadillo_bits/Mat_meat.hpp b/include/armadillo_bits/Mat_meat.hpp index 2fd9b1fa..7d61a566 100644 --- a/include/armadillo_bits/Mat_meat.hpp +++ b/include/armadillo_bits/Mat_meat.hpp @@ -7401,7 +7401,7 @@ Mat::save(const hdf5_name& spec, const file_type type, const bool print_stat save_okay = diskio::save_hdf5_binary(*this, spec, err_msg); } - if((print_status == true) && (save_okay == false)) + if(print_status && (save_okay == false)) { if(err_msg.length() > 0) { @@ -7485,7 +7485,7 @@ Mat::save(const csv_name& spec, const file_type type, const bool print_statu save_okay = diskio::save_csv_ascii(*this, spec.filename, spec.header_ro, with_header); } - if((print_status == true) && (save_okay == false)) + if(print_status && (save_okay == false)) { arma_debug_warn("Mat::save(): couldn't write to ", spec.filename); } @@ -7599,7 +7599,7 @@ Mat::load(const std::string name, const file_type type, const bool print_sta load_okay = false; } - if( (print_status == true) && (load_okay == false) ) + if( print_status && (load_okay == false) ) { if(err_msg.length() > 0) { @@ -7655,7 +7655,7 @@ Mat::load(const hdf5_name& spec, const file_type type, const bool print_stat } - if( (print_status == true) && (load_okay == false) ) + if( print_status && (load_okay == false) ) { if(err_msg.length() > 0) { @@ -7811,7 +7811,7 @@ Mat::load(std::istream& is, const file_type type, const bool print_status) load_okay = false; } - if( (print_status == true) && (load_okay == false) ) + if( print_status && (load_okay == false) ) { if(err_msg.length() > 0) { diff --git a/include/armadillo_bits/SpMat_meat.hpp b/include/armadillo_bits/SpMat_meat.hpp index 5100a90c..5115ef47 100644 --- a/include/armadillo_bits/SpMat_meat.hpp +++ b/include/armadillo_bits/SpMat_meat.hpp @@ -3611,7 +3611,7 @@ SpMat::in_range(const span& x) const { arma_extra_debug_sigprint(); - if(x.whole == true) + if(x.whole) { return true; } @@ -3646,7 +3646,7 @@ SpMat::in_range(const span& row_span, const uword in_col) const { arma_extra_debug_sigprint(); - if(row_span.whole == true) + if(row_span.whole) { return (in_col < n_cols); } @@ -3669,7 +3669,7 @@ SpMat::in_range(const uword in_row, const span& col_span) const { arma_extra_debug_sigprint(); - if(col_span.whole == true) + if(col_span.whole) { return (in_row < n_rows); } @@ -3701,7 +3701,7 @@ SpMat::in_range(const span& row_span, const span& col_span) const const bool rows_ok = row_span.whole ? true : ( (in_row1 <= in_row2) && (in_row2 < n_rows) ); const bool cols_ok = col_span.whole ? true : ( (in_col1 <= in_col2) && (in_col2 < n_cols) ); - return ( (rows_ok == true) && (cols_ok == true) ); + return ( (rows_ok) && (cols_ok) ); } @@ -4626,7 +4626,7 @@ SpMat::save(const csv_name& spec, const file_type type, const bool print_sta save_okay = diskio::save_csv_ascii(*this, spec.filename, spec.header_ro, with_header); } - if((print_status == true) && (save_okay == false)) + if((print_status) && (save_okay == false)) { arma_debug_warn("SpMat::save(): couldn't write to ", spec.filename); } @@ -4785,7 +4785,7 @@ SpMat::load(const csv_name& spec, const file_type type, const bool print_sta load_okay = diskio::load_csv_ascii(*this, spec.filename, err_msg, spec.header_rw, with_header); } - if(print_status == true) + if(print_status) { if(load_okay == false) { @@ -5798,7 +5798,7 @@ SpMat::init_xform_mt(const SpBase& A, const Functor& func) const SpProxy P(A.get_ref()); - if( (P.is_alias(*this) == true) || (is_SpMat::stored_type>::value == true) ) + if( P.is_alias(*this) || (is_SpMat::stored_type>::value) ) { // NOTE: unwrap_spmat will convert a submatrix to a matrix, which in effect takes care of aliasing with submatrices; // NOTE: however, when more delayed ops are implemented, more elaborate handling of aliasing will be necessary diff --git a/include/armadillo_bits/auxlib_meat.hpp b/include/armadillo_bits/auxlib_meat.hpp index ba158873..fbe37991 100644 --- a/include/armadillo_bits/auxlib_meat.hpp +++ b/include/armadillo_bits/auxlib_meat.hpp @@ -761,7 +761,7 @@ auxlib::lu(Mat& L, Mat& U, podarray& ipiv, const Base& L.at(row,col) = eT(0); } - if( L.in_range(col,col) == true ) + if( L.in_range(col,col) ) { L.at(col,col) = eT(1); } diff --git a/include/armadillo_bits/field_meat.hpp b/include/armadillo_bits/field_meat.hpp index 37fe229c..8963925d 100644 --- a/include/armadillo_bits/field_meat.hpp +++ b/include/armadillo_bits/field_meat.hpp @@ -1525,7 +1525,7 @@ field::in_range(const span& x) const { arma_extra_debug_sigprint(); - if(x.whole == true) + if(x.whole) { return true; } @@ -1560,7 +1560,7 @@ field::in_range(const span& row_span, const uword in_col) const { arma_extra_debug_sigprint(); - if(row_span.whole == true) + if(row_span.whole) { return (in_col < n_cols); } @@ -1583,7 +1583,7 @@ field::in_range(const uword in_row, const span& col_span) const { arma_extra_debug_sigprint(); - if(col_span.whole == true) + if(col_span.whole) { return (in_row < n_rows); } @@ -1615,7 +1615,7 @@ field::in_range(const span& row_span, const span& col_span) const const bool rows_ok = row_span.whole ? true : ( (in_row1 <= in_row2) && (in_row2 < n_rows) ); const bool cols_ok = col_span.whole ? true : ( (in_col1 <= in_col2) && (in_col2 < n_cols) ); - return ( (rows_ok == true) && (cols_ok == true) ); + return ( (rows_ok) && (cols_ok) ); } @@ -1673,7 +1673,7 @@ field::in_range(const span& row_span, const span& col_span, const span& slic const bool cols_ok = col_span.whole ? true : ( (in_col1 <= in_col2 ) && (in_col2 < n_cols ) ); const bool slices_ok = slice_span.whole ? true : ( (in_slice1 <= in_slice2) && (in_slice2 < n_slices) ); - return ( (rows_ok == true) && (cols_ok == true) && (slices_ok == true) ); + return ( (rows_ok) && (cols_ok) && (slices_ok) ); } @@ -1711,7 +1711,7 @@ field::save(const std::string name, const file_type type, const bool print_s std::string err_msg; const bool save_okay = field_aux::save(*this, name, type, err_msg); - if( (print_status == true) && (save_okay == false) ) + if( (print_status) && (save_okay == false) ) { if(err_msg.length() > 0) { @@ -1739,7 +1739,7 @@ field::save(std::ostream& os, const file_type type, const bool print_status) std::string err_msg; const bool save_okay = field_aux::save(*this, os, type, err_msg); - if( (print_status == true) && (save_okay == false) ) + if( (print_status) && (save_okay == false) ) { if(err_msg.length() > 0) { @@ -1767,7 +1767,7 @@ field::load(const std::string name, const file_type type, const bool print_s std::string err_msg; const bool load_okay = field_aux::load(*this, name, type, err_msg); - if( (print_status == true) && (load_okay == false) ) + if( (print_status) && (load_okay == false) ) { if(err_msg.length() > 0) { @@ -1800,7 +1800,7 @@ field::load(std::istream& is, const file_type type, const bool print_status) std::string err_msg; const bool load_okay = field_aux::load(*this, is, type, err_msg); - if( (print_status == true) && (load_okay == false) ) + if( (print_status) && (load_okay == false) ) { if(err_msg.length() > 0) { diff --git a/include/armadillo_bits/fn_misc.hpp b/include/armadillo_bits/fn_misc.hpp index 4a6eb08b..8a38449f 100644 --- a/include/armadillo_bits/fn_misc.hpp +++ b/include/armadillo_bits/fn_misc.hpp @@ -57,7 +57,7 @@ linspace const uword num_m1 = num - 1; - if(is_non_integral::value == true) + if(is_non_integral::value) { const T delta = (end-start)/T(num_m1); diff --git a/include/armadillo_bits/fn_sort_index.hpp b/include/armadillo_bits/fn_sort_index.hpp index a3d32aad..add391fb 100644 --- a/include/armadillo_bits/fn_sort_index.hpp +++ b/include/armadillo_bits/fn_sort_index.hpp @@ -41,7 +41,7 @@ inline typename enable_if2 < - ( (is_arma_type::value == true) && (is_same_type::value == true) ), + ( (is_arma_type::value) && (is_same_type::value) ), const mtOp >::result sort_index @@ -87,7 +87,7 @@ inline typename enable_if2 < - ( (is_arma_type::value == true) && (is_same_type::value == true) ), + ( (is_arma_type::value) && (is_same_type::value) ), const mtOp >::result stable_sort_index diff --git a/include/armadillo_bits/fn_strans.hpp b/include/armadillo_bits/fn_strans.hpp index 6d5fe9ef..eb3da68f 100644 --- a/include/armadillo_bits/fn_strans.hpp +++ b/include/armadillo_bits/fn_strans.hpp @@ -26,8 +26,8 @@ const Op strans ( const T1& X, - const typename enable_if< is_arma_type::value == true >::result* junk1 = nullptr, - const typename arma_cx_only::result* junk2 = nullptr + const typename enable_if< is_arma_type::value >::result* junk1 = nullptr, + const typename arma_cx_only::result* junk2 = nullptr ) { arma_extra_debug_sigprint(); @@ -48,8 +48,8 @@ const Op strans ( const T1& X, - const typename enable_if< is_arma_type::value == true >::result* junk1 = nullptr, - const typename arma_not_cx::result* junk2 = nullptr + const typename enable_if< is_arma_type::value >::result* junk1 = nullptr, + const typename arma_not_cx::result* junk2 = nullptr ) { arma_extra_debug_sigprint(); @@ -72,8 +72,8 @@ const SpOp strans ( const T1& X, - const typename enable_if< is_arma_sparse_type::value == true >::result* junk1 = nullptr, - const typename arma_cx_only::result* junk2 = nullptr + const typename enable_if< is_arma_sparse_type::value >::result* junk1 = nullptr, + const typename arma_cx_only::result* junk2 = nullptr ) { arma_extra_debug_sigprint(); @@ -92,8 +92,8 @@ const SpOp strans ( const T1& X, - const typename enable_if< is_arma_sparse_type::value == true >::result* junk1 = nullptr, - const typename arma_not_cx::result* junk2 = nullptr + const typename enable_if< is_arma_sparse_type::value >::result* junk1 = nullptr, + const typename arma_not_cx::result* junk2 = nullptr ) { arma_extra_debug_sigprint(); diff --git a/include/armadillo_bits/fn_trans.hpp b/include/armadillo_bits/fn_trans.hpp index ca4cc575..a24bdb07 100644 --- a/include/armadillo_bits/fn_trans.hpp +++ b/include/armadillo_bits/fn_trans.hpp @@ -25,7 +25,7 @@ const Op trans ( const T1& X, - const typename enable_if< is_arma_type::value == true >::result* junk = nullptr + const typename enable_if< is_arma_type::value >::result* junk = nullptr ) { arma_extra_debug_sigprint(); @@ -43,7 +43,7 @@ const Op htrans ( const T1& X, - const typename enable_if< is_arma_type::value == true >::result* junk = nullptr + const typename enable_if< is_arma_type::value >::result* junk = nullptr ) { arma_extra_debug_sigprint(); @@ -65,7 +65,7 @@ const SpOp trans ( const T1& X, - const typename enable_if< is_arma_sparse_type::value == true >::result* junk = nullptr + const typename enable_if< is_arma_sparse_type::value >::result* junk = nullptr ) { arma_extra_debug_sigprint(); @@ -83,7 +83,7 @@ const SpOp htrans ( const T1& X, - const typename enable_if< is_arma_sparse_type::value == true >::result* junk = nullptr + const typename enable_if< is_arma_sparse_type::value >::result* junk = nullptr ) { arma_extra_debug_sigprint(); diff --git a/include/armadillo_bits/fn_zeros.hpp b/include/armadillo_bits/fn_zeros.hpp index 41fe1a7d..38427282 100644 --- a/include/armadillo_bits/fn_zeros.hpp +++ b/include/armadillo_bits/fn_zeros.hpp @@ -176,12 +176,12 @@ zeros(const uword n_rows, const uword n_cols, const typename arma_SpMat_SpCol_Sp arma_extra_debug_sigprint(); arma_ignore(junk); - if(is_SpCol::value == true) + if(is_SpCol::value) { arma_debug_check( (n_cols != 1), "zeros(): incompatible size" ); } else - if(is_SpRow::value == true) + if(is_SpRow::value) { arma_debug_check( (n_rows != 1), "zeros(): incompatible size" ); } diff --git a/include/armadillo_bits/injector_meat.hpp b/include/armadillo_bits/injector_meat.hpp index 9946d77c..221d8a51 100644 --- a/include/armadillo_bits/injector_meat.hpp +++ b/include/armadillo_bits/injector_meat.hpp @@ -151,7 +151,7 @@ mat_injector::~mat_injector() const uword max_n_rows = ((*(A[n_rows-1])).n_cols == 0) ? n_rows-1 : n_rows; - if(is_Mat_only::value == true) + if(is_Mat_only::value) { X.set_size(max_n_rows, max_n_cols); @@ -171,7 +171,7 @@ mat_injector::~mat_injector() } } else - if(is_Row::value == true) + if(is_Row::value) { arma_debug_check( (max_n_rows > 1), "matrix initialisation: incompatible dimensions" ); @@ -182,7 +182,7 @@ mat_injector::~mat_injector() arrayops::copy( X.memptr(), (*(A[0])).A.memptr(), n_cols ); } else - if(is_Col::value == true) + if(is_Col::value) { const bool is_vec = ( (max_n_rows == 1) || (max_n_cols == 1) ); diff --git a/include/armadillo_bits/op_dot_meat.hpp b/include/armadillo_bits/op_dot_meat.hpp index 0fc7c026..8e8a6bd7 100644 --- a/include/armadillo_bits/op_dot_meat.hpp +++ b/include/armadillo_bits/op_dot_meat.hpp @@ -474,7 +474,7 @@ op_cdot::apply(const T1& X, const T2& Y) { arma_extra_debug_sigprint(); - if( (is_Mat::value == true) && (is_Mat::value == true) ) + if( (is_Mat::value) && (is_Mat::value) ) { return op_cdot::apply_unwrap(X,Y); } diff --git a/include/armadillo_bits/op_fft_meat.hpp b/include/armadillo_bits/op_fft_meat.hpp index ed69f2ea..94139241 100644 --- a/include/armadillo_bits/op_fft_meat.hpp +++ b/include/armadillo_bits/op_fft_meat.hpp @@ -267,7 +267,7 @@ op_fft_cx::apply_noalias(Mat& out, const Proxy& P, c // correct the scaling for the inverse transform - if(inverse == true) + if(inverse) { typedef typename get_pod_type::result T; @@ -291,7 +291,7 @@ op_fft_cx::copy_vec(typename Proxy::elem_type* dest, const Proxy& P, con { arma_extra_debug_sigprint(); - if(is_Mat< typename Proxy::stored_type >::value == true) + if(is_Mat< typename Proxy::stored_type >::value) { op_fft_cx::copy_vec_unwrap(dest, P, N); } diff --git a/include/armadillo_bits/op_median_meat.hpp b/include/armadillo_bits/op_median_meat.hpp index c51a2a3d..a69d26f8 100644 --- a/include/armadillo_bits/op_median_meat.hpp +++ b/include/armadillo_bits/op_median_meat.hpp @@ -41,7 +41,7 @@ op_median::apply(Mat& out, const Op& in) const bool is_alias = P.is_alias(out); - if( (is_Mat::value == true) || is_alias ) + if( (is_Mat::value) || is_alias ) { const unwrap_check tmp(P.Q, is_alias); @@ -242,7 +242,7 @@ op_median::median_vec std::vector tmp_vec(n_elem); - if(is_Mat::value == true) + if(is_Mat::value) { const unwrap tmp(P.Q); diff --git a/include/armadillo_bits/op_toeplitz_meat.hpp b/include/armadillo_bits/op_toeplitz_meat.hpp index aed91b2a..086cd93e 100644 --- a/include/armadillo_bits/op_toeplitz_meat.hpp +++ b/include/armadillo_bits/op_toeplitz_meat.hpp @@ -73,7 +73,7 @@ op_toeplitz_c::apply(Mat& out, const Op& out, const Proxy& if(n_cols == 1) { - if(is_Mat::stored_type>::value == true) + if(is_Mat::stored_type>::value) { const unwrap::stored_type> tmp(P.Q); @@ -365,7 +365,7 @@ op_vectorise_cube_col::apply_proxy(Mat& out, const Proxy out.set_size(N, 1); - if(is_Cube::stored_type>::value == true) + if(is_Cube::stored_type>::value) { const unwrap_cube::stored_type> tmp(P.Q); diff --git a/include/armadillo_bits/subview_meat.hpp b/include/armadillo_bits/subview_meat.hpp index 75b26ddf..5c06571a 100644 --- a/include/armadillo_bits/subview_meat.hpp +++ b/include/armadillo_bits/subview_meat.hpp @@ -1520,7 +1520,7 @@ subview::extract(Mat& out, const subview& in) arma_extra_debug_print(arma_str::format("out.n_rows = %d out.n_cols = %d in.m.n_rows = %d in.m.n_cols = %d") % out.n_rows % out.n_cols % in.m.n_rows % in.m.n_cols ); - if(in.is_vec() == true) + if(in.is_vec()) { if(n_cols == 1) // a column vector {