Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armadillo 14 4.0 #461

Merged
merged 5 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
2025-02-15 Dirk Eddelbuettel <[email protected]>

* inst/include/armadillo_bits/: Sync again with updated sources for
Armadillo 14.3.92 as an RC for 14.4.*

2025-02-13 Dirk Eddelbuettel <[email protected]>

* inst/include/armadillo_bits/: Sync again with updated sources for
Armadillo 14.3.91 as a RC for 14.4.*

2025-02-11 Dirk Eddelbuettel <[email protected]>

* inst/include/armadillo_bits/: Sync again with updated sources for
Armadillo 14.3.90 as a RC for 14.4.*

* R/RcppArmadillo.package.skeleton.R: Generalise helper function to
support additional DESCRIPTION fields
* man/RcppArmadillo.package.skeleton.Rd: Document

2025-02-10 Dirk Eddelbuettel <[email protected]>

* inst/include/armadillo_bits/: Armadillo 14.3.90 as a RC for 14.4.*

2025-02-05 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): RcppArmadillo 14.2.3-1
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: RcppArmadillo
Type: Package
Title: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
Version: 14.2.3-1
Date: 2025-02-05
Version: 14.3.92-1
Date: 2025-02-15
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
comment = c(ORCID = "0000-0001-6419-907X")),
person("Romain", "Francois", role = "aut",
Expand Down
4 changes: 2 additions & 2 deletions inst/include/armadillo_bits/CubeToMatOp_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_type
inline CubeToMatOp(const T1& in_m, const uword in_aux_uword);
inline ~CubeToMatOp();

arma_aligned const T1& m; //!< the operand; must be derived from BaseCube
arma_aligned uword aux_uword; //!< auxiliary data, uword format
const T1& m; //!< the operand; must be derived from BaseCube
uword aux_uword; //!< auxiliary data, uword format

template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
Expand Down
48 changes: 48 additions & 0 deletions inst/include/armadillo_bits/Cube_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,14 @@ Cube<eT>::Cube(const eOpCube<T1, eop_type>& X)

init_cold();

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return; }
}

eop_type::apply(*this, X);
}

Expand All @@ -2890,6 +2898,14 @@ Cube<eT>::operator=(const eOpCube<T1, eop_type>& X)

init_warm(X.get_n_rows(), X.get_n_cols(), X.get_n_slices());

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply(*this, X);

return *this;
Expand All @@ -2912,6 +2928,14 @@ Cube<eT>::operator+=(const eOpCube<T1, eop_type>& X)

if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator+=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_plus(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_plus(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_plus(*this, X);

return *this;
Expand All @@ -2934,6 +2958,14 @@ Cube<eT>::operator-=(const eOpCube<T1, eop_type>& X)

if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator-=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_minus(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_minus(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_minus(*this, X);

return *this;
Expand All @@ -2956,6 +2988,14 @@ Cube<eT>::operator%=(const eOpCube<T1, eop_type>& X)

if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator%=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_schur(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_schur(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_schur(*this, X);

return *this;
Expand All @@ -2978,6 +3018,14 @@ Cube<eT>::operator/=(const eOpCube<T1, eop_type>& X)

if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator/=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_div(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_div(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_div(*this, X);

return *this;
Expand Down
6 changes: 3 additions & 3 deletions inst/include/armadillo_bits/GenCube_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class GenCube
static constexpr bool use_at = false;
static constexpr bool is_simple = (is_same_type<gen_type, gen_ones>::value) || (is_same_type<gen_type, gen_zeros>::value);

arma_aligned const uword n_rows;
arma_aligned const uword n_cols;
arma_aligned const uword n_slices;
const uword n_rows;
const uword n_cols;
const uword n_slices;

arma_inline GenCube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
arma_inline ~GenCube();
Expand Down
4 changes: 2 additions & 2 deletions inst/include/armadillo_bits/Gen_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class Gen
static constexpr bool is_col = T1::is_col;
static constexpr bool is_xvec = T1::is_xvec;

arma_aligned const uword n_rows;
arma_aligned const uword n_cols;
const uword n_rows;
const uword n_cols;

arma_inline Gen(const uword in_n_rows, const uword in_n_cols);
arma_inline ~Gen();
Expand Down
64 changes: 56 additions & 8 deletions inst/include/armadillo_bits/Mat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,9 @@ Mat<eT>::Mat(const char* text)

init( std::string(text) );
}



//! create the matrix from a textual description
template<typename eT>
inline
Expand All @@ -489,8 +489,8 @@ Mat<eT>::operator=(const char* text)

return *this;
}



//! create the matrix from a textual description
template<typename eT>
Expand All @@ -508,9 +508,9 @@ Mat<eT>::Mat(const std::string& text)

init(text);
}



//! create the matrix from a textual description
template<typename eT>
inline
Expand Down Expand Up @@ -5185,6 +5185,14 @@ Mat<eT>::Mat(const eOp<T1, eop_type>& X)

init_cold();

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return; }
}

eop_type::apply(*this, X);
}

Expand All @@ -5207,6 +5215,14 @@ Mat<eT>::operator=(const eOp<T1, eop_type>& X)

init_warm(X.get_n_rows(), X.get_n_cols());

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply(*this, X);

return *this;
Expand All @@ -5228,6 +5244,14 @@ Mat<eT>::operator+=(const eOp<T1, eop_type>& X)

if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator+=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_plus(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_plus(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_plus(*this, X);

return *this;
Expand All @@ -5249,6 +5273,14 @@ Mat<eT>::operator-=(const eOp<T1, eop_type>& X)

if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator-=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_minus(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_minus(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_minus(*this, X);

return *this;
Expand Down Expand Up @@ -5287,6 +5319,14 @@ Mat<eT>::operator%=(const eOp<T1, eop_type>& X)

if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator%=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_schur(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_schur(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_schur(*this, X);

return *this;
Expand All @@ -5308,6 +5348,14 @@ Mat<eT>::operator/=(const eOp<T1, eop_type>& X)

if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator/=(tmp); }

if(is_same_type<eop_type, eop_pow>::value)
{
constexpr bool eT_non_int = is_non_integral<eT>::value;

if( X.aux == eT(2) ) { eop_square::apply_inplace_div(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_div(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
}

eop_type::apply_inplace_div(*this, X);

return *this;
Expand Down
10 changes: 5 additions & 5 deletions inst/include/armadillo_bits/OpCube_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class OpCube : public BaseCube< typename T1::elem_type, OpCube<T1, op_type> >
inline OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c);
inline ~OpCube();

arma_aligned const T1& m; //!< the operand; must be derived from BaseCube
arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1
arma_aligned uword aux_uword_a; //!< auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< auxiliary data, uword format
arma_aligned uword aux_uword_c; //!< auxiliary data, uword format
const T1& m; //!< the operand; must be derived from BaseCube
elem_type aux; //!< auxiliary data, using the element type as used by T1
uword aux_uword_a; //!< auxiliary data, uword format
uword aux_uword_b; //!< auxiliary data, uword format
uword aux_uword_c; //!< auxiliary data, uword format
};


Expand Down
8 changes: 4 additions & 4 deletions inst/include/armadillo_bits/Op_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class Op
template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;

arma_aligned const T1& m; //!< the operand; must be derived from Base
arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1
arma_aligned uword aux_uword_a; //!< auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< auxiliary data, uword format
const T1& m; //!< the operand; must be derived from Base
elem_type aux; //!< auxiliary data, using the element type as used by T1
uword aux_uword_a; //!< auxiliary data, uword format
uword aux_uword_b; //!< auxiliary data, uword format
};


Expand Down
Loading