diff --git a/ChangeLog b/ChangeLog index d70b82e1..a6e12874 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2025-08-08 Dirk Eddelbuettel + + * inst/include/armadillo_bits/: Armadillo 14.6.2 + 2025-07-22 Dirk Eddelbuettel * .github/workflows/ci.yaml: Comment-out coverage diff --git a/inst/include/armadillo_bits/arma_version.hpp b/inst/include/armadillo_bits/arma_version.hpp index bbf9b23b..20950820 100644 --- a/inst/include/armadillo_bits/arma_version.hpp +++ b/inst/include/armadillo_bits/arma_version.hpp @@ -23,7 +23,7 @@ #define ARMA_VERSION_MAJOR 14 #define ARMA_VERSION_MINOR 6 -#define ARMA_VERSION_PATCH 1 +#define ARMA_VERSION_PATCH 2 #define ARMA_VERSION_NAME "Caffe Mocha" diff --git a/inst/include/armadillo_bits/op_omit_meat.hpp b/inst/include/armadillo_bits/op_omit_meat.hpp index 16c6cbaa..06d97f2a 100644 --- a/inst/include/armadillo_bits/op_omit_meat.hpp +++ b/inst/include/armadillo_bits/op_omit_meat.hpp @@ -56,7 +56,7 @@ op_omit::apply(Mat& out, const T1& X, functor is_omitted typedef typename T1::elem_type eT; - if(is_Mat::value || is_subview_col::value || is_Mat::stored_type>::value || Proxy::use_mp) + if(is_Mat::value || is_subview_col::value || is_Mat::stored_type>::value || (arma_config::openmp && Proxy::use_mp)) { const quasi_unwrap U(X); @@ -160,7 +160,7 @@ op_omit_cube::apply(Mat& out, const T1& X, functor is_om typedef typename T1::elem_type eT; - if(is_Cube::value || is_Cube::stored_type>::value || ProxyCube::use_mp) + if(is_Cube::value || is_Cube::stored_type>::value || (arma_config::openmp && ProxyCube::use_mp)) { const unwrap_cube U(X); diff --git a/inst/include/armadillo_bits/op_sum_bones.hpp b/inst/include/armadillo_bits/op_sum_bones.hpp index c580a204..387c9aac 100644 --- a/inst/include/armadillo_bits/op_sum_bones.hpp +++ b/inst/include/armadillo_bits/op_sum_bones.hpp @@ -32,10 +32,13 @@ class op_sum template inline static void apply(Mat& out, const Op< eOp, op_sum >& in); - + template inline static void apply(Mat& out, const Op< eOp, op_sum >& in); - + + template + inline static void apply_generic(Mat& out, const Op& in); + template inline static void apply_mat_noalias(Mat& out, const Mat& X, const uword dim); diff --git a/inst/include/armadillo_bits/op_sum_meat.hpp b/inst/include/armadillo_bits/op_sum_meat.hpp index 7eb044d5..88c74ad9 100644 --- a/inst/include/armadillo_bits/op_sum_meat.hpp +++ b/inst/include/armadillo_bits/op_sum_meat.hpp @@ -28,46 +28,7 @@ op_sum::apply(Mat& out, const Op& in) { arma_debug_sigprint(); - typedef typename T1::elem_type eT; - - const uword dim = in.aux_uword_a; - - arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); - - if((is_Mat::value) || (is_Mat::stored_type>::value) || (arma_config::openmp && Proxy::use_mp)) - { - const quasi_unwrap U(in.m); - - if(U.is_alias(out)) - { - Mat tmp; - - op_sum::apply_mat_noalias(tmp, U.M, dim); - - out.steal_mem(tmp); - } - else - { - op_sum::apply_mat_noalias(out, U.M, dim); - } - } - else - { - const Proxy P(in.m); - - if(P.is_alias(out)) - { - Mat tmp; - - op_sum::apply_proxy_noalias(tmp, P, dim); - - out.steal_mem(tmp); - } - else - { - op_sum::apply_proxy_noalias(out, P, dim); - } - } + op_sum::apply_generic(out, in); } @@ -85,12 +46,12 @@ op_sum::apply(Mat& out, const Op< eOp, op typedef typename inner_expr_type::proxy_type::stored_type inner_expr_P_stored_type; - const uword dim = in.aux_uword_a; - - arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); - if(is_Mat::value) { + const uword dim = in.aux_uword_a; + + arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); + const quasi_unwrap U(in.m.P.Q); if(U.is_alias(out)) @@ -105,42 +66,11 @@ op_sum::apply(Mat& out, const Op< eOp, op { op_sum::apply_mat_square_noalias(out, U.M, dim); } - } - else - if(arma_config::openmp && Proxy::use_mp) - { - const quasi_unwrap U(in.m); // force evaluation of compound inner expression - if(U.is_alias(out)) - { - Mat tmp; - - op_sum::apply_mat_noalias(tmp, U.M, dim); - - out.steal_mem(tmp); - } - else - { - op_sum::apply_mat_noalias(out, U.M, dim); - } - } - else - { - const Proxy P(in.m); - - if(P.is_alias(out)) - { - Mat tmp; - - op_sum::apply_proxy_noalias(tmp, P, dim); - - out.steal_mem(tmp); - } - else - { - op_sum::apply_proxy_noalias(out, P, dim); - } + return; } + + op_sum::apply_generic(out, in); } @@ -172,17 +102,27 @@ op_sum::apply(Mat& out, const Op< eOp, op_su return; } - typedef eOp inner_expr_type; + op_sum::apply_generic(out, in); + } + + + +template +inline +void +op_sum::apply_generic(Mat& out, const Op& in) + { + arma_debug_sigprint(); - typedef typename inner_expr_type::proxy_type::stored_type inner_expr_P_stored_type; + typedef typename T1::elem_type eT; const uword dim = in.aux_uword_a; arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" ); - if( (is_Mat::value) || (arma_config::openmp && Proxy::use_mp) ) + if((is_Mat::value) || (is_Mat::stored_type>::value) || (arma_config::openmp && Proxy::use_mp)) { - const quasi_unwrap U(in.m); // force evaluation of eop_pow + const quasi_unwrap U(in.m); if(U.is_alias(out)) { @@ -199,7 +139,7 @@ op_sum::apply(Mat& out, const Op< eOp, op_su } else { - const Proxy P(in.m); + const Proxy P(in.m); if(P.is_alias(out)) {