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

Update armadillo version 14.2.0 #234

Merged
merged 1 commit into from
Nov 16, 2024
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
8 changes: 4 additions & 4 deletions Include/armadillo/armadillo_bits/Base_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ struct Base
arma_warn_unused inline elem_type min() const;
arma_warn_unused inline elem_type max() const;

inline elem_type min(uword& index_of_min_val) const;
inline elem_type max(uword& index_of_max_val) const;
arma_frown("use .index_min() instead") inline elem_type min(uword& index_of_min_val) const;
arma_frown("use .index_max() instead") inline elem_type max(uword& index_of_max_val) const;

inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
arma_deprecated inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
arma_deprecated inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;

arma_warn_unused inline uword index_min() const;
arma_warn_unused inline uword index_max() const;
Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/CubeToMatOp_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_type
arma_aligned const T1& m; //!< the operand; must be derived from BaseCube
arma_aligned uword aux_uword; //!< auxiliary data, uword format

template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }

static constexpr bool is_row = op_type::template traits<T1>::is_row;
static constexpr bool is_col = op_type::template traits<T1>::is_col;
static constexpr bool is_xvec = op_type::template traits<T1>::is_xvec;
Expand Down
9 changes: 4 additions & 5 deletions Include/armadillo/armadillo_bits/Cube_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,11 @@ class Cube : public BaseCube< eT, Cube<eT> >
arma_warn_unused inline eT min() const;
arma_warn_unused inline eT max() const;

inline eT min(uword& index_of_min_val) const;
inline eT max(uword& index_of_max_val) const;

inline eT min(uword& row_of_min_val, uword& col_of_min_val, uword& slice_of_min_val) const;
inline eT max(uword& row_of_max_val, uword& col_of_max_val, uword& slice_of_max_val) const;
arma_frown("use .index_min() instead") inline eT min(uword& index_of_min_val) const;
arma_frown("use .index_max() instead") inline eT max(uword& index_of_max_val) const;

arma_deprecated inline eT min(uword& row_of_min_val, uword& col_of_min_val, uword& slice_of_min_val) const;
arma_deprecated inline eT max(uword& row_of_max_val, uword& col_of_max_val, uword& slice_of_max_val) const;

arma_cold inline bool save(const std::string name, const file_type type = arma_binary) const;
arma_cold inline bool save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/Gen_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class Gen
inline void apply_inplace_div (Mat<elem_type>& out) const;

inline void apply(subview<elem_type>& out) const;

template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
};


Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/Glue_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class Glue
inline Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword);
inline ~Glue();

template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;

const T1& A; //!< first operand; must be derived from Base
const T2& B; //!< second operand; must be derived from Base
uword aux_uword; //!< storage of auxiliary data, uword format
Expand Down
13 changes: 13 additions & 0 deletions Include/armadillo/armadillo_bits/Glue_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,17 @@ Glue<T1,T2,glue_type>::~Glue()



template<typename T1, typename T2, typename glue_type>
template<typename eT2>
inline
bool
Glue<T1,T2,glue_type>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();

return (A.is_alias(X) || B.is_alias(X));
}



//! @}
11 changes: 7 additions & 4 deletions Include/armadillo/armadillo_bits/Mat_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,11 @@ class Mat : public Base< eT, Mat<eT> >
arma_warn_unused inline eT min() const;
arma_warn_unused inline eT max() const;

inline eT min(uword& index_of_min_val) const;
inline eT max(uword& index_of_max_val) const;
arma_frown("use .index_min() instead") inline eT min(uword& index_of_min_val) const;
arma_frown("use .index_max() instead") inline eT max(uword& index_of_max_val) const;

inline eT min(uword& row_of_min_val, uword& col_of_min_val) const;
inline eT max(uword& row_of_max_val, uword& col_of_max_val) const;
arma_deprecated inline eT min(uword& row_of_min_val, uword& col_of_min_val) const;
arma_deprecated inline eT max(uword& row_of_max_val, uword& col_of_max_val) const;


