Mat_bones.hpp   Mat_bones.hpp 
skipping to change at line 108 skipping to change at line 108
inline const Mat& operator+=(const subview<eT>& X); inline const Mat& operator+=(const subview<eT>& X);
inline const Mat& operator-=(const subview<eT>& X); inline const Mat& operator-=(const subview<eT>& X);
inline const Mat& operator*=(const subview<eT>& X); inline const Mat& operator*=(const subview<eT>& X);
inline const Mat& operator%=(const subview<eT>& X); inline const Mat& operator%=(const subview<eT>& X);
inline const Mat& operator/=(const subview<eT>& X); inline const Mat& operator/=(const subview<eT>& X);
inline Mat(const subview_row_strans<eT>& X); // subview_row_strans can o nly be generated by the Proxy class inline Mat(const subview_row_strans<eT>& X); // subview_row_strans can o nly be generated by the Proxy class
inline Mat(const subview_row_htrans<eT>& X); // subview_row_htrans can o nly be generated by the Proxy class inline Mat(const subview_row_htrans<eT>& X); // subview_row_htrans can o nly be generated by the Proxy class
inline Mat(const xvec_htrans<eT>& X); // xvec_htrans can o nly be generated by the Proxy class inline Mat(const xvec_htrans<eT>& X); // xvec_htrans can o nly be generated by the Proxy class
//inline explicit Mat(const subview_cube<eT>& X); template<bool do_conj>
inline Mat(const xtrans_mat<eT,do_conj>& X); // xtrans_mat can on
ly be generated by the Proxy class
inline Mat(const subview_cube<eT>& X); inline Mat(const subview_cube<eT>& X);
inline const Mat& operator=(const subview_cube<eT>& X); inline const Mat& operator=(const subview_cube<eT>& X);
inline const Mat& operator+=(const subview_cube<eT>& X); inline const Mat& operator+=(const subview_cube<eT>& X);
inline const Mat& operator-=(const subview_cube<eT>& X); inline const Mat& operator-=(const subview_cube<eT>& X);
inline const Mat& operator*=(const subview_cube<eT>& X); inline const Mat& operator*=(const subview_cube<eT>& X);
inline const Mat& operator%=(const subview_cube<eT>& X); inline const Mat& operator%=(const subview_cube<eT>& X);
inline const Mat& operator/=(const subview_cube<eT>& X); inline const Mat& operator/=(const subview_cube<eT>& X);
//inline explicit Mat(const diagview<eT>& X);
inline Mat(const diagview<eT>& X); inline Mat(const diagview<eT>& X);
inline const Mat& operator=(const diagview<eT>& X); inline const Mat& operator=(const diagview<eT>& X);
inline const Mat& operator+=(const diagview<eT>& X); inline const Mat& operator+=(const diagview<eT>& X);
inline const Mat& operator-=(const diagview<eT>& X); inline const Mat& operator-=(const diagview<eT>& X);
inline const Mat& operator*=(const diagview<eT>& X); inline const Mat& operator*=(const diagview<eT>& X);
inline const Mat& operator%=(const diagview<eT>& X); inline const Mat& operator%=(const diagview<eT>& X);
inline const Mat& operator/=(const diagview<eT>& X); inline const Mat& operator/=(const diagview<eT>& X);
template<typename T1> inline Mat(const subview_elem1<eT ,T1>& X); template<typename T1> inline Mat(const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator= (const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator= (const subview_elem1<eT ,T1>& X);
skipping to change at line 142 skipping to change at line 143
template<typename T1> inline const Mat& operator/=(const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator/=(const subview_elem1<eT ,T1>& X);
template<typename T1, typename T2> inline Mat(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline Mat(const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator= (const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator= (const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator+=(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator+=(const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator-=(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator-=(const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator*=(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator*=(const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator%=(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator%=(const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator/=(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator/=(const sub view_elem2<eT,T1,T2>& X);
// Operators on sparse matrices (and subviews). // Operators on sparse matrices (and subviews)
template<typename T1> inline explicit Mat(const SpBase<eT, T1>& m); template<typename T1> inline explicit Mat(const SpBase<eT, T1>& m);
template<typename T1> inline const Mat& operator=(const SpBase<eT, T1>& m); template<typename T1> inline const Mat& operator=(const SpBase<eT, T1>& m);
template<typename T1> inline const Mat& operator+=(const SpBase<eT, T1>& m); template<typename T1> inline const Mat& operator+=(const SpBase<eT, T1>& m);
template<typename T1> inline const Mat& operator-=(const SpBase<eT, T1>& m); template<typename T1> inline const Mat& operator-=(const SpBase<eT, T1>& m);
template<typename T1> inline const Mat& operator*=(const SpBase<eT, T1>& m); template<typename T1> inline const Mat& operator*=(const SpBase<eT, T1>& m);
template<typename T1> inline const Mat& operator%=(const SpBase<eT, T1>& m); template<typename T1> inline const Mat& operator%=(const SpBase<eT, T1>& m);
template<typename T1> inline const Mat& operator/=(const SpBase<eT, T1>& m); template<typename T1> inline const Mat& operator/=(const SpBase<eT, T1>& m);
inline mat_injector<Mat> operator<<(const eT val); inline mat_injector<Mat> operator<<(const eT val);
inline mat_injector<Mat> operator<<(const injector_end_of_row<>& x); inline mat_injector<Mat> operator<<(const injector_end_of_row<>& x);
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
skipping to change at line 1755 skipping to change at line 1755
, mem_state(0) , mem_state(0)
, mem() , mem()
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
init_cold(); init_cold();
X.extract(*this); X.extract(*this);
} }
template<typename eT>
template<bool do_conj>
inline
Mat<eT>::Mat(const xtrans_mat<eT,do_conj>& X)
: n_rows(X.n_rows)
, n_cols(X.n_cols)
, n_elem(X.n_elem)
, vec_state(0)
, mem_state(0)
, mem()
{
arma_extra_debug_sigprint_this(this);
init_cold();
X.extract(*this);
}
//! construct a matrix from a subview_cube instance //! construct a matrix from a subview_cube instance
template<typename eT> template<typename eT>
inline inline
Mat<eT>::Mat(const subview_cube<eT>& x) Mat<eT>::Mat(const subview_cube<eT>& x)
: n_rows(0) : n_rows(0)
, n_cols(0) , n_cols(0)
, n_elem(0) , n_elem(0)
, vec_state(0) , vec_state(0)
, mem_state(0) , mem_state(0)
, mem() , mem()
 End of changes. 1 change blocks. 
0 lines changed or deleted 18 lines changed or added


 Proxy.hpp   Proxy.hpp 
// Copyright (C) 2010-2013 Conrad Sanderson // Copyright (C) 2010-2014 Conrad Sanderson
// Copyright (C) 2010-2013 NICTA (www.nicta.com.au) // Copyright (C) 2010-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup Proxy //! \addtogroup Proxy
//! @{ //! @{
// ea_type is the "element accessor" type, // ea_type is the "element accessor" type,
// which can provide access to elements via operator[] // which can provide access to elements via operator[]
skipping to change at line 439 skipping to change at line 439
inline explicit Proxy(const Op<T1, op_diagvec>& A) inline explicit Proxy(const Op<T1, op_diagvec>& A)
: Proxy_diagvec(A) : Proxy_diagvec(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
}; };
template<typename T1> template<typename T1>
struct Proxy_xtrans_default struct Proxy_xtrans_default
{ {
typedef typename T1::elem_type eT; inline Proxy_xtrans_default(const T1&) {}
};
static const bool prefer_at_accessor = false; template<typename T1>
static const bool has_subview = false; struct Proxy_xtrans_default< Op<T1, op_htrans> >
{
public:
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef xtrans_mat<elem_type,true> stored_type;
typedef const xtrans_mat<elem_type,true>& ea_type;
typedef const xtrans_mat<elem_type,true>& aligned_ea_type;
static const bool prefer_at_accessor = true;
static const bool has_subview = true;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
arma_aligned const Mat<eT> Q; static const bool is_row = false;
static const bool is_col = false;
arma_hot const unwrap<T1> U;
inline Proxy_xtrans_default(const T1& A) const xtrans_mat<elem_type,true> Q;
: Q(A)
inline explicit Proxy_xtrans_default(const Op<T1, op_htrans>& A)
: U(A.m)
, Q(U.M)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline ea_type get_ea() const { return Q; }
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&(U.
M)) == void_ptr(&X); }
arma_inline bool is_aligned() const { return false; }
};
template<typename T1>
struct Proxy_xtrans_default< Op<T1, op_strans> >
{
public:
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef xtrans_mat<elem_type,false> stored_type;
typedef const xtrans_mat<elem_type,false>& ea_type;
typedef const xtrans_mat<elem_type,false>& aligned_ea_type;
static const bool prefer_at_accessor = true;
static const bool has_subview = true;
static const bool is_fixed = false;
static const bool fake_mat = false;
static const bool is_row = false;
static const bool is_col = false;
const unwrap<T1> U;
const xtrans_mat<elem_type,false> Q;
inline explicit Proxy_xtrans_default(const Op<T1, op_strans>& A)
: U(A.m)
, Q(U.M)
{
arma_extra_debug_sigprint();
}
arma_inline ea_type get_ea() const { return Q; }
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 void_ptr(&(U.
M)) == void_ptr(&X); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1> template<typename T1>
struct Proxy_xtrans_vector struct Proxy_xtrans_vector
{ {
inline Proxy_xtrans_vector(const T1&) {} inline Proxy_xtrans_vector(const T1&) {}
}; };
template<typename T1> template<typename T1>
struct Proxy_xtrans_vector< Op<T1, op_htrans> > struct Proxy_xtrans_vector< Op<T1, op_htrans> >
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_type;
typedef const Mat<elem_type>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = quasi_unwrap<T1>::has_subview; static const bool has_subview = quasi_unwrap<T1>::has_subview;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = true; static const bool fake_mat = true;
// NOTE: the Op class takes care of swapping row and col for op_htrans
static const bool is_row = Op<T1, op_htrans>::is_row;
static const bool is_col = Op<T1, op_htrans>::is_col;
arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col
arma_aligned const Mat<eT> Q; arma_aligned const Mat<elem_type> Q;
inline Proxy_xtrans_vector(const Op<T1, op_htrans>& A) inline Proxy_xtrans_vector(const Op<T1, op_htrans>& A)
: U(A.m) : U(A.m)
, Q(const_cast<eT*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false ) , Q(const_cast<elem_type*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false , false)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline ea_type get_ea() const { return Q.memptr(); }
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return U.is_alias(X) ; } arma_inline bool is_alias(const Mat<eT2>& X) const { return U.is_alias(X) ; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1> template<typename T1>
struct Proxy_xtrans_vector< Op<T1, op_strans> > struct Proxy_xtrans_vector< Op<T1, op_strans> >
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_type;
typedef const Mat<elem_type>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = quasi_unwrap<T1>::has_subview; static const bool has_subview = quasi_unwrap<T1>::has_subview;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = true; static const bool fake_mat = true;
// NOTE: the Op class takes care of swapping row and col for op_htrans
static const bool is_row = Op<T1, op_htrans>::is_row;
static const bool is_col = Op<T1, op_htrans>::is_col;
arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col
arma_aligned const Mat<eT> Q; arma_aligned const Mat<elem_type> Q;
inline Proxy_xtrans_vector(const Op<T1, op_strans>& A) inline Proxy_xtrans_vector(const Op<T1, op_strans>& A)
: U(A.m) : U(A.m)
, Q(const_cast<eT*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false ) , Q(const_cast<elem_type*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false , false)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline ea_type get_ea() const { return Q.memptr(); }
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return U.is_alias(X) ; } arma_inline bool is_alias(const Mat<eT2>& X) const { return U.is_alias(X) ; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct Proxy_xtrans_redirect {}; struct Proxy_xtrans_redirect {};
template<typename T1> template<typename T1>
struct Proxy_xtrans_redirect<T1, false> { typedef Proxy_xtrans_default<T1> result; }; struct Proxy_xtrans_redirect<T1, false> { typedef Proxy_xtrans_default<T1> result; };
template<typename T1> template<typename T1>
struct Proxy_xtrans_redirect<T1, true> { typedef Proxy_xtrans_vector<T1> result; }; struct Proxy_xtrans_redirect<T1, true> { typedef Proxy_xtrans_vector<T1> result; };
skipping to change at line 542 skipping to change at line 627
typedef typedef
typename typename
Proxy_xtrans_redirect Proxy_xtrans_redirect
< <
Op<T1, op_htrans>, Op<T1, op_htrans>,
((is_complex<typename T1::elem_type>::value == false) && ((Op<T1, op_ht rans>::is_row) || (Op<T1, op_htrans>::is_col)) ) ((is_complex<typename T1::elem_type>::value == false) && ((Op<T1, op_ht rans>::is_row) || (Op<T1, op_htrans>::is_col)) )
>::result >::result
Proxy_xtrans; Proxy_xtrans;
typedef typename T1::elem_type elem_type; typedef typename Proxy_xtrans::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename Proxy_xtrans::pod_type pod_type;
typedef Mat<elem_type> stored_type; typedef typename Proxy_xtrans::stored_type stored_type;
typedef const elem_type* ea_type; typedef typename Proxy_xtrans::ea_type ea_type;
typedef const Mat<elem_type>& aligned_ea_type; typedef typename Proxy_xtrans::aligned_ea_type aligned_ea_type;
static const bool prefer_at_accessor = Proxy_xtrans::prefer_at_accessor; static const bool prefer_at_accessor = Proxy_xtrans::prefer_at_accessor;
static const bool has_subview = Proxy_xtrans::has_subview; static const bool has_subview = Proxy_xtrans::has_subview;
static const bool is_fixed = Proxy_xtrans::is_fixed; static const bool is_fixed = Proxy_xtrans::is_fixed;
static const bool fake_mat = Proxy_xtrans::fake_mat; static const bool fake_mat = Proxy_xtrans::fake_mat;
// NOTE: the Op class takes care of swapping row and col for op_htrans static const bool is_row = Proxy_xtrans::is_row;
static const bool is_row = Op<T1, op_htrans>::is_row; static const bool is_col = Proxy_xtrans::is_col;
static const bool is_col = Op<T1, op_htrans>::is_col;
using Proxy_xtrans::Q; using Proxy_xtrans::Q;
inline explicit Proxy(const Op<T1, op_htrans>& A) inline explicit Proxy(const Op<T1, op_htrans>& A)
: Proxy_xtrans(A) : Proxy_xtrans(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; } arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; }
arma_inline uword get_n_elem() const { return Q.n_elem; } arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const uword i) const { return Q[i]; } arma_inline elem_type operator[] (const uword i) const { return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); } arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); }
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Proxy_xtrans:
arma_inline aligned_ea_type get_aligned_ea() const { return Q; } :get_ea(); }
arma_inline aligned_ea_type get_aligned_ea() const { return Proxy_xtrans:
:get_aligned_ea(); }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_xtrans: :is_alias(X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_xtrans: :is_alias(X); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr( )); } arma_inline bool is_aligned() const { return Proxy_xtrans::is_aligned(); }
}; };
template<typename T1> template<typename T1>
class Proxy< Op<T1, op_strans> > class Proxy< Op<T1, op_strans> >
: public : public
Proxy_xtrans_redirect Proxy_xtrans_redirect
< <
Op<T1, op_strans>, Op<T1, op_strans>,
( (Op<T1, op_strans>::is_row) || (Op<T1, op_strans>::is_col) ) ( (Op<T1, op_strans>::is_row) || (Op<T1, op_strans>::is_col) )
>::result >::result
skipping to change at line 602 skipping to change at line 686
typedef typedef
typename typename
Proxy_xtrans_redirect Proxy_xtrans_redirect
< <
Op<T1, op_strans>, Op<T1, op_strans>,
( (Op<T1, op_strans>::is_row) || (Op<T1, op_strans>::is_col) ) ( (Op<T1, op_strans>::is_row) || (Op<T1, op_strans>::is_col) )
>::result >::result
Proxy_xtrans; Proxy_xtrans;
typedef typename T1::elem_type elem_type; typedef typename Proxy_xtrans::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename Proxy_xtrans::pod_type pod_type;
typedef Mat<elem_type> stored_type; typedef typename Proxy_xtrans::stored_type stored_type;
typedef const elem_type* ea_type; typedef typename Proxy_xtrans::ea_type ea_type;
typedef const Mat<elem_type>& aligned_ea_type; typedef typename Proxy_xtrans::aligned_ea_type aligned_ea_type;
static const bool prefer_at_accessor = Proxy_xtrans::prefer_at_accessor; static const bool prefer_at_accessor = Proxy_xtrans::prefer_at_accessor;
static const bool has_subview = Proxy_xtrans::has_subview; static const bool has_subview = Proxy_xtrans::has_subview;
static const bool is_fixed = Proxy_xtrans::is_fixed; static const bool is_fixed = Proxy_xtrans::is_fixed;
static const bool fake_mat = Proxy_xtrans::fake_mat; static const bool fake_mat = Proxy_xtrans::fake_mat;
// NOTE: the Op class takes care of swapping row and col for op_strans static const bool is_row = Proxy_xtrans::is_row;
static const bool is_row = Op<T1, op_strans>::is_row; static const bool is_col = Proxy_xtrans::is_col;
static const bool is_col = Op<T1, op_strans>::is_col;
using Proxy_xtrans::Q; using Proxy_xtrans::Q;
inline explicit Proxy(const Op<T1, op_strans>& A) inline explicit Proxy(const Op<T1, op_strans>& A)
: Proxy_xtrans(A) : Proxy_xtrans(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; } arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; }
arma_inline uword get_n_elem() const { return Q.n_elem; } arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const uword i) const { return Q[i]; } arma_inline elem_type operator[] (const uword i) const { return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); } arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); }
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Proxy_xtrans:
arma_inline aligned_ea_type get_aligned_ea() const { return Q; } :get_ea(); }
arma_inline aligned_ea_type get_aligned_ea() const { return Proxy_xtrans:
:get_aligned_ea(); }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_xtrans: :is_alias(X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_xtrans: :is_alias(X); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr( )); } arma_inline bool is_aligned() const { return Proxy_xtrans::is_aligned(); }
}; };
template<typename eT> template<typename eT>
struct Proxy_subview_row_htrans_cx struct Proxy_subview_row_htrans_cx
{ {
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type; typedef typename get_pod_type<eT>::result pod_type;
typedef subview_row_htrans<eT> stored_type; typedef subview_row_htrans<eT> stored_type;
typedef const subview_row_htrans<eT>& ea_type; typedef const subview_row_htrans<eT>& ea_type;
typedef const subview_row_htrans<eT>& aligned_ea_type; typedef const subview_row_htrans<eT>& aligned_ea_type;
skipping to change at line 1422 skipping to change at line 1505
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q; }
arma_inline aligned_ea_type get_aligned_ea() const { return Q; } arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .sv_row.m)) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .sv_row.m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; } arma_inline bool is_aligned() const { return false; }
}; };
template<typename eT, bool do_conj>
class Proxy< xtrans_mat<eT, do_conj> >
{
public:
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<eT> stored_type;
typedef const eT* ea_type;
typedef const Mat<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false;
static const bool has_subview = false;
static const bool is_fixed = false;
static const bool fake_mat = false;
static const bool is_row = false;
static const bool is_col = false;
arma_aligned const Mat<eT> Q;
inline explicit Proxy(const xtrans_mat<eT, do_conj>& A)
: Q(A)
{
arma_extra_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row,col); }
arma_inline elem_type at_alt (const uword i) const
{ return Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); }
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 false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
};
template<typename eT> template<typename eT>
class Proxy< xvec_htrans<eT> > class Proxy< xvec_htrans<eT> >
{ {
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<eT> stored_type; typedef Mat<eT> stored_type;
typedef const eT* ea_type; typedef const eT* ea_type;
typedef const Mat<eT>& aligned_ea_type; typedef const Mat<eT>& aligned_ea_type;
 End of changes. 28 change blocks. 
38 lines changed or deleted 177 lines changed or added


 arma_version.hpp   arma_version.hpp 
skipping to change at line 12 skipping to change at line 12
// Copyright (C) 2009-2014 NICTA (www.nicta.com.au) // Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 4 #define ARMA_VERSION_MAJOR 4
#define ARMA_VERSION_MINOR 400 #define ARMA_VERSION_MINOR 450
#define ARMA_VERSION_PATCH 2 #define ARMA_VERSION_PATCH 0
#define ARMA_VERSION_NAME "Winter Shark Alley" #define ARMA_VERSION_NAME "Spring Hill Fort"
struct arma_version struct arma_version
{ {
static const unsigned int major = ARMA_VERSION_MAJOR; static const unsigned int major = ARMA_VERSION_MAJOR;
static const unsigned int minor = ARMA_VERSION_MINOR; static const unsigned int minor = ARMA_VERSION_MINOR;
static const unsigned int patch = ARMA_VERSION_PATCH; static const unsigned int patch = ARMA_VERSION_PATCH;
static static
inline inline
std::string std::string
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added


 armadillo   armadillo 
skipping to change at line 140 skipping to change at line 140
#include "armadillo_bits/auxlib_bones.hpp" #include "armadillo_bits/auxlib_bones.hpp"
#include "armadillo_bits/sp_auxlib_bones.hpp" #include "armadillo_bits/sp_auxlib_bones.hpp"
#include "armadillo_bits/injector_bones.hpp" #include "armadillo_bits/injector_bones.hpp"
#include "armadillo_bits/Mat_bones.hpp" #include "armadillo_bits/Mat_bones.hpp"
#include "armadillo_bits/Col_bones.hpp" #include "armadillo_bits/Col_bones.hpp"
#include "armadillo_bits/Row_bones.hpp" #include "armadillo_bits/Row_bones.hpp"
#include "armadillo_bits/Cube_bones.hpp" #include "armadillo_bits/Cube_bones.hpp"
#include "armadillo_bits/xvec_htrans_bones.hpp" #include "armadillo_bits/xvec_htrans_bones.hpp"
#include "armadillo_bits/xtrans_mat_bones.hpp"
#include "armadillo_bits/SizeMat_bones.hpp" #include "armadillo_bits/SizeMat_bones.hpp"
#include "armadillo_bits/SizeCube_bones.hpp" #include "armadillo_bits/SizeCube_bones.hpp"
#include "armadillo_bits/SpValProxy_bones.hpp" #include "armadillo_bits/SpValProxy_bones.hpp"
#include "armadillo_bits/SpMat_bones.hpp" #include "armadillo_bits/SpMat_bones.hpp"
#include "armadillo_bits/SpCol_bones.hpp" #include "armadillo_bits/SpCol_bones.hpp"
#include "armadillo_bits/SpRow_bones.hpp" #include "armadillo_bits/SpRow_bones.hpp"
#include "armadillo_bits/SpSubview_bones.hpp" #include "armadillo_bits/SpSubview_bones.hpp"
#include "armadillo_bits/typedef_mat_fixed.hpp" #include "armadillo_bits/typedef_mat_fixed.hpp"
skipping to change at line 480 skipping to change at line 481
#include "armadillo_bits/auxlib_meat.hpp" #include "armadillo_bits/auxlib_meat.hpp"
#include "armadillo_bits/sp_auxlib_meat.hpp" #include "armadillo_bits/sp_auxlib_meat.hpp"
#include "armadillo_bits/injector_meat.hpp" #include "armadillo_bits/injector_meat.hpp"
#include "armadillo_bits/Mat_meat.hpp" #include "armadillo_bits/Mat_meat.hpp"
#include "armadillo_bits/Col_meat.hpp" #include "armadillo_bits/Col_meat.hpp"
#include "armadillo_bits/Row_meat.hpp" #include "armadillo_bits/Row_meat.hpp"
#include "armadillo_bits/Cube_meat.hpp" #include "armadillo_bits/Cube_meat.hpp"
#include "armadillo_bits/xvec_htrans_meat.hpp" #include "armadillo_bits/xvec_htrans_meat.hpp"
#include "armadillo_bits/xtrans_mat_meat.hpp"
#include "armadillo_bits/SizeMat_meat.hpp" #include "armadillo_bits/SizeMat_meat.hpp"
#include "armadillo_bits/SizeCube_meat.hpp" #include "armadillo_bits/SizeCube_meat.hpp"
#include "armadillo_bits/field_meat.hpp" #include "armadillo_bits/field_meat.hpp"
#include "armadillo_bits/subview_meat.hpp" #include "armadillo_bits/subview_meat.hpp"
#include "armadillo_bits/subview_elem1_meat.hpp" #include "armadillo_bits/subview_elem1_meat.hpp"
#include "armadillo_bits/subview_elem2_meat.hpp" #include "armadillo_bits/subview_elem2_meat.hpp"
#include "armadillo_bits/subview_field_meat.hpp" #include "armadillo_bits/subview_field_meat.hpp"
#include "armadillo_bits/subview_cube_meat.hpp" #include "armadillo_bits/subview_cube_meat.hpp"
#include "armadillo_bits/diagview_meat.hpp" #include "armadillo_bits/diagview_meat.hpp"
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 fn_elem.hpp   fn_elem.hpp 
skipping to change at line 421 skipping to change at line 421
const eOpCube<T1, eop_conj> const eOpCube<T1, eop_conj>
conj(const BaseCube<std::complex<typename T1::pod_type>,T1>& A) conj(const BaseCube<std::complex<typename T1::pod_type>,T1>& A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<T1, eop_conj>(A.get_ref()); return eOpCube<T1, eop_conj>(A.get_ref());
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const T1& const typename Proxy<T1>::stored_type&
conj(const eOp<T1, eop_conj>& A) conj(const eOp<T1, eop_conj>& A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return A.m; return A.P.Q;
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const T1& const typename ProxyCube<T1>::stored_type&
conj(const eOpCube<T1, eop_conj>& A) conj(const eOpCube<T1, eop_conj>& A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return A.m; return A.P.Q;
} }
// pow // pow
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOp<T1, eop_pow> const eOp<T1, eop_pow>
pow(const Base<typename T1::elem_type,T1>& A, const typename T1::elem_type exponent) pow(const Base<typename T1::elem_type,T1>& A, const typename T1::elem_type exponent)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 fn_sort_index.hpp   fn_sort_index.hpp 
skipping to change at line 47 skipping to change at line 47
bool bool
operator() (const arma_sort_index_packet<T1,T2>& A, const arma_sort_index _packet<T1,T2>& B) const operator() (const arma_sort_index_packet<T1,T2>& A, const arma_sort_index _packet<T1,T2>& B) const
{ {
return (A.val > B.val); return (A.val > B.val);
} }
}; };
template<typename umat_elem_type, typename eT, const uword sort_type, const uword sort_stable> template<typename umat_elem_type, typename eT, const uword sort_type, const uword sort_stable>
void void
inline inline
sort_index_helper(umat_elem_type* out_mem, const eT* in_mem, const uword n_ elem) sort_index_helper(umat_elem_type* out_mem, const eT* in_mem, const uword n_ elem, typename arma_not_cx<eT>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
std::vector< arma_sort_index_packet<eT, umat_elem_type> > packet_vec(n_el em); std::vector< arma_sort_index_packet<eT, umat_elem_type> > packet_vec(n_el em);
for(uword i=0; i<n_elem; ++i) for(uword i=0; i<n_elem; ++i)
{ {
packet_vec[i].val = in_mem[i]; packet_vec[i].val = in_mem[i];
packet_vec[i].index = i; packet_vec[i].index = i;
} }
if(sort_type == 0) if(sort_type == 0)
skipping to change at line 96 skipping to change at line 97
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator ); std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
} }
} }
for(uword i=0; i<n_elem; ++i) for(uword i=0; i<n_elem; ++i)
{ {
out_mem[i] = packet_vec[i].index; out_mem[i] = packet_vec[i].index;
} }
} }
//! kept for compatibility with old code template<typename umat_elem_type, typename eT, const uword sort_type, const
template<typename T1> uword sort_stable>
void
inline inline
umat sort_index_helper(umat_elem_type* out_mem, const eT* in_mem, const uword n_
sort_index elem, typename arma_cx_only<eT>::result* junk = 0)
(
const Base<typename T1::elem_type,T1>& X,
const uword sort_type = 0,
const typename arma_not_cx<typename T1::elem_type>::result* junk = 0
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename get_pod_type<eT>::result T;
const unwrap<T1> tmp(X.get_ref()); std::vector< arma_sort_index_packet<T, umat_elem_type> > packet_vec(n_ele
const Mat<eT>& A = tmp.M; m);
if(A.is_empty() == true) for(uword i=0; i<n_elem; ++i)
{ {
return umat(); packet_vec[i].val = std::abs(in_mem[i]);
packet_vec[i].index = i;
} }
arma_debug_check( (A.is_vec() == false), "sort_index(): currently only ha
ndles vectors");
typedef typename umat::elem_type out_elem_type;
umat out(A.n_rows, A.n_cols);
if(sort_type == 0) if(sort_type == 0)
{ {
sort_index_helper<out_elem_type, eT, 0, 0>(out.memptr(), A.mem, A.n_ele // ascend
m);
arma_sort_index_helper_ascend comparator;
if(sort_stable == 0)
{
std::sort( packet_vec.begin(), packet_vec.end(), comparator );
}
else
{
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
}
} }
else else
{ {
sort_index_helper<out_elem_type, eT, 1, 0>(out.memptr(), A.mem, A.n_ele // descend
m);
arma_sort_index_helper_descend comparator;
if(sort_stable == 0)
{
std::sort( packet_vec.begin(), packet_vec.end(), comparator );
}
else
{
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
}
} }
return out; for(uword i=0; i<n_elem; ++i)
{
out_mem[i] = packet_vec[i].index;
}
} }
//! kept for compatibility with old code //! kept for compatibility with old code
template<typename T1> template<typename T1>
inline inline
umat umat
stable_sort_index sort_index
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
const uword sort_type = 0, const uword sort_type = 0
const typename arma_not_cx<typename T1::elem_type>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename umat::elem_type out_elem_type;
const unwrap<T1> tmp(X.get_ref()); const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
if(A.is_empty() == true) umat out;
if(A.is_empty() == false)
{ {
return umat(); arma_debug_check( (A.is_vec() == false), "sort_index(): currently only
handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sort_type == 0)
{
sort_index_helper<out_elem_type, eT, 0, 0>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 0>(out.memptr(), A.mem, A.n_e
lem);
}
} }
arma_debug_check( (A.is_vec() == false), "stable_sort_index(): currently return out;
only handles vectors"); }
//! kept for compatibility with old code
template<typename T1>
inline
umat
stable_sort_index
(
const Base<typename T1::elem_type,T1>& X,
const uword sort_type = 0
)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
typedef typename umat::elem_type out_elem_type; typedef typename umat::elem_type out_elem_type;
umat out(A.n_rows, A.n_cols); const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M;
if(sort_type == 0) umat out;
{
sort_index_helper<out_elem_type, eT, 0, 1>(out.memptr(), A.mem, A.n_ele if(A.is_empty() == false)
m);
}
else
{ {
sort_index_helper<out_elem_type, eT, 1, 1>(out.memptr(), A.mem, A.n_ele arma_debug_check( (A.is_vec() == false), "stable_sort_index(): currentl
m); y only handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sort_type == 0)
{
sort_index_helper<out_elem_type, eT, 0, 1>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 1>(out.memptr(), A.mem, A.n_e
lem);
}
} }
return out; return out;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
typename typename
enable_if2 enable_if2
< <
( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) && (is_cx<typename T1::elem_type>::value == false) ), ( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) ),
umat umat
>::result >::result
sort_index sort_index
( (
const T1& X, const T1& X,
const T2* sort_direction const T2* sort_direction
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename umat::elem_type out_elem_type;
const unwrap<T1> tmp(X);
const Mat<eT>& A = tmp.M;
if(A.is_empty() == true)
{
return umat();
}
arma_debug_check( (A.is_vec() == false), "sort_index(): currently only ha
ndles vectors");
const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0); const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0);
arma_debug_check( ((sig != 'a') && (sig != 'd')), "sort_index(): unknown sort direction" ); arma_debug_check( ((sig != 'a') && (sig != 'd')), "sort_index(): unknown sort direction" );
typedef typename umat::elem_type out_elem_type; const unwrap<T1> tmp(X);
const Mat<eT>& A = tmp.M;
umat out(A.n_rows, A.n_cols); umat out;
if(sig == 'a') if(A.is_empty() == false)
{
sort_index_helper<out_elem_type, eT, 0, 0>(out.memptr(), A.mem, A.n_ele
m);
}
else
{ {
sort_index_helper<out_elem_type, eT, 1, 0>(out.memptr(), A.mem, A.n_ele arma_debug_check( (A.is_vec() == false), "sort_index(): currently only
m); handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sig == 'a')
{
sort_index_helper<out_elem_type, eT, 0, 0>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 0>(out.memptr(), A.mem, A.n_e
lem);
}
} }
return out; return out;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
typename typename
enable_if2 enable_if2
< <
( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) && (is_cx<typename T1::elem_type>::value == false) ), ( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) ),
umat umat
>::result >::result
stable_sort_index stable_sort_index
( (
const T1& X, const T1& X,
const T2* sort_direction const T2* sort_direction
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename umat::elem_type out_elem_type;
const unwrap<T1> tmp(X);
const Mat<eT>& A = tmp.M;
if(A.is_empty() == true)
{
return umat();
}
arma_debug_check( (A.is_vec() == false), "stable_sort_index(): currently
only handles vectors");
const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0); const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0);
arma_debug_check( ((sig != 'a') && (sig != 'd')), "stable_sort_index(): u nknown sort direction" ); arma_debug_check( ((sig != 'a') && (sig != 'd')), "stable_sort_index(): u nknown sort direction" );
typedef typename umat::elem_type out_elem_type; const unwrap<T1> tmp(X);
const Mat<eT>& A = tmp.M;
umat out(A.n_rows, A.n_cols); umat out;
if(sig == 'a') if(A.is_empty() == false)
{
sort_index_helper<out_elem_type, eT, 0, 1>(out.memptr(), A.mem, A.n_ele
m);
}
else
{ {
sort_index_helper<out_elem_type, eT, 1, 1>(out.memptr(), A.mem, A.n_ele arma_debug_check( (A.is_vec() == false), "stable_sort_index(): currentl
m); y only handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sig == 'a')
{
sort_index_helper<out_elem_type, eT, 0, 1>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 1>(out.memptr(), A.mem, A.n_e
lem);
}
} }
return out; return out;
} }
//! @} //! @}
 End of changes. 35 change blocks. 
