Skip to content

Commit cafacff

Browse files
committed
Armadillo 15.4.1
1 parent b8580cf commit cafacff

32 files changed

Lines changed: 277 additions & 138 deletions

inst/include/armadillo_bits/Mat_bones.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,12 @@ class Mat<eT>::fixed : public Mat<eT>
938938
arma_warn_unused arma_inline eT* memptr();
939939
arma_warn_unused arma_inline const eT* memptr() const;
940940

941+
arma_inline subview_row<eT> row(const uword row_num);
942+
arma_inline const subview_row<eT> row(const uword row_num) const;
943+
944+
arma_inline subview_col<eT> col(const uword col_num);
945+
arma_inline const subview_col<eT> col(const uword col_num) const;
946+
941947
arma_warn_unused arma_inline bool is_vec() const;
942948

943949
inline const Mat<eT>& fill(const eT val);

inst/include/armadillo_bits/Mat_meat.hpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10746,6 +10746,66 @@ Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::memptr() const
1074610746

1074710747

1074810748

10749+
template<typename eT>
10750+
template<uword fixed_n_rows, uword fixed_n_cols>
10751+
arma_inline
10752+
subview_row<eT>
10753+
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::row(const uword row_num)
10754+
{
10755+
arma_debug_sigprint();
10756+
10757+
arma_conform_check_bounds( row_num >= fixed_n_rows, "Mat::row(): index out of bounds" );
10758+
10759+
return subview_row<eT>(*this, row_num);
10760+
}
10761+
10762+
10763+
10764+
template<typename eT>
10765+
template<uword fixed_n_rows, uword fixed_n_cols>
10766+
arma_inline
10767+
const subview_row<eT>
10768+
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::row(const uword row_num) const
10769+
{
10770+
arma_debug_sigprint();
10771+
10772+
arma_conform_check_bounds( row_num >= fixed_n_rows, "Mat::row(): index out of bounds" );
10773+
10774+
return subview_row<eT>(*this, row_num);
10775+
}
10776+
10777+
10778+
10779+
template<typename eT>
10780+
template<uword fixed_n_rows, uword fixed_n_cols>
10781+
arma_inline
10782+
subview_col<eT>
10783+
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::col(const uword col_num)
10784+
{
10785+
arma_debug_sigprint();
10786+
10787+
arma_conform_check_bounds( col_num >= fixed_n_cols, "Mat::col(): index out of bounds" );
10788+
10789+
return subview_col<eT>(*this, col_num);
10790+
}
10791+
10792+
10793+
10794+
template<typename eT>
10795+
template<uword fixed_n_rows, uword fixed_n_cols>
10796+
arma_inline
10797+
const subview_col<eT>
10798+
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::col(const uword col_num) const
10799+
{
10800+
arma_debug_sigprint();
10801+
10802+
arma_conform_check_bounds( col_num >= fixed_n_cols, "Mat::col(): index out of bounds" );
10803+
10804+
return subview_col<eT>(*this, col_num);
10805+
}
10806+
10807+
10808+
1074910809
template<typename eT>
1075010810
template<uword fixed_n_rows, uword fixed_n_cols>
1075110811
arma_inline

