use 'constexpr bool' where possible
This commit is contained in:
@@ -483,7 +483,7 @@ Cube<eT>::init
|
||||
|
||||
eT* out_mem = (*this).memptr();
|
||||
|
||||
const bool use_at = ( ProxyCube<T1>::use_at || ProxyCube<T2>::use_at );
|
||||
constexpr bool use_at = ( ProxyCube<T1>::use_at || ProxyCube<T2>::use_at );
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
|
||||
@@ -1022,7 +1022,7 @@ Mat<eT>::init
|
||||
|
||||
eT* out_mem = (*this).memptr();
|
||||
|
||||
const bool use_at = ( Proxy<T1>::use_at || Proxy<T2>::use_at );
|
||||
constexpr bool use_at = ( Proxy<T1>::use_at || Proxy<T2>::use_at );
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
|
||||
@@ -70,8 +70,8 @@ glue_atan2::apply_noalias(Mat<typename T1::elem_type>& out, const Proxy<T1>& P1,
|
||||
|
||||
eT* out_mem = out.memptr();
|
||||
|
||||
const bool use_mp = arma_config::openmp && mp_gate<eT, (Proxy<T1>::use_mp || Proxy<T2>::use_mp)>::eval(n_elem);
|
||||
const bool use_at = Proxy<T1>::use_at || Proxy<T2>::use_at;
|
||||
const bool use_mp = arma_config::openmp && mp_gate<eT, (Proxy<T1>::use_mp || Proxy<T2>::use_mp)>::eval(n_elem);
|
||||
constexpr bool use_at = Proxy<T1>::use_at || Proxy<T2>::use_at;
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -172,8 +172,8 @@ glue_atan2::apply_noalias(Cube<typename T1::elem_type>& out, const ProxyCube<T1>
|
||||
|
||||
eT* out_mem = out.memptr();
|
||||
|
||||
const bool use_mp = arma_config::openmp && mp_gate<eT, (ProxyCube<T1>::use_mp || ProxyCube<T2>::use_mp)>::eval(n_elem);
|
||||
const bool use_at = ProxyCube<T1>::use_at || ProxyCube<T2>::use_at;
|
||||
const bool use_mp = arma_config::openmp && mp_gate<eT, (ProxyCube<T1>::use_mp || ProxyCube<T2>::use_mp)>::eval(n_elem);
|
||||
constexpr bool use_at = ProxyCube<T1>::use_at || ProxyCube<T2>::use_at;
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ glue_mixed_times::apply(Mat<typename eT_promoter<T1,T2>::eT>& out, const mtGlue<
|
||||
const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
|
||||
const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const out_eT alpha = use_alpha ? (upgrade_val<in_eT1,in_eT2>::apply(tmp1.get_val()) * upgrade_val<in_eT1,in_eT2>::apply(tmp2.get_val())) : out_eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const out_eT alpha = use_alpha ? (upgrade_val<in_eT1,in_eT2>::apply(tmp1.get_val()) * upgrade_val<in_eT1,in_eT2>::apply(tmp2.get_val())) : out_eT(0);
|
||||
|
||||
const bool do_trans_A = partial_unwrap<T1>::do_trans;
|
||||
const bool do_trans_B = partial_unwrap<T2>::do_trans;
|
||||
@@ -99,7 +99,7 @@ glue_mixed_plus::apply(Mat<typename eT_promoter<T1,T2>::eT>& out, const mtGlue<t
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
constexpr bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ glue_mixed_minus::apply(Mat<typename eT_promoter<T1,T2>::eT>& out, const mtGlue<
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
constexpr bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ glue_mixed_div::apply(Mat<typename eT_promoter<T1,T2>::eT>& out, const mtGlue<ty
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
constexpr bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -294,7 +294,7 @@ glue_mixed_schur::apply(Mat<typename eT_promoter<T1,T2>::eT>& out, const mtGlue<
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
constexpr bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -366,7 +366,7 @@ glue_mixed_plus::apply(Cube<typename eT_promoter<T1,T2>::eT>& out, const mtGlueC
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
constexpr bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -421,7 +421,7 @@ glue_mixed_minus::apply(Cube<typename eT_promoter<T1,T2>::eT>& out, const mtGlue
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
constexpr bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -476,7 +476,7 @@ glue_mixed_div::apply(Cube<typename eT_promoter<T1,T2>::eT>& out, const mtGlueCu
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
constexpr bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
@@ -531,7 +531,7 @@ glue_mixed_schur::apply(Cube<typename eT_promoter<T1,T2>::eT>& out, const mtGlue
|
||||
out_eT* out_mem = out.memptr();
|
||||
const uword n_elem = out.n_elem;
|
||||
|
||||
const bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
constexpr bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
\
|
||||
uword* out_mem = out.memptr();\
|
||||
\
|
||||
const bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);\
|
||||
constexpr bool use_at = (Proxy<T1>::use_at || Proxy<T2>::use_at);\
|
||||
\
|
||||
if(use_at == false)\
|
||||
{\
|
||||
@@ -113,7 +113,7 @@
|
||||
\
|
||||
uword* out_mem = out.memptr();\
|
||||
\
|
||||
const bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);\
|
||||
constexpr bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at);\
|
||||
\
|
||||
if(use_at == false)\
|
||||
{\
|
||||
|
||||
@@ -37,8 +37,8 @@ glue_times_redirect2_helper<do_inv_detect>::apply(Mat<typename T1::elem_type>& o
|
||||
const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
|
||||
const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0);
|
||||
|
||||
if( (is_cx<eT>::no) && (resolves_to_rowvector<T1>::value && resolves_to_colvector<T2>::value) )
|
||||
{
|
||||
@@ -192,8 +192,8 @@ glue_times_redirect3_helper<do_inv_detect>::apply(Mat<typename T1::elem_type>& o
|
||||
const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
|
||||
const typename partial_unwrap<T3>::stored_type& C = tmp3.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || partial_unwrap<T3>::do_times;
|
||||
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp3.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || partial_unwrap<T3>::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<true>::apply(Mat<typename T1::elem_type>& out, const
|
||||
const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
|
||||
const typename partial_unwrap<T3>::stored_type& C = tmp3.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap<T2>::do_times || partial_unwrap<T3>::do_times;
|
||||
const eT alpha = use_alpha ? (tmp2.get_val() * tmp3.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T2>::do_times || partial_unwrap<T3>::do_times;
|
||||
const eT alpha = use_alpha ? (tmp2.get_val() * tmp3.get_val()) : eT(0);
|
||||
|
||||
Mat<eT> BC;
|
||||
|
||||
@@ -328,8 +328,8 @@ glue_times_redirect3_helper<true>::apply(Mat<typename T1::elem_type>& out, const
|
||||
|
||||
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap_check<T1>::do_times;
|
||||
const eT alpha = use_alpha ? tmp1.get_val() : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap_check<T1>::do_times;
|
||||
const eT alpha = use_alpha ? tmp1.get_val() : eT(0);
|
||||
|
||||
glue_times::apply
|
||||
<
|
||||
@@ -365,8 +365,8 @@ glue_times_redirect<N>::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2
|
||||
const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
|
||||
const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::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<typename T1::elem_type>& out, const Glue< Glue
|
||||
const typename partial_unwrap<T3>::stored_type& C = tmp3.M;
|
||||
const typename partial_unwrap<T4>::stored_type& D = tmp4.M;
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || partial_unwrap<T3>::do_times || partial_unwrap<T4>::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<T1>::do_times || partial_unwrap<T2>::do_times || partial_unwrap<T3>::do_times || partial_unwrap<T4>::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<typename T1::elem_type>& out, const Glue<T1,
|
||||
const TA& A = tmp1.M;
|
||||
const TB& B = tmp2.M;
|
||||
|
||||
const bool do_trans_A = partial_unwrap_check<T1>::do_trans;
|
||||
const bool do_trans_B = partial_unwrap_check<T2>::do_trans;
|
||||
constexpr bool do_trans_A = partial_unwrap_check<T1>::do_trans;
|
||||
constexpr bool do_trans_B = partial_unwrap_check<T2>::do_trans;
|
||||
|
||||
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::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");
|
||||
|
||||
|
||||
@@ -183,8 +183,8 @@ op_diagmat::apply_times(Mat<typename T1::elem_type>& actual_out, const T1& X, co
|
||||
|
||||
arma_conform_assert_trans_mul_size< partial_unwrap<T1>::do_trans, partial_unwrap<T2>::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication");
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::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<typename T1::elem_type>& actual_out, const T1& X, co
|
||||
|
||||
arma_conform_assert_trans_mul_size< partial_unwrap<T1>::do_trans, partial_unwrap<T2>::do_trans >(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "matrix multiplication");
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::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;
|
||||
|
||||
@@ -104,8 +104,8 @@ op_diagvec::apply(Mat<typename T1::elem_type>& actual_out, const Op< Glue<T1,T2,
|
||||
|
||||
if( (A.n_elem == 0) || (B.n_elem == 0) ) { actual_out.reset(); return; }
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::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<typename T1::elem_type>& actual_out, const Op< Glue<T1,T2,
|
||||
|
||||
if( (A.n_elem == 0) || (B.n_elem == 0) ) { actual_out.reset(); return; }
|
||||
|
||||
const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
|
||||
const eT alpha = use_alpha ? (UA.get_val() * UB.get_val()) : eT(0);
|
||||
constexpr bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::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));
|
||||
|
||||
|
||||
@@ -511,7 +511,7 @@ op_cdot::apply_proxy(const T1& X, const T2& Y)
|
||||
typedef typename Proxy<T1>::ea_type ea_type1;
|
||||
typedef typename Proxy<T2>::ea_type ea_type2;
|
||||
|
||||
const bool use_at = (Proxy<T1>::use_at) || (Proxy<T2>::use_at);
|
||||
constexpr bool use_at = (Proxy<T1>::use_at) || (Proxy<T2>::use_at);
|
||||
|
||||
if(use_at == false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user