91 lines changed or deleted 142 lines changed or added


 fn_symmat.hpp   fn_symmat.hpp 
// Copyright (C) 2011 Conrad Sanderson // Copyright (C) 2011-2014 Conrad Sanderson
// Copyright (C) 2011 NICTA (www.nicta.com.au) // Copyright (C) 2011-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup fn_symmat //! \addtogroup fn_symmat
//! @{ //! @{
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_symmat> typename enable_if2< is_cx<typename T1::elem_type>::no, const Op<T1, op_sym
symmatu(const Base<typename T1::elem_type,T1>& X) mat> >::result
symmatu(const Base<typename T1::elem_type,T1>& X, const bool do_conj = fals
e)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(do_conj);
return Op<T1, op_symmat>(X.get_ref(), 0, 0); return Op<T1, op_symmat>(X.get_ref(), 0, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_symmat> typename enable_if2< is_cx<typename T1::elem_type>::no, const Op<T1, op_sym
symmatl(const Base<typename T1::elem_type,T1>& X) mat> >::result
symmatl(const Base<typename T1::elem_type,T1>& X, const bool do_conj = fals
e)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(do_conj);
return Op<T1, op_symmat>(X.get_ref(), 1, 0); return Op<T1, op_symmat>(X.get_ref(), 1, 0);
} }
template<typename T1>
arma_inline
typename enable_if2< is_cx<typename T1::elem_type>::yes, const Op<T1, op_sy
mmat_cx> >::result
symmatu(const Base<typename T1::elem_type,T1>& X, const bool do_conj = true
)
{
arma_extra_debug_sigprint();
return Op<T1, op_symmat_cx>(X.get_ref(), 0, (do_conj ? 1 : 0));
}
template<typename T1>
arma_inline
typename enable_if2< is_cx<typename T1::elem_type>::yes, const Op<T1, op_sy
mmat_cx> >::result
symmatl(const Base<typename T1::elem_type,T1>& X, const bool do_conj = true
)
{
arma_extra_debug_sigprint();
return Op<T1, op_symmat_cx>(X.get_ref(), 1, (do_conj ? 1 : 0));
}
//! @} //! @}
 End of changes. 6 change blocks. 
