Skip to content

Commit a1cca32

Browse files
committed
Armadillo 15.2.1
1 parent 49d6e0e commit a1cca32

File tree

5 files changed

+270
-45
lines changed

5 files changed

+270
-45
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-10-28 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/current/: Sync with Armadillo 15.2.1
4+
15
2025-10-21 Dirk Eddelbuettel <[email protected]>
26

37
* inst/tinytest/test_misc.R: Tests for armadillo_version_typed()

inst/include/current/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 2
26-
#define ARMA_VERSION_PATCH 0
26+
#define ARMA_VERSION_PATCH 1
2727
#define ARMA_VERSION_NAME "Medium Roast Deluxe"
2828

2929

inst/include/current/armadillo_bits/op_accu_meat.hpp

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,30 @@ op_accu_mat::apply(const subview<eT>& X)
602602
const uword X_n_rows = X.n_rows;
603603
const uword X_n_cols = X.n_cols;
604604

605-
if(X_n_rows == 1) { return op_accu_mat::apply( static_cast< const subview_row<eT>& >(X) ); }
605+
if(X_n_rows == 1)
606+
{
607+
const uword X_m_n_rows = X.m.n_rows;
608+
609+
const eT* mem_ptr = X.colptr(0);
610+
611+
eT val1 = eT(0);
612+
eT val2 = eT(0);
613+
614+
uword j;
615+
616+
for(j=1; j < X_n_cols; j+=2)
617+
{
618+
val1 += (*mem_ptr); mem_ptr += X_m_n_rows;
619+
val2 += (*mem_ptr); mem_ptr += X_m_n_rows;
620+
}
621+
622+
if((j-1) < X_n_cols)
623+
{
624+
val1 += (*mem_ptr);
625+
}
626+
627+
return val1 + val2;
628+
}
606629

607630
if(X_n_cols == 1) { return arrayops::accumulate( X.colptr(0), X_n_rows ); }
608631

@@ -640,7 +663,7 @@ op_accu_mat::apply(const subview_row<eT>& X)
640663
const uword X_m_n_rows = X.m.n_rows;
641664
const uword X_n_cols = X.n_cols;
642665

643-
const eT* row_mem = &(X.m.at(X.aux_row1,X.aux_col1));
666+
const eT* mem_ptr = X.rowmem;
644667

645668
eT val1 = eT(0);
646669
eT val2 = eT(0);
@@ -649,13 +672,13 @@ op_accu_mat::apply(const subview_row<eT>& X)
649672

650673
for(j=1; j < X_n_cols; j+=2)
651674
{
652-
val1 += (*row_mem); row_mem += X_m_n_rows;
653-
val2 += (*row_mem); row_mem += X_m_n_rows;
675+
val1 += (*mem_ptr); mem_ptr += X_m_n_rows;
676+
val2 += (*mem_ptr); mem_ptr += X_m_n_rows;
654677
}
655678

656679
if((j-1) < X_n_cols)
657680
{
658-
val1 += (*row_mem);
681+
val1 += (*mem_ptr);
659682
}
660683

661684
return val1 + val2;

inst/include/current/armadillo_bits/subview_bones.hpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class subview : public Base< eT, subview<eT> >
8585
template<typename T1> inline void operator-= (const SpBase<eT,T1>& x);
8686
template<typename T1> inline void operator%= (const SpBase<eT,T1>& x);
8787
template<typename T1> inline void operator/= (const SpBase<eT,T1>& x);
88-
88+
8989
template<typename T1, typename gen_type>
9090
inline typename enable_if2< is_same_type<typename T1::elem_type, eT>::value, void>::result operator=(const Gen<T1,gen_type>& x);
9191

@@ -396,6 +396,11 @@ class subview_col : public subview<eT>
396396
inline void zeros();
397397
inline void ones();
398398

399+
arma_warn_unused inline bool is_finite() const;
400+
401+
arma_warn_unused inline bool has_inf() const;
402+
arma_warn_unused inline bool has_nan() const;
403+
399404
arma_inline eT at_alt (const uword i) const;
400405

401406
arma_inline eT& operator[](const uword i);
@@ -528,6 +533,8 @@ class subview_row : public subview<eT>
528533
static constexpr bool is_col = false;
529534
static constexpr bool is_xvec = false;
530535

536+
const eT* rowmem;
537+
531538
inline void operator= (const subview<eT>& x);
532539
inline void operator= (const subview_row& x);
533540
inline void operator= (const eT val);
@@ -545,6 +552,15 @@ class subview_row : public subview<eT>
545552

546553
arma_warn_unused arma_inline const Op<subview_row<eT>,op_strans> as_col() const;
547554

555+
inline void fill(const eT val);
556+
inline void zeros();
557+
inline void ones();
558+
559+
arma_warn_unused inline bool is_finite() const;
560+
561+
arma_warn_unused inline bool has_inf() const;
562+
arma_warn_unused inline bool has_nan() const;
563+
548564
inline eT at_alt (const uword i) const;
549565

550566
inline eT& operator[](const uword i);

0 commit comments

Comments
 (0)