diff --git a/include/armadillo_bits/Cube_meat.hpp b/include/armadillo_bits/Cube_meat.hpp index e8075085..a136306f 100644 --- a/include/armadillo_bits/Cube_meat.hpp +++ b/include/armadillo_bits/Cube_meat.hpp @@ -483,7 +483,7 @@ Cube::init eT* out_mem = (*this).memptr(); - const bool use_at = ( ProxyCube::use_at || ProxyCube::use_at ); + constexpr bool use_at = ( ProxyCube::use_at || ProxyCube::use_at ); if(use_at == false) { diff --git a/include/armadillo_bits/Mat_meat.hpp b/include/armadillo_bits/Mat_meat.hpp index 44df5fb6..3db9bcd8 100644 --- a/include/armadillo_bits/Mat_meat.hpp +++ b/include/armadillo_bits/Mat_meat.hpp @@ -1022,7 +1022,7 @@ Mat::init eT* out_mem = (*this).memptr(); - const bool use_at = ( Proxy::use_at || Proxy::use_at ); + constexpr bool use_at = ( Proxy::use_at || Proxy::use_at ); if(use_at == false) { diff --git a/include/armadillo_bits/glue_atan2_meat.hpp b/include/armadillo_bits/glue_atan2_meat.hpp index 8becff00..9408e0e4 100644 --- a/include/armadillo_bits/glue_atan2_meat.hpp +++ b/include/armadillo_bits/glue_atan2_meat.hpp @@ -70,8 +70,8 @@ glue_atan2::apply_noalias(Mat& out, const Proxy& P1, eT* out_mem = out.memptr(); - const bool use_mp = arma_config::openmp && mp_gate::use_mp || Proxy::use_mp)>::eval(n_elem); - const bool use_at = Proxy::use_at || Proxy::use_at; + const bool use_mp = arma_config::openmp && mp_gate::use_mp || Proxy::use_mp)>::eval(n_elem); + constexpr bool use_at = Proxy::use_at || Proxy::use_at; if(use_at == false) { @@ -172,8 +172,8 @@ glue_atan2::apply_noalias(Cube& out, const ProxyCube eT* out_mem = out.memptr(); - const bool use_mp = arma_config::openmp && mp_gate::use_mp || ProxyCube::use_mp)>::eval(n_elem); - const bool use_at = ProxyCube::use_at || ProxyCube::use_at; + const bool use_mp = arma_config::openmp && mp_gate::use_mp || ProxyCube::use_mp)>::eval(n_elem); + constexpr bool use_at = ProxyCube::use_at || ProxyCube::use_at; if(use_at == false) { diff --git a/include/armadillo_bits/glue_mixed_meat.hpp b/include/armadillo_bits/glue_mixed_meat.hpp index 03cd5cc3..d7c28df3 100644 --- a/include/armadillo_bits/glue_mixed_meat.hpp +++ b/include/armadillo_bits/glue_mixed_meat.hpp @@ -40,8 +40,8 @@ glue_mixed_times::apply(Mat::eT>& out, const mtGlue< const typename partial_unwrap::stored_type& A = tmp1.M; const typename partial_unwrap::stored_type& B = tmp2.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const out_eT alpha = use_alpha ? (upgrade_val::apply(tmp1.get_val()) * upgrade_val::apply(tmp2.get_val())) : out_eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const out_eT alpha = use_alpha ? (upgrade_val::apply(tmp1.get_val()) * upgrade_val::apply(tmp2.get_val())) : out_eT(0); const bool do_trans_A = partial_unwrap::do_trans; const bool do_trans_B = partial_unwrap::do_trans; @@ -99,7 +99,7 @@ glue_mixed_plus::apply(Mat::eT>& out, const mtGlue::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -164,7 +164,7 @@ glue_mixed_minus::apply(Mat::eT>& out, const mtGlue< out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -229,7 +229,7 @@ glue_mixed_div::apply(Mat::eT>& out, const mtGlue::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -294,7 +294,7 @@ glue_mixed_schur::apply(Mat::eT>& out, const mtGlue< out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { @@ -366,7 +366,7 @@ glue_mixed_plus::apply(Cube::eT>& out, const mtGlueC out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { @@ -421,7 +421,7 @@ glue_mixed_minus::apply(Cube::eT>& out, const mtGlue out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { @@ -476,7 +476,7 @@ glue_mixed_div::apply(Cube::eT>& out, const mtGlueCu out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { @@ -531,7 +531,7 @@ glue_mixed_schur::apply(Cube::eT>& out, const mtGlue out_eT* out_mem = out.memptr(); const uword n_elem = out.n_elem; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); if(use_at == false) { diff --git a/include/armadillo_bits/glue_relational_meat.hpp b/include/armadillo_bits/glue_relational_meat.hpp index 5a62b90d..fcfc4611 100644 --- a/include/armadillo_bits/glue_relational_meat.hpp +++ b/include/armadillo_bits/glue_relational_meat.hpp @@ -47,7 +47,7 @@ \ uword* out_mem = out.memptr();\ \ - const bool use_at = (Proxy::use_at || Proxy::use_at);\ + constexpr bool use_at = (Proxy::use_at || Proxy::use_at);\ \ if(use_at == false)\ {\ @@ -113,7 +113,7 @@ \ uword* out_mem = out.memptr();\ \ - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at);\ + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at);\ \ if(use_at == false)\ {\ diff --git a/include/armadillo_bits/glue_times_meat.hpp b/include/armadillo_bits/glue_times_meat.hpp index 8c43e7ca..73a3dfcc 100644 --- a/include/armadillo_bits/glue_times_meat.hpp +++ b/include/armadillo_bits/glue_times_meat.hpp @@ -37,8 +37,8 @@ glue_times_redirect2_helper::apply(Mat& o const typename partial_unwrap::stored_type& A = tmp1.M; const typename partial_unwrap::stored_type& B = tmp2.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); if( (is_cx::no) && (resolves_to_rowvector::value && resolves_to_colvector::value) ) { @@ -192,8 +192,8 @@ glue_times_redirect3_helper::apply(Mat& o const typename partial_unwrap::stored_type& B = tmp2.M; const typename partial_unwrap::stored_type& C = tmp3.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val()) : eT(0); const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_alias(out); @@ -256,8 +256,8 @@ glue_times_redirect3_helper::apply(Mat& out, const const typename partial_unwrap::stored_type& B = tmp2.M; const typename partial_unwrap::stored_type& C = tmp3.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp2.get_val() * tmp3.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp2.get_val() * tmp3.get_val()) : eT(0); Mat BC; @@ -328,8 +328,8 @@ glue_times_redirect3_helper::apply(Mat& out, const const typename partial_unwrap_check::stored_type& A = tmp1.M; - const bool use_alpha = partial_unwrap_check::do_times; - const eT alpha = use_alpha ? tmp1.get_val() : eT(0); + constexpr bool use_alpha = partial_unwrap_check::do_times; + const eT alpha = use_alpha ? tmp1.get_val() : eT(0); glue_times::apply < @@ -365,8 +365,8 @@ glue_times_redirect::apply(Mat& out, const Glue::stored_type& A = tmp1.M; const typename partial_unwrap::stored_type& B = tmp2.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out); @@ -450,8 +450,8 @@ glue_times_redirect<4>::apply(Mat& out, const Glue< Glue const typename partial_unwrap::stored_type& C = tmp3.M; const typename partial_unwrap::stored_type& D = tmp4.M; - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val() * tmp4.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val() * tmp4.get_val()) : eT(0); const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_alias(out) || tmp4.is_alias(out); @@ -547,12 +547,12 @@ glue_times::apply_inplace_plus(Mat& out, const Glue::do_trans; - const bool do_trans_B = partial_unwrap_check::do_trans; + constexpr bool do_trans_A = partial_unwrap_check::do_trans; + constexpr bool do_trans_B = partial_unwrap_check::do_trans; const bool use_alpha = partial_unwrap_check::do_times || partial_unwrap_check::do_times || (sign < sword(0)); - const eT alpha = use_alpha ? ( tmp1.get_val() * tmp2.get_val() * ( (sign > sword(0)) ? eT(1) : eT(-1) ) ) : eT(0); + const eT alpha = use_alpha ? ( tmp1.get_val() * tmp2.get_val() * ( (sign > sword(0)) ? eT(1) : eT(-1) ) ) : eT(0); arma_conform_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multiplication"); diff --git a/include/armadillo_bits/op_diagmat_meat.hpp b/include/armadillo_bits/op_diagmat_meat.hpp index 785df646..93f865ea 100644 --- a/include/armadillo_bits/op_diagmat_meat.hpp +++ b/include/armadillo_bits/op_diagmat_meat.hpp @@ -183,8 +183,8 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; @@ -409,8 +409,8 @@ op_diagmat::apply_times(Mat& actual_out, const T1& X, co arma_conform_assert_trans_mul_size< partial_unwrap::do_trans, partial_unwrap::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication"); - const bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const uword A_n_rows = A.n_rows; const uword A_n_cols = A.n_cols; diff --git a/include/armadillo_bits/op_diagvec_meat.hpp b/include/armadillo_bits/op_diagvec_meat.hpp index 82875592..5312e55a 100644 --- a/include/armadillo_bits/op_diagvec_meat.hpp +++ b/include/armadillo_bits/op_diagvec_meat.hpp @@ -104,8 +104,8 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const bool is_alias = (UA.is_alias(actual_out) || UB.is_alias(actual_out)); @@ -264,8 +264,8 @@ op_diagvec::apply(Mat& actual_out, const Op< Glue::do_times || partial_unwrap::do_times; - const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); + constexpr bool use_alpha = partial_unwrap::do_times || partial_unwrap::do_times; + const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0); const bool is_alias = (UA.is_alias(actual_out) || UB.is_alias(actual_out)); diff --git a/include/armadillo_bits/op_dot_meat.hpp b/include/armadillo_bits/op_dot_meat.hpp index 4f568ec1..78d53a49 100644 --- a/include/armadillo_bits/op_dot_meat.hpp +++ b/include/armadillo_bits/op_dot_meat.hpp @@ -511,7 +511,7 @@ op_cdot::apply_proxy(const T1& X, const T2& Y) typedef typename Proxy::ea_type ea_type1; typedef typename Proxy::ea_type ea_type2; - const bool use_at = (Proxy::use_at) || (Proxy::use_at); + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); if(use_at == false) {