6 lines changed or deleted 36 lines changed or added


 forward_bones.hpp   forward_bones.hpp 
skipping to change at line 24 skipping to change at line 24
template<typename elem_type, typename derived> struct Base; template<typename elem_type, typename derived> struct Base;
template<typename elem_type, typename derived> struct BaseCube; template<typename elem_type, typename derived> struct BaseCube;
template<typename eT> class Mat; template<typename eT> class Mat;
template<typename eT> class Col; template<typename eT> class Col;
template<typename eT> class Row; template<typename eT> class Row;
template<typename eT> class Cube; template<typename eT> class Cube;
template<typename eT> class xvec_htrans; template<typename eT> class xvec_htrans;
template<typename oT> class field; template<typename oT> class field;
template<typename eT, bool do_conj> class xtrans_mat;
template<typename eT> class subview; template<typename eT> class subview;
template<typename eT> class subview_col; template<typename eT> class subview_col;
template<typename eT> class subview_row; template<typename eT> class subview_row;
template<typename eT> class subview_row_strans; template<typename eT> class subview_row_strans;
template<typename eT> class subview_row_htrans; template<typename eT> class subview_row_htrans;
template<typename eT> class subview_cube; template<typename eT> class subview_cube;
template<typename oT> class subview_field; template<typename oT> class subview_field;
template<typename eT> class SpValProxy; template<typename eT> class SpValProxy;
template<typename eT> class SpMat; template<typename eT> class SpMat;
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 gmm_diag_bones.hpp   gmm_diag_bones.hpp 
skipping to change at line 89 skipping to change at line 89
template<typename T1> inline void set_means(const Base<eT,T1>& in_means); template<typename T1> inline void set_means(const Base<eT,T1>& in_means);
template<typename T1> inline void set_dcovs(const Base<eT,T1>& in_dcovs); template<typename T1> inline void set_dcovs(const Base<eT,T1>& in_dcovs);
template<typename T1> inline void set_hefts(const Base<eT,T1>& in_hefts); template<typename T1> inline void set_hefts(const Base<eT,T1>& in_hefts);
inline uword n_dims() const; inline uword n_dims() const;
inline uword n_gaus() const; inline uword n_gaus() const;
inline bool load(const std::string name); inline bool load(const std::string name);
inline bool save(const std::string name) const; inline bool save(const std::string name) const;
inline Col<eT> generate() const;
inline Mat<eT> generate(const uword N) const;
template<typename T1> inline eT log_p(const T1& expr, const gmm_empt y_arg& junk1 = gmm_empty_arg(), typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == true ))>::result* junk2 = 0) con st; template<typename T1> inline eT log_p(const T1& expr, const gmm_empt y_arg& junk1 = gmm_empty_arg(), typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == true ))>::result* junk2 = 0) con st;
template<typename T1> inline eT log_p(const T1& expr, const uword ga us_id, typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == true ))>::result* junk2 = 0) con st; template<typename T1> inline eT log_p(const T1& expr, const uword ga us_id, typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == true ))>::result* junk2 = 0) con st;
template<typename T1> inline Row<eT> log_p(const T1& expr, const gmm_empt y_arg& junk1 = gmm_empty_arg(), typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == false))>::result* junk2 = 0) con st; template<typename T1> inline Row<eT> log_p(const T1& expr, const gmm_empt y_arg& junk1 = gmm_empty_arg(), typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == false))>::result* junk2 = 0) con st;
template<typename T1> inline Row<eT> log_p(const T1& expr, const uword ga us_id, typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == false))>::result* junk2 = 0) con st; template<typename T1> inline Row<eT> log_p(const T1& expr, const uword ga us_id, typename enable_if<((is_arma_type<T1>::valu e) && (resolves_to_colvector<T1>::value == false))>::result* junk2 = 0) con st;
template<typename T1> inline eT avg_log_p(const Base<eT,T1>& expr) const; template<typename T1> inline eT avg_log_p(const Base<eT,T1>& expr) const;
template<typename T1> inline eT avg_log_p(const Base<eT,T1>& expr, const uword gaus_id) const; template<typename T1> inline eT avg_log_p(const Base<eT,T1>& expr, const uword gaus_id) const;
template<typename T1> inline uword assign(const T1& expr, const gmm_dis t_mode& dist, typename enable_if<((is_arma_type<T1>::value) && (resolves_to _colvector<T1>::value == true ))>::result* junk = 0) const; template<typename T1> inline uword assign(const T1& expr, const gmm_dis t_mode& dist, typename enable_if<((is_arma_type<T1>::value) && (resolves_to _colvector<T1>::value == true ))>::result* junk = 0) const;
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 gmm_diag_meat.hpp   gmm_diag_meat.hpp 
skipping to change at line 254 skipping to change at line 254
Q.slice(0).submat(1, 0, size(means)) = means; Q.slice(0).submat(1, 0, size(means)) = means;
Q.slice(1).submat(1, 0, size(dcovs)) = dcovs; Q.slice(1).submat(1, 0, size(dcovs)) = dcovs;
const bool status = Q.save(name, arma_binary); const bool status = Q.save(name, arma_binary);
return status; return status;
} }
template<typename eT> template<typename eT>
inline
Col<eT>
gmm_diag<eT>::generate() const
{
arma_extra_debug_sigprint();
const uword n_dims = means.n_rows;
const uword n_gaus = means.n_cols;
Col<eT> out( (n_gaus > 0) ? n_dims : uword(0) );
if(n_gaus > 0)
{
const double val = randu<double>();
double csum = double(0);
uword gaus_id = 0;
for(uword j=0; j < n_gaus; ++j)
{
csum += hefts[j];
if(val <= csum) { gaus_id = j; break; }
}
out = randn< Col<eT> >(n_dims);
out %= sqrt(dcovs.col(gaus_id));
out += means.col(gaus_id);
}
return out;
}
template<typename eT>
inline
Mat<eT>
gmm_diag<eT>::generate(const uword N) const
{
arma_extra_debug_sigprint();
const uword n_dims = means.n_rows;
const uword n_gaus = means.n_cols;
Mat<eT> out( ( (n_gaus > 0) ? n_dims : uword(0) ), N );
if(n_gaus > 0)
{
const eT* hefts_mem = hefts.memptr();
for(uword i=0; i < N; ++i)
{
const double val = randu<double>();
double csum = double(0);
uword gaus_id = 0;
for(uword j=0; j < n_gaus; ++j)
{
csum += hefts_mem[j];
if(val <= csum) { gaus_id = j; break; }
}
subview_col<eT> out_col = out.col(i);
out_col = randn< Col<eT> >(n_dims);
out_col %= sqrt(dcovs.col(gaus_id));
out_col += means.col(gaus_id);
}
}
return out;
}
template<typename eT>
template<typename T1> template<typename T1>
inline inline
eT eT
gmm_diag<eT>::log_p(const T1& expr, const gmm_empty_arg& junk1, typename en able_if<((is_arma_type<T1>::value) && (resolves_to_colvector<T1>::value == true))>::result* junk2) const gmm_diag<eT>::log_p(const T1& expr, const gmm_empty_arg& junk1, typename en able_if<((is_arma_type<T1>::value) && (resolves_to_colvector<T1>::value == true))>::result* junk2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
const quasi_unwrap<T1> tmp(expr); const quasi_unwrap<T1> tmp(expr);
 End of changes. 1 change blocks. 
0 lines changed or deleted 75 lines changed or added


 op_symmat_bones.hpp   op_symmat_bones.hpp 
// Copyright (C) 2011 Conrad Sanderson // Copyright (C) 2011-2014 Conrad Sanderson
// Copyright (C) 2011 NICTA (www.nicta.com.au) // Copyright (C) 2011-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup op_symmat //! \addtogroup op_symmat
//! @{ //! @{
class op_symmat class op_symmat
{ {
public: public:
template<typename T1> template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op
_symmat>& in, const typename arma_not_cx<typename T1::elem_type>::result* j _symmat>& in);
unk = 0); };
class op_symmat_cx
{
public:
template<typename T1> template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _symmat>& in, const typename arma_cx_only<typename T1::elem_type>::result* junk = 0); inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _symmat_cx>& in);
}; };
//! @} //! @}
 End of changes. 3 change blocks. 
