From 72afefcd220838ea41f67aba2d9b84d6969d3fd2 Mon Sep 17 00:00:00 2001 From: conrad Date: Mon, 2 May 2022 15:59:09 +1000 Subject: [PATCH] use constexpr --- include/armadillo_bits/eglue_core_meat.hpp | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/include/armadillo_bits/eglue_core_meat.hpp b/include/armadillo_bits/eglue_core_meat.hpp index 8e21bf03..1978ecba 100644 --- a/include/armadillo_bits/eglue_core_meat.hpp +++ b/include/armadillo_bits/eglue_core_meat.hpp @@ -264,8 +264,8 @@ eglue_core::apply(outT& out, const eGlue& x) typedef typename T1::elem_type eT; - const bool use_at = (Proxy::use_at || Proxy::use_at); - const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); // NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Mat contructor or operator=() @@ -371,8 +371,8 @@ eglue_core::apply_inplace_plus(Mat& out, con eT* out_mem = out.memptr(); - const bool use_at = (Proxy::use_at || Proxy::use_at); - const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -469,8 +469,8 @@ eglue_core::apply_inplace_minus(Mat& out, co eT* out_mem = out.memptr(); - const bool use_at = (Proxy::use_at || Proxy::use_at); - const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -567,8 +567,8 @@ eglue_core::apply_inplace_schur(Mat& out, co eT* out_mem = out.memptr(); - const bool use_at = (Proxy::use_at || Proxy::use_at); - const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -665,8 +665,8 @@ eglue_core::apply_inplace_div(Mat& out, cons eT* out_mem = out.memptr(); - const bool use_at = (Proxy::use_at || Proxy::use_at); - const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -761,8 +761,8 @@ eglue_core::apply(Cube& out, const eGlueCube typedef typename T1::elem_type eT; - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); - const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); // NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Cube contructor or operator=() @@ -870,8 +870,8 @@ eglue_core::apply_inplace_plus(Cube& out, co eT* out_mem = out.memptr(); - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); - const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -969,8 +969,8 @@ eglue_core::apply_inplace_minus(Cube& out, c eT* out_mem = out.memptr(); - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); - const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -1068,8 +1068,8 @@ eglue_core::apply_inplace_schur(Cube& out, c eT* out_mem = out.memptr(); - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); - const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); if(use_at == false) { @@ -1167,8 +1167,8 @@ eglue_core::apply_inplace_div(Cube& out, con eT* out_mem = out.memptr(); - const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); - const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); + constexpr bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + constexpr bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::openmp); if(use_at == false) {