Skip to content

Commit 789afff

Browse files
authored
Merge pull request #470 from RcppCore/feature/14.6.2
Armadillo 14.6.2
2 parents 3b64a30 + 7913075 commit 789afff

File tree

5 files changed

+35
-88
lines changed

5 files changed

+35
-88
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-08-08 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/armadillo_bits/: Armadillo 14.6.2
4+
15
2025-07-22 Dirk Eddelbuettel <[email protected]>
26

37
* .github/workflows/ci.yaml: Comment-out coverage

inst/include/armadillo_bits/arma_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#define ARMA_VERSION_MAJOR 14
2525
#define ARMA_VERSION_MINOR 6
26-
#define ARMA_VERSION_PATCH 1
26+
#define ARMA_VERSION_PATCH 2
2727
#define ARMA_VERSION_NAME "Caffe Mocha"
2828

2929

inst/include/armadillo_bits/op_omit_meat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ op_omit::apply(Mat<typename T1::elem_type>& out, const T1& X, functor is_omitted
5656

5757
typedef typename T1::elem_type eT;
5858

59-
if(is_Mat<T1>::value || is_subview_col<T1>::value || is_Mat<typename Proxy<T1>::stored_type>::value || Proxy<T1>::use_mp)
59+
if(is_Mat<T1>::value || is_subview_col<T1>::value || is_Mat<typename Proxy<T1>::stored_type>::value || (arma_config::openmp && Proxy<T1>::use_mp))
6060
{
6161
const quasi_unwrap<T1> U(X);
6262

@@ -160,7 +160,7 @@ op_omit_cube::apply(Mat<typename T1::elem_type>& out, const T1& X, functor is_om
160160

161161
typedef typename T1::elem_type eT;
162162

163-
if(is_Cube<T1>::value || is_Cube<typename ProxyCube<T1>::stored_type>::value || ProxyCube<T1>::use_mp)
163+
if(is_Cube<T1>::value || is_Cube<typename ProxyCube<T1>::stored_type>::value || (arma_config::openmp && ProxyCube<T1>::use_mp))
164164
{
165165
const unwrap_cube<T1> U(X);
166166

inst/include/armadillo_bits/op_sum_bones.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ class op_sum
3232

3333
template<typename T1>
3434
inline static void apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_square>, op_sum >& in);
35-
35+
3636
template<typename T1>
3737
inline static void apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_pow >, op_sum >& in);
38-
38+
39+
template<typename T1>
40+
inline static void apply_generic(Mat<typename T1::elem_type>& out, const Op<T1,op_sum>& in);
41+
3942
template<typename eT>
4043
inline static void apply_mat_noalias(Mat<eT>& out, const Mat<eT>& X, const uword dim);
4144

inst/include/armadillo_bits/op_sum_meat.hpp

Lines changed: 23 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,7 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_sum>& in)
2828
{
2929
arma_debug_sigprint();
3030

31-
typedef typename T1::elem_type eT;
32-
33-
const uword dim = in.aux_uword_a;
34-
35-
arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" );
36-
37-
if((is_Mat<T1>::value) || (is_Mat<typename Proxy<T1>::stored_type>::value) || (arma_config::openmp && Proxy<T1>::use_mp))
38-
{
39-
const quasi_unwrap<T1> U(in.m);
40-
41-
if(U.is_alias(out))
42-
{
43-
Mat<eT> tmp;
44-
45-
op_sum::apply_mat_noalias(tmp, U.M, dim);
46-
47-
out.steal_mem(tmp);
48-
}
49-
else
50-
{
51-
op_sum::apply_mat_noalias(out, U.M, dim);
52-
}
53-
}
54-
else
55-
{
56-
const Proxy<T1> P(in.m);
57-
58-
if(P.is_alias(out))
59-
{
60-
Mat<eT> tmp;
61-
62-
op_sum::apply_proxy_noalias(tmp, P, dim);
63-
64-
out.steal_mem(tmp);
65-
}
66-
else
67-
{
68-
op_sum::apply_proxy_noalias(out, P, dim);
69-
}
70-
}
31+
op_sum::apply_generic(out, in);
7132
}
7233

7334

@@ -85,12 +46,12 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_square>, op
8546

8647
typedef typename inner_expr_type::proxy_type::stored_type inner_expr_P_stored_type;
8748

88-
const uword dim = in.aux_uword_a;
89-
90-
arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" );
91-
9249
if(is_Mat<inner_expr_P_stored_type>::value)
9350
{
51+
const uword dim = in.aux_uword_a;
52+
53+
arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" );
54+
9455
const quasi_unwrap<inner_expr_P_stored_type> U(in.m.P.Q);
9556

9657
if(U.is_alias(out))
@@ -105,42 +66,11 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_square>, op
10566
{
10667
op_sum::apply_mat_square_noalias(out, U.M, dim);
10768
}
108-
}
109-
else
110-
if(arma_config::openmp && Proxy<inner_expr_type>::use_mp)
111-
{
112-
const quasi_unwrap<inner_expr_type> U(in.m); // force evaluation of compound inner expression
11369

114-
if(U.is_alias(out))
115-
{
116-
Mat<eT> tmp;
117-
118-
op_sum::apply_mat_noalias(tmp, U.M, dim);
119-
120-
out.steal_mem(tmp);
121-
}
122-
else
123-
{
124-
op_sum::apply_mat_noalias(out, U.M, dim);
125-
}
126-
}
127-
else
128-
{
129-
const Proxy<inner_expr_type> P(in.m);
130-
131-
if(P.is_alias(out))
132-
{
133-
Mat<eT> tmp;
134-
135-
op_sum::apply_proxy_noalias(tmp, P, dim);
136-
137-
out.steal_mem(tmp);
138-
}
139-
else
140-
{
141-
op_sum::apply_proxy_noalias(out, P, dim);
142-
}
70+
return;
14371
}
72+
73+
op_sum::apply_generic(out, in);
14474
}
14575