6 lines changed or deleted 10 lines changed or added


 op_symmat_meat.hpp   op_symmat_meat.hpp 
// Copyright (C) 2011-2012 Conrad Sanderson // Copyright (C) 2011-2014 Conrad Sanderson
// Copyright (C) 2011-2012 NICTA (www.nicta.com.au) // Copyright (C) 2011-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup op_symmat //! \addtogroup op_symmat
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
void void
op_symmat::apply op_symmat::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_symmat>&
( in)
Mat<typename T1::elem_type>& out,
const Op<T1,op_symmat>& in,
const typename arma_not_cx<typename T1::elem_type>::result* junk
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const unwrap<T1> tmp(in.m); const unwrap<T1> tmp(in.m);
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
arma_debug_check( (A.is_square() == false), "symmatu()/symmatl(): given m atrix must be square" ); arma_debug_check( (A.is_square() == false), "symmatu()/symmatl(): given m atrix must be square" );
const uword N = A.n_rows; const uword N = A.n_rows;
const bool upper = (in.aux_uword_a == 0); const bool upper = (in.aux_uword_a == 0);
skipping to change at line 97 skipping to change at line 91
{ {
out.at(col,row) = coldata[row]; out.at(col,row) = coldata[row];
} }
} }
} }
} }
template<typename T1> template<typename T1>
inline inline
void void
op_symmat::apply op_symmat_cx::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_symmat
( _cx>& in)
Mat<typename T1::elem_type>& out,
const Op<T1,op_symmat>& in,
const typename arma_cx_only<typename T1::elem_type>::result* junk
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const unwrap<T1> tmp(in.m); const unwrap<T1> tmp(in.m);
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
arma_debug_check( (A.is_square() == false), "symmatu()/symmatl(): given m atrix must be square" ); arma_debug_check( (A.is_square() == false), "symmatu()/symmatl(): given m atrix must be square" );
const uword N = A.n_rows; const uword N = A.n_rows;
const bool upper = (in.aux_uword_a == 0);
const bool upper = (in.aux_uword_a == 0);
const bool do_conj = (in.aux_uword_b == 1);
if(&out != &A) if(&out != &A)
{ {
out.copy_size(A); out.copy_size(A);
if(upper) if(upper)
{ {
// upper triangular: copy the diagonal and the elements above the dia gonal // upper triangular: copy the diagonal and the elements above the dia gonal
for(uword i=0; i<N; ++i) for(uword i=0; i<N; ++i)
skipping to change at line 147 skipping to change at line 137
for(uword i=0; i<N; ++i) for(uword i=0; i<N; ++i)
{ {
const eT* A_data = A.colptr(i); const eT* A_data = A.colptr(i);
eT* out_data = out.colptr(i); eT* out_data = out.colptr(i);
arrayops::copy( &out_data[i], &A_data[i], N-i ); arrayops::copy( &out_data[i], &A_data[i], N-i );
} }
} }
} }
if(upper) if(do_conj)
{ {
// reflect elements across the diagonal from upper triangle to lower tr if(upper)
iangle {
// reflect elements across the diagonal from upper triangle to lower
triangle
for(uword col=1; col < N; ++col) for(uword col=1; col < N; ++col)
{
const eT* coldata = out.colptr(col);
for(uword row=0; row < col; ++row)
{
out.at(col,row) = std::conj(coldata[row]);
}
}
}
else
{ {
const eT* coldata = out.colptr(col); // reflect elements across the diagonal from lower triangle to upper triangle
for(uword row=0; row < col; ++row) for(uword col=0; col < N; ++col)
{ {
out.at(col,row) = std::conj(coldata[row]); const eT* coldata = out.colptr(col);
for(uword row=(col+1); row < N; ++row)
{
out.at(col,row) = std::conj(coldata[row]);
}
} }
} }
} }
else else // don't do complex conjugation
{ {
// reflect elements across the diagonal from lower triangle to upper tr if(upper)
iangle {
// reflect elements across the diagonal from upper triangle to lower
triangle
for(uword col=0; col < N; ++col) for(uword col=1; col < N; ++col)
{
const eT* coldata = out.colptr(col);
for(uword row=0; row < col; ++row)
{
out.at(col,row) = coldata[row];
}
}
}
else
{ {
const eT* coldata = out.colptr(col); // reflect elements across the diagonal from lower triangle to upper triangle
for(uword row=(col+1); row < N; ++row) for(uword col=0; col < N; ++col)
{ {
out.at(col,row) = std::conj(coldata[row]); const eT* coldata = out.colptr(col);
for(uword row=(col+1); row < N; ++row)
{
out.at(col,row) = coldata[row];
}
} }
} }
} }
} }
//! @} //! @}
 End of changes. 18 change blocks. 