inst/include/armadillo_bits/SpBase_bones.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ struct SpBase
5252
{
5353
arma_inline const derived& get_ref() const;
5454

55-
arma_inline bool is_alias(const SpMat<elem_type>& X) const;
56-
5755
arma_warn_unused inline const SpOp<derived,spop_htrans> t() const; //!< Hermitian transpose
5856
arma_warn_unused inline const SpOp<derived,spop_htrans> ht() const; //!< Hermitian transpose
5957
arma_warn_unused inline const SpOp<derived,spop_strans> st() const; //!< simple transpose

inst/include/armadillo_bits/SpBase_meat.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ SpBase<elem_type,derived>::get_ref() const
3131

3232

3333

34-
template<typename elem_type, typename derived>
35-
arma_inline
36-
bool
37-
SpBase<elem_type,derived>::is_alias(const SpMat<elem_type>& X) const
38-
{
39-
return (*this).get_ref().is_alias(X);
40-
}
41-
42-
43-
4434
template<typename elem_type, typename derived>
4535
inline
4636
const SpOp<derived, spop_htrans>

inst/include/armadillo_bits/SpGlue_bones.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ struct SpGlue : public SpBase< typename T1::elem_type, SpGlue<T1, T2, spglue_typ
3737
inline SpGlue(const T1& in_A, const T2& in_B, const elem_type in_aux);
3838
inline ~SpGlue();
3939

40-
arma_inline bool is_alias(const SpMat<elem_type>& X) const;
40+
template<typename eT2>
41+
arma_inline bool is_alias(const SpMat<eT2>& X) const;
4142

4243
const T1& A; //!< first operand; must be derived from SpBase
4344
const T2& B; //!< second operand; must be derived from SpBase

inst/include/armadillo_bits/SpGlue_meat.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ SpGlue<T1,T2,spglue_type>::~SpGlue()
5454

5555

5656
template<typename T1, typename T2, typename spglue_type>
57+
template<typename eT2>
5758
arma_inline
5859
bool
59-
SpGlue<T1,T2,spglue_type>::is_alias(const SpMat<typename T1::elem_type>& X) const
60+
SpGlue<T1,T2,spglue_type>::is_alias(const SpMat<eT2>& X) const
6061
{
6162
return (A.is_alias(X) || B.is_alias(X));
6263
}

inst/include/armadillo_bits/SpMat_bones.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@ class SpMat : public SpBase< eT, SpMat<eT> >
649649
template<typename eT2, typename T1, typename Functor> inline void init_xform_mt(const SpBase<eT2,T1>& x, const Functor& func);
650650

651651
//! don't use this unless you're writing internal Armadillo code
652-
arma_inline bool is_alias(const SpMat<eT>& X) const;
652+
template<typename eT2>
653+
arma_inline bool is_alias(const SpMat<eT2>& X) const;
653654

654655

655656
protected:

inst/include/armadillo_bits/SpMat_meat.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6015,11 +6015,14 @@ SpMat<eT>::init_xform_mt(const SpBase<eT2,T1>& A, const Functor& func)
60156015

60166016

60176017
template<typename eT>
6018+
template<typename eT2>
60186019
arma_inline
60196020
bool
6020-
SpMat<eT>::is_alias(const SpMat<eT>& X) const
6021+
SpMat<eT>::is_alias(const SpMat<eT2>& X) const
60216022
{
6022-
return (&X == this);
6023+
arma_debug_sigprint();
6024+
6025+
return (is_same_type<eT,eT2>::yes) && (void_ptr(this) == void_ptr(&X));
60236026
}
60246027

60256028

inst/include/armadillo_bits/SpOp_bones.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ struct SpOp : public SpBase< typename T1::elem_type, SpOp<T1, op_type> >
3838
inline SpOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
3939
inline ~SpOp();
4040

41-
arma_inline bool is_alias(const SpMat<elem_type>& X) const;
41+
template<typename eT2>
42+
arma_inline bool is_alias(const SpMat<eT2>& X) const;
4243

4344
const T1& m; //!< the operand; must be derived from SpBase
4445
elem_type aux; //!< auxiliary data, using the element type as used by T1

inst/include/armadillo_bits/SpOp_meat.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ SpOp<T1, op_type>::~SpOp()
6464

6565

6666
template<typename T1, typename op_type>
67+
template<typename eT2>
6768
arma_inline
6869
bool
69-
SpOp<T1, op_type>::is_alias(const SpMat<typename T1::elem_type>& X) const
70+
SpOp<T1, op_type>::is_alias(const SpMat<eT2>& X) const
7071
{
7172
return m.is_alias(X);
7273
}

0 commit comments

Comments
 (0)