14676

@@ -172,17 +102,27 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_pow>, op_su
172102
return;
173103
}
174104

175-
typedef eOp<T1,eop_pow> inner_expr_type;
105+
op_sum::apply_generic(out, in);
106+
}
107+
108+
109+
110+
template<typename T1>
111+
inline
112+
void
113+
op_sum::apply_generic(Mat<typename T1::elem_type>& out, const Op<T1,op_sum>& in)
114+
{
115+
arma_debug_sigprint();
176116

177-
typedef typename inner_expr_type::proxy_type::stored_type inner_expr_P_stored_type;
117+
typedef typename T1::elem_type eT;
178118

179119
const uword dim = in.aux_uword_a;
180120

181121
arma_conform_check( (dim > 1), "sum(): parameter 'dim' must be 0 or 1" );
182122

183-
if( (is_Mat<inner_expr_P_stored_type>::value) || (arma_config::openmp && Proxy<inner_expr_type>::use_mp) )
123+
if((is_Mat<T1>::value) || (is_Mat<typename Proxy<T1>::stored_type>::value) || (arma_config::openmp && Proxy<T1>::use_mp))
184124
{
185-
const quasi_unwrap<inner_expr_type> U(in.m); // force evaluation of eop_pow
125+
const quasi_unwrap<T1> U(in.m);
186126

187127
if(U.is_alias(out))
188128
{
@@ -199,7 +139,7 @@ op_sum::apply(Mat<typename T1::elem_type>& out, const Op< eOp<T1,eop_pow>, op_su
199139
}
200140
else
201141
{
202-
const Proxy<inner_expr_type> P(in.m);
142+
const Proxy<T1> P(in.m);
203143

204144
if(P.is_alias(out))
205145
{

0 commit comments

Comments
 (0)