32 lines changed or deleted 58 lines changed or added


 operator_cube_minus.hpp   operator_cube_minus.hpp 
skipping to change at line 28 skipping to change at line 28
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<T1, eop_neg>(X.get_ref()); return eOpCube<T1, eop_neg>(X.get_ref());
} }
//! cancellation of two consecutive negations: -(-T1) //! cancellation of two consecutive negations: -(-T1)
template<typename T1> template<typename T1>
arma_inline arma_inline
const T1& const typename ProxyCube<T1>::stored_type&
operator- operator-
( (
const eOpCube<T1, eop_neg>& X const eOpCube<T1, eop_neg>& X
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return X.m; return X.P.Q;
} }
//! BaseCube - scalar //! BaseCube - scalar
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOpCube<T1, eop_scalar_minus_post> const eOpCube<T1, eop_scalar_minus_post>
operator- operator-
( (
const BaseCube<typename T1::elem_type,T1>& X, const BaseCube<typename T1::elem_type,T1>& X,
const typename T1::elem_type k const typename T1::elem_type k
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 operator_minus.hpp   operator_minus.hpp 
skipping to change at line 28 skipping to change at line 28
(const T1& X) (const T1& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOp<T1,eop_neg>(X); return eOp<T1,eop_neg>(X);
} }
//! cancellation of two consecutive negations: -(-T1) //! cancellation of two consecutive negations: -(-T1)
template<typename T1> template<typename T1>
arma_inline arma_inline
const T1& const typename Proxy<T1>::stored_type&
operator- operator-
(const eOp<T1, eop_neg>& X) (const eOp<T1, eop_neg>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return X.m; return X.P.Q;
} }
//! Base - scalar //! Base - scalar
template<typename T1> template<typename T1>
arma_inline arma_inline
typename typename
enable_if2< is_arma_type<T1>::value, const eOp<T1, eop_scalar_minus_post> > ::result enable_if2< is_arma_type<T1>::value, const eOp<T1, eop_scalar_minus_post> > ::result
operator- operator-
( (
const T1& X, const T1& X,
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/