Skip to content

Commit a425606

Browse files
committed
Armadillo 15.6.1
1 parent 4570097 commit a425606

5 files changed

Lines changed: 90 additions & 2 deletions

File tree

‎ChangeLog‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2026-10-02 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/armadillo*: Armadillo 15.6.1
4+
15
2026-09-07 Dirk Eddelbuettel <edd@debian.org>
26

37
* inst/include/armadillo*: Armadillo 15.6.0

‎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 15
2525
#define ARMA_VERSION_MINOR 6
26-
#define ARMA_VERSION_PATCH 0
26+
#define ARMA_VERSION_PATCH 1
2727
#define ARMA_VERSION_NAME "Medium Roast Cortado"
2828

2929

‎inst/include/armadillo_bits/glue_cubemul_bones.hpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ struct glue_cubemul
3838
template<typename eT, bool do_strans_A, bool do_htrans_A, bool do_strans_B, bool do_htrans_B>
3939
inline static void apply_noalias(Cube<eT>& out, const Cube<eT>& A, const Mat<eT>& B);
4040

41+
template<typename eT, bool do_strans_A, bool do_htrans_A, bool do_strans_B, bool do_htrans_B>
42+
inline static void apply_noalias_single(Cube<eT>& out, const Cube<eT>& A);
43+
4144
//
4245

4346
template<typename T1, typename T2>

‎inst/include/armadillo_bits/glue_cubemul_meat.hpp‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ glue_cubemul::apply_noalias(Cube<eT>& out, const Cube<eT>& A, const Cube<eT>& B)
162162
{
163163
arma_debug_sigprint();
164164

165+
constexpr bool has_xtrans = (do_strans_A || do_htrans_A || do_strans_B || do_htrans_B);
166+
167+
if( has_xtrans && (&A == &B) )
168+
{
169+
arma_debug_print("optimisation for symmetric/hermitian result");
170+
171+
glue_cubemul::apply_noalias_single<eT, do_strans_A, do_htrans_A, do_strans_B, do_htrans_B>(out, A);
172+
173+
return;
174+
}
175+
165176
const uword A_n_slices = A.n_slices;
166177

167178
arma_conform_check( (A_n_slices != B.n_slices), "cubemul(): given cubes must have the same number of slices" );
@@ -226,6 +237,76 @@ glue_cubemul::apply_noalias(Cube<eT>& out, const Cube<eT>& A, const Cube<eT>& B)
226237

227238

228239

240+
template<typename eT, bool do_strans_A, bool do_htrans_A, bool do_strans_B, bool do_htrans_B>
241+
inline
242+
void
243+
glue_cubemul::apply_noalias_single(Cube<eT>& out, const Cube<eT>& A)
244+
{
245+
arma_debug_sigprint();
246+
247+
const uword A_n_slices = A.n_slices;
248+
249+
constexpr bool do_xtrans_A = (do_strans_A || do_htrans_A);
250+
constexpr bool do_xtrans_B = (do_strans_B || do_htrans_B);
251+
252+
const uword final_A_n_rows = (do_xtrans_A == false) ? A.n_rows : A.n_cols;
253+
const uword final_A_n_cols = (do_xtrans_A == false) ? A.n_cols : A.n_rows;
254+
255+
const uword final_B_n_rows = (do_xtrans_B == false) ? A.n_rows : A.n_cols;
256+
const uword final_B_n_cols = (do_xtrans_B == false) ? A.n_cols : A.n_rows;
257+
258+
if( (arma_config::check_conform) && (final_A_n_cols != final_B_n_rows) )
259+
{
260+
std::ostringstream tmp;
261+
262+
tmp << "cubemul(): incompatible dimensions: " << final_A_n_rows << 'x' << final_A_n_cols << 'x' << A_n_slices << " and " << final_B_n_rows << 'x' << final_B_n_cols << 'x' << A_n_slices;
263+
264+
arma_stop_logic_error(tmp.str());
265+
}
266+
267+
out.set_size(final_A_n_rows, final_B_n_cols, A_n_slices);
268+
269+
if(out.is_empty()) { return; }
270+
271+
if(A.is_empty()) { out.zeros(); return; }
272+
273+
for(uword s=0; s < A_n_slices; ++s)
274+
{
275+
const Mat<eT> A_slice_s(const_cast<eT*>(A.slice_memptr(s)), A.n_rows, A.n_cols, false, true);
276+
277+
Mat<eT> out_slice_s(out.slice_memptr(s), final_A_n_rows, final_B_n_cols, false, true);
278+
279+
// glue_times has optimised handling for A*A' and A'*A
280+
281+
if( (do_xtrans_A == false) && (do_xtrans_B == false) )
282+
{
283+
out_slice_s = A_slice_s * A_slice_s;
284+
}
285+
else
286+
if( (do_xtrans_A == false) && (do_xtrans_B == true ) )
287+
{
288+
if(do_strans_B) { out_slice_s = A_slice_s * strans(A_slice_s); }
289+
else if(do_htrans_B) { out_slice_s = A_slice_s * htrans(A_slice_s); }
290+
}
291+
else
292+
if( (do_xtrans_A == true ) && (do_xtrans_B == false) )
293+
{
294+
if(do_strans_A) { out_slice_s = strans(A_slice_s) * A_slice_s; }
295+
else if(do_htrans_A) { out_slice_s = htrans(A_slice_s) * A_slice_s; }
296+
}
297+
else
298+
if( (do_xtrans_A == true ) && (do_xtrans_B == true ) )
299+
{
300+
if( (do_strans_A) && (do_strans_B) ) { out_slice_s = strans(A_slice_s) * strans(A_slice_s); }
301+
else if( (do_strans_A) && (do_htrans_B) ) { out_slice_s = strans(A_slice_s) * htrans(A_slice_s); }
302+
else if( (do_htrans_A) && (do_strans_B) ) { out_slice_s = htrans(A_slice_s) * strans(A_slice_s); }
303+
else if( (do_htrans_A) && (do_htrans_B) ) { out_slice_s = htrans(A_slice_s) * htrans(A_slice_s); }
304+
}
305+
}
306+
}
307+
308+
309+
229310
//
230311

231312

‎inst/include/armadillo_bits/op_pinv_meat.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ op_pinv::apply_gen(Mat<eT>& out, Mat<eT>& A, typename get_pod_type<eT>::result t
306306
}
307307
else
308308
{
309-
auxlib::svd_econ(U, s, V, A, 'b');
309+
status = auxlib::svd_econ(U, s, V, A, 'b');
310310
}
311311

312312
if(status == false) { return false; }

0 commit comments

Comments
 (0)