arma_cold inline bool save(const std::string name, const file_type type = arma_binary) const;
Expand Down Expand Up @@ -771,6 +771,9 @@ class Mat : public Base< eT, Mat<eT> >

inline void steal_mem_col(Mat& X, const uword max_n_rows);

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const; //!< don't use this unless you're writing code internal to Armadillo


template<uword fixed_n_rows, uword fixed_n_cols> class fixed;

Expand Down
13 changes: 13 additions & 0 deletions Include/armadillo/armadillo_bits/Mat_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,19 @@ Mat<eT>::steal_mem_col(Mat<eT>& x, const uword max_n_rows)



template<typename eT>
template<typename eT2>
arma_inline
bool
Mat<eT>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();

return (is_same_type<eT,eT2>::yes) && (void_ptr(this) == void_ptr(&X));
}



//! construct a matrix from a given auxiliary array of eTs.
//! if copy_aux_mem is true, new memory is allocated and the array is copied.
//! if copy_aux_mem is false, the auxiliary array is used directly (without allocating memory and copying).
Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/Op_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class Op
inline Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline ~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
Expand Down
13 changes: 13 additions & 0 deletions Include/armadillo/armadillo_bits/Op_meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,17 @@ Op<T1, op_type>::~Op()



template<typename T1, typename op_type>
template<typename eT2>
inline
bool
Op<T1, op_type>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();

return m.is_alias(X);
}



//! @}
16 changes: 8 additions & 8 deletions Include/armadillo/armadillo_bits/Proxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ struct Proxy< Mat<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
Expand Down Expand Up @@ -235,7 +235,7 @@ struct Proxy< Col<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
Expand Down Expand Up @@ -282,7 +282,7 @@ struct Proxy< Row<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
Expand Down Expand Up @@ -1013,7 +1013,7 @@ struct Proxy< subview<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return Q.check_overlap(X); }
Expand Down Expand Up @@ -1060,7 +1060,7 @@ struct Proxy< subview_col<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return Q.check_overlap(X); }
Expand Down Expand Up @@ -1109,7 +1109,7 @@ struct Proxy< subview_cols<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(sv.m)) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return sv.check_overlap(X); }
Expand Down Expand Up @@ -1156,7 +1156,7 @@ struct Proxy< subview_row<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return Q.check_overlap(X); }
Expand Down Expand Up @@ -1304,7 +1304,7 @@ struct Proxy< diagview<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }

template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }

template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
Expand Down
8 changes: 4 additions & 4 deletions Include/armadillo/armadillo_bits/SpBase_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ struct SpBase
arma_warn_unused inline elem_type min() const;
arma_warn_unused inline elem_type max() const;

inline elem_type min(uword& index_of_min_val) const;
inline elem_type max(uword& index_of_max_val) const;
arma_frown("use .index_min() instead") inline elem_type min(uword& index_of_min_val) const;
arma_frown("use .index_max() instead") inline elem_type max(uword& index_of_max_val) const;

inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
arma_deprecated inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
arma_deprecated inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;

arma_warn_unused inline uword index_min() const;
arma_warn_unused inline uword index_max() const;
Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/SpToDGlue_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class SpToDGlue : public Base< typename T1::elem_type, SpToDGlue<T1, T2, glue_ty
inline explicit SpToDGlue(const T1& in_A, const T2& in_B);
inline ~SpToDGlue();

template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }

const T1& A; //!< first operand; must be derived from Base or SpBase
const T2& B; //!< second operand; must be derived from Base or SpBase
};
Expand Down
3 changes: 3 additions & 0 deletions Include/armadillo/armadillo_bits/SpToDOp_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class SpToDOp : public Base< typename T1::elem_type, SpToDOp<T1, op_type> >
inline SpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline ~SpToDOp();

template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }

arma_aligned const T1& m; //!< the operand; must be derived from SpBase
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
Expand Down
2 changes: 2 additions & 0 deletions Include/armadillo/armadillo_bits/arma_forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class op_diagmat;
class op_trimat;
class op_vectorise_row;
class op_vectorise_col;
class op_symmatu;
class op_symmatl;

class op_row_as_mat;
class op_col_as_mat;
Expand Down
6 changes: 3 additions & 3 deletions Include/armadillo/armadillo_bits/arma_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@


#define ARMA_VERSION_MAJOR 14
#define ARMA_VERSION_MINOR 0
#define ARMA_VERSION_PATCH 3
#define ARMA_VERSION_NAME "Stochastic Parrot"
#define ARMA_VERSION_MINOR 2
#define ARMA_VERSION_PATCH 0
#define ARMA_VERSION_NAME "Smooth Caffeine"



Expand Down
36 changes: 31 additions & 5 deletions Include/armadillo/armadillo_bits/auxlib_bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,29 @@ class auxlib
template<typename eT>
inline static bool inv_tr_rcond(Mat<eT>& A, typename get_pod_type<eT>::result& out_rcond, const uword layout);

template<typename eT>
inline static bool inv_sym(Mat<eT>& A);

template<typename T>
inline static bool inv_sym(Mat< std::complex<T> >& A);

template<typename eT>
inline static bool inv_sym_rcond(Mat<eT>& A, eT& out_rcond);

template<typename T>
inline static bool inv_sym_rcond(Mat< std::complex<T> >& A, T& out_rcond);

template<typename eT>
inline static bool inv_sympd(Mat<eT>& A, bool& out_sympd_state);

template<typename eT>
inline static bool inv_sympd(Mat<eT>& out, const Mat<eT>& X);

template<typename eT>
inline static bool inv_sympd_rcond(Mat<eT>& A, bool& out_sympd_state, eT& out_rcond);
inline static bool inv_sympd_rcond(Mat<eT>& A, eT& out_rcond);

template<typename T>
inline static bool inv_sympd_rcond(Mat< std::complex<T> >& A, bool& out_sympd_state, T& out_rcond);
inline static bool inv_sympd_rcond(Mat< std::complex<T> >& A, T& out_rcond);


//
Expand Down Expand Up @@ -269,6 +281,20 @@ class auxlib

//

template<typename T1>
inline static bool solve_sym_fast(Mat<typename T1::pod_type>& out, Mat<typename T1::pod_type>& A, const Base<typename T1::pod_type,T1>& B_expr);

template<typename T1>
inline static bool solve_sym_fast(Mat< std::complex<typename T1::pod_type> >& out, Mat< std::complex<typename T1::pod_type> >& A, const Base< std::complex<typename T1::pod_type>, T1 >& B_expr);

template<typename T1>
inline static bool solve_sym_rcond(Mat<typename T1::pod_type>& out, typename T1::pod_type& out_rcond, Mat<typename T1::pod_type>& A, const Base<typename T1::pod_type,T1>& B_expr);

template<typename T1>
inline static bool solve_sym_rcond(Mat< std::complex<typename T1::pod_type> >& out, typename T1::pod_type& out_rcond, Mat< std::complex<typename T1::pod_type> >& A, const Base< std::complex<typename T1::pod_type>,T1>& B_expr);

//

template<typename T1>
inline static bool solve_sympd_fast(Mat<typename T1::elem_type>& out, Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr);

Expand Down Expand Up @@ -388,10 +414,10 @@ class auxlib
inline static T rcond(Mat< std::complex<T> >& A);

template<typename eT>
inline static eT rcond_sympd(Mat<eT>& A, bool& calc_ok);
inline static eT rcond_sym(Mat<eT>& A);

template<typename T>
inline static T rcond_sympd(Mat< std::complex<T> >& A, bool& calc_ok);
template<typename T>
inline static T rcond_sym(Mat< std::complex<T> >& A);

template<typename eT>
inline static eT rcond_trimat(const Mat<eT>& A, const uword layout);
Expand Down
Loading