Col_bones.hpp   Col_bones.hpp 
skipping to change at line 91 skipping to change at line 91
arma_inline subview_col<eT> operator()(const span& row_span); arma_inline subview_col<eT> operator()(const span& row_span);
arma_inline const subview_col<eT> operator()(const span& row_span) const; arma_inline const subview_col<eT> operator()(const span& row_span) const;
inline void shed_row (const uword row_num); inline void shed_row (const uword row_num);
inline void shed_rows(const uword in_row1, const uword in_row2); inline void shed_rows(const uword in_row1, const uword in_row2);
inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero = true); inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero = true);
template<typename T1> inline void insert_rows(const uword row_num, const Base<eT,T1>& X); template<typename T1> inline void insert_rows(const uword row_num, const Base<eT,T1>& X);
arma_inline arma_warn_unused eT& at(const uword i); arma_inline arma_warn_unused eT& at(const uword i);
arma_inline arma_warn_unused eT at(const uword i) const; arma_inline arma_warn_unused const eT& at(const uword i) const;
arma_inline arma_warn_unused eT& at(const uword in_row, const uword in_co arma_inline arma_warn_unused eT& at(const uword in_row, const uword
l); in_col);
arma_inline arma_warn_unused eT at(const uword in_row, const uword in_co arma_inline arma_warn_unused const eT& at(const uword in_row, const uword
l) const; in_col) const;
typedef eT* row_iterator; typedef eT* row_iterator;
typedef const eT* const_row_iterator; typedef const eT* const_row_iterator;
inline row_iterator begin_row(const uword row_num); inline row_iterator begin_row(const uword row_num);
inline const_row_iterator begin_row(const uword row_num) const; inline const_row_iterator begin_row(const uword row_num) const;
inline row_iterator end_row (const uword row_num); inline row_iterator end_row (const uword row_num);
inline const_row_iterator end_row (const uword row_num) const; inline const_row_iterator end_row (const uword row_num) const;
skipping to change at line 127 skipping to change at line 127
}; };
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
class Col<eT>::fixed : public Col<eT> class Col<eT>::fixed : public Col<eT>
{ {
private: private:
static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc); static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
arma_inline void change_to_row(); arma_inline void change_to_row();
public: public:
typedef fixed<fixed_n_elem> Col_fixed_type; typedef fixed<fixed_n_elem> Col_fixed_type;
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;
skipping to change at line 175 skipping to change at line 175
#if defined(ARMA_USE_CXX11) #if defined(ARMA_USE_CXX11)
inline fixed(const std::initializer_list<eT>& list); inline fixed(const std::initializer_list<eT>& list);
inline const Col& operator=(const std::initializer_list<eT>& list); inline const Col& operator=(const std::initializer_list<eT>& list);
#endif #endif
arma_inline const Op< Col_fixed_type, op_htrans > t() const; arma_inline const Op< Col_fixed_type, op_htrans > t() const;
arma_inline const Op< Col_fixed_type, op_htrans > ht() const; arma_inline const Op< Col_fixed_type, op_htrans > ht() const;
arma_inline const Op< Col_fixed_type, op_strans > st() const; arma_inline const Op< Col_fixed_type, op_strans > st() const;
arma_inline arma_warn_unused eT& operator[] (const uword i); arma_inline arma_warn_unused const eT& at_alt (const uword i) const;
arma_inline arma_warn_unused eT operator[] (const uword i) const;
arma_inline arma_warn_unused eT& at (const uword i); arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT at (const uword i) const; arma_inline arma_warn_unused const eT& operator[] (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i); arma_inline arma_warn_unused eT& at (const uword i);
arma_inline arma_warn_unused eT operator() (const uword i) const; arma_inline arma_warn_unused const eT& at (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i);
arma_inline arma_warn_unused eT& at (const uword in_row, const uw arma_inline arma_warn_unused const eT& operator() (const uword i) const;
ord in_col);
arma_inline arma_warn_unused eT at (const uword in_row, const uw arma_inline arma_warn_unused eT& at (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uw arma_inline arma_warn_unused const eT& at (const uword in_row, co
ord in_col); nst uword in_col) const;
arma_inline arma_warn_unused eT operator() (const uword in_row, const uw arma_inline arma_warn_unused eT& operator() (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused const eT& operator() (const uword in_row, co
nst uword in_col) const;
arma_inline arma_warn_unused eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline arma_warn_unused const eT* memptr() const; arma_inline arma_warn_unused const eT* memptr() const;
arma_hot inline const Col<eT>& fill(const eT val); arma_hot inline const Col<eT>& fill(const eT val);
arma_hot inline const Col<eT>& zeros(); arma_hot inline const Col<eT>& zeros();
arma_hot inline const Col<eT>& ones(); arma_hot inline const Col<eT>& ones();
}; };
//! @} //! @}
 End of changes. 4 change blocks. 
22 lines changed or deleted 24 lines changed or added


 Col_meat.hpp   Col_meat.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2013 Conrad Sanderson
// //
// 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 Col //! \addtogroup Col
//! @{ //! @{
//! construct an empty column vector //! construct an empty column vector
template<typename eT> template<typename eT>
skipping to change at line 360 skipping to change at line 360
Col<eT>::st() const Col<eT>::st() const
{ {
return Op<Col<eT>,op_strans>(*this); return Op<Col<eT>,op_strans>(*this);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT& eT&
Col<eT>::row(const uword row_num) Col<eT>::row(const uword row_num)
{ {
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): out of bound s" ); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): index out of bounds" );
return access::rw(Mat<eT>::mem[row_num]); return access::rw(Mat<eT>::mem[row_num]);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
Col<eT>::row(const uword row_num) const Col<eT>::row(const uword row_num) const
{ {
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): out of bound s" ); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): index out of bounds" );
return Mat<eT>::mem[row_num]; return Mat<eT>::mem[row_num];
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::rows(const uword in_row1, const uword in_row2) Col<eT>::rows(const uword in_row1, const uword in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 499 skipping to change at line 499
} }
//! remove specified row //! remove specified row
template<typename eT> template<typename eT>
inline inline
void void
Col<eT>::shed_row(const uword row_num) Col<eT>::shed_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): out of bo unds"); arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): index out of bounds");
shed_rows(row_num, row_num); shed_rows(row_num, row_num);
} }
//! remove specified rows //! remove specified rows
template<typename eT> template<typename eT>
inline inline
void void
Col<eT>::shed_rows(const uword in_row1, const uword in_row2) Col<eT>::shed_rows(const uword in_row1, const uword in_row2)
{ {
skipping to change at line 554 skipping to change at line 554
Col<eT>::insert_rows(const uword row_num, const uword N, const bool set_to_ zero) Col<eT>::insert_rows(const uword row_num, const uword N, const bool set_to_ zero)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_rows = Mat<eT>::n_rows; const uword t_n_rows = Mat<eT>::n_rows;
const uword A_n_rows = row_num; const uword A_n_rows = row_num;
const uword B_n_rows = t_n_rows - row_num; const uword B_n_rows = t_n_rows - row_num;
// insertion at row_num == n_rows is in effect an append operation // insertion at row_num == n_rows is in effect an append operation
arma_debug_check( (row_num > t_n_rows), "Col::insert_rows(): out of bound s"); arma_debug_check( (row_num > t_n_rows), "Col::insert_rows(): index out of bounds");
if(N > 0) if(N > 0)
{ {
Col<eT> out(t_n_rows + N); Col<eT> out(t_n_rows + N);
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const eT* t_mem = (*this).memptr(); const eT* t_mem = (*this).memptr();
if(A_n_rows > 0) if(A_n_rows > 0)
{ {
skipping to change at line 607 skipping to change at line 607
arma_warn_unused arma_warn_unused
eT& eT&
Col<eT>::at(const uword i) Col<eT>::at(const uword i)
{ {
return access::rw(Mat<eT>::mem[i]); return access::rw(Mat<eT>::mem[i]);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::at(const uword i) const Col<eT>::at(const uword i) const
{ {
return Mat<eT>::mem[i]; return Mat<eT>::mem[i];
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Col<eT>::at(const uword in_row, const uword) Col<eT>::at(const uword in_row, const uword)
{ {
return access::rw( Mat<eT>::mem[in_row] ); return access::rw( Mat<eT>::mem[in_row] );
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::at(const uword in_row, const uword) const Col<eT>::at(const uword in_row, const uword) const
{ {
return Mat<eT>::mem[in_row]; return Mat<eT>::mem[in_row];
} }
template<typename eT> template<typename eT>
inline inline
typename Col<eT>::row_iterator typename Col<eT>::row_iterator
Col<eT>::begin_row(const uword row_num) Col<eT>::begin_row(const uword row_num)
{ {
skipping to change at line 925 skipping to change at line 925
const Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, o p_strans > const Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, o p_strans >
Col<eT>::fixed<fixed_n_elem>::st() const Col<eT>::fixed<fixed_n_elem>::st() const
{ {
return Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type , op_strans >(*this); return Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type , op_strans >(*this);
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const eT&
Col<eT>::fixed<fixed_n_elem>::at_alt(const uword ii) const
{
#if defined(ARMA_HAVE_ALIGNED_ATTRIBUTE)
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
#else
const eT* mem_aligned = (use_extra) ? mem_local_extra : Mat<eT>::mem_lo
cal;
memory::mark_as_aligned(mem_aligned);
return mem_aligned[ii];
#endif
}
template<typename eT>
template<uword fixed_n_elem>
arma_inline
arma_warn_unused
eT& eT&
Col<eT>::fixed<fixed_n_elem>::operator[] (const uword ii) Col<eT>::fixed<fixed_n_elem>::operator[] (const uword ii)
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::fixed<fixed_n_elem>::operator[] (const uword ii) const Col<eT>::fixed<fixed_n_elem>::operator[] (const uword ii) const
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Col<eT>::fixed<fixed_n_elem>::at(const uword ii) Col<eT>::fixed<fixed_n_elem>::at(const uword ii)
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::fixed<fixed_n_elem>::at(const uword ii) const Col<eT>::fixed<fixed_n_elem>::at(const uword ii) const
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii) Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii)
{ {
arma_debug_check( (ii >= fixed_n_elem), "Col::operator(): out of bounds") ; arma_debug_check( (ii >= fixed_n_elem), "Col::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const
{ {
arma_debug_check( (ii >= fixed_n_elem), "Col::operator(): out of bounds") ; arma_debug_check( (ii >= fixed_n_elem), "Col::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword) Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword)
{ {
return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ; return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword) const Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword) const
{ {
return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ; return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Col<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col) Col<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col)
{ {
arma_debug_check( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::opera tor(): out of bounds" ); arma_debug_check( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::opera tor(): index out of bounds" );
return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ; return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Col<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col) const Col<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col) const
{ {
arma_debug_check( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::opera tor(): out of bounds" ); arma_debug_check( ((in_row >= fixed_n_elem) || (in_col > 0)), "Col::opera tor(): index out of bounds" );
return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ; return (use_extra) ? mem_local_extra[in_row] : Mat<eT>::mem_local[in_row] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT* eT*
Col<eT>::fixed<fixed_n_elem>::memptr() Col<eT>::fixed<fixed_n_elem>::memptr()
 End of changes. 17 change blocks. 
17 lines changed or deleted 38 lines changed or added


 Cube_bones.hpp   Cube_bones.hpp 
skipping to change at line 43 skipping to change at line 43
// mem_state = 0: normal cube that can be resized; // mem_state = 0: normal cube that can be resized;
// mem_state = 1: use auxiliary memory until change in the number of elem ents is requested; // mem_state = 1: use auxiliary memory until change in the number of elem ents is requested;
// mem_state = 2: use auxiliary memory and don't allow the number of elem ents to be changed; // mem_state = 2: use auxiliary memory and don't allow the number of elem ents to be changed;
// mem_state = 3: fixed size (e.g. via template based size specification) . // mem_state = 3: fixed size (e.g. via template based size specification) .
arma_aligned const Mat<eT>** const mat_ptrs; //!< pointer to an array con taining pointers to Mat instances (one for each slice) arma_aligned const Mat<eT>** const mat_ptrs; //!< pointer to an array con taining pointers to Mat instances (one for each slice)
arma_aligned const eT* const mem; //!< pointer to the memory u sed by the cube (memory is read-only) arma_aligned const eT* const mem; //!< pointer to the memory u sed by the cube (memory is read-only)
protected: protected:
arma_aligned Mat<eT>* mat_ptrs_local[ Cube_prealloc::mat_ptrs_size ]; arma_aligned Mat<eT>* mat_ptrs_local[ Cube_prealloc::mat_ptrs_size ];
arma_aligned eT mem_local[ Cube_prealloc::mem_n_elem ]; arma_align_mem eT mem_local[ Cube_prealloc::mem_n_elem ];
public: public:
inline ~Cube(); inline ~Cube();
inline Cube(); inline Cube();
inline Cube(const uword in_rows, const uword in_cols, const uword in_slic es); inline Cube(const uword in_rows, const uword in_cols, const uword in_slic es);
inline Cube( eT* aux_mem, const uword aux_n_rows, const uword aux_n_ cols, const uword aux_n_slices, const bool copy_aux_mem = true, const bool strict = true); inline Cube( eT* aux_mem, const uword aux_n_rows, const uword aux_n_ cols, const uword aux_n_slices, const bool copy_aux_mem = true, const bool strict = true);
inline Cube(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_ cols, const uword aux_n_slices); inline Cube(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_ cols, const uword aux_n_slices);
skipping to change at line 152 skipping to change at line 152
template<typename T1, typename T2, typename eglue_type> inline const Cube & operator%=(const eGlueCube<T1, T2, eglue_type>& X); template<typename T1, typename T2, typename eglue_type> inline const Cube & operator%=(const eGlueCube<T1, T2, eglue_type>& X);
template<typename T1, typename T2, typename eglue_type> inline const Cube & operator/=(const eGlueCube<T1, T2, eglue_type>& X); template<typename T1, typename T2, typename eglue_type> inline const Cube & operator/=(const eGlueCube<T1, T2, eglue_type>& X);
template<typename T1, typename T2, typename glue_type> inline Cube(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline Cube(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator+=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator+=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator-=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator-=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator%=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator%=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator/=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator/=(const mtGlueCube<eT, T1, T2, glue_type>& X);
arma_inline arma_warn_unused eT& operator[] (const uword i); arma_inline arma_warn_unused const eT& at_alt (const uword i) const;
arma_inline arma_warn_unused eT operator[] (const uword i) const;
arma_inline arma_warn_unused eT& at(const uword i); arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT at(const uword i) const; arma_inline arma_warn_unused const eT& operator[] (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i); arma_inline arma_warn_unused eT& at(const uword i);
arma_inline arma_warn_unused eT operator() (const uword i) const; arma_inline arma_warn_unused const eT& at(const uword i) const;
arma_inline arma_warn_unused eT& at (const uword in_row, const uw arma_inline arma_warn_unused eT& operator() (const uword i);
ord in_col, const uword in_slice); arma_inline arma_warn_unused const eT& operator() (const uword i) const;
arma_inline arma_warn_unused eT at (const uword in_row, const uw
ord in_col, const uword in_slice) const;
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uw arma_inline arma_warn_unused eT& at (const uword in_row, co
ord in_col, const uword in_slice); nst uword in_col, const uword in_slice);
arma_inline arma_warn_unused eT operator() (const uword in_row, const uw arma_inline arma_warn_unused const eT& at (const uword in_row, co
ord in_col, const uword in_slice) const; nst uword in_col, const uword in_slice) const;
arma_inline arma_warn_unused eT& operator() (const uword in_row, co
nst uword in_col, const uword in_slice);
arma_inline arma_warn_unused const eT& operator() (const uword in_row, co
nst uword in_col, const uword in_slice) const;
arma_inline const Cube& operator++(); arma_inline const Cube& operator++();
arma_inline void operator++(int); arma_inline void operator++(int);
arma_inline const Cube& operator--(); arma_inline const Cube& operator--();
arma_inline void operator--(int); arma_inline void operator--(int);
arma_inline arma_warn_unused bool is_finite() const; arma_inline arma_warn_unused bool is_finite() const;
arma_inline arma_warn_unused bool is_empty() const; arma_inline arma_warn_unused bool is_empty() const;
skipping to change at line 314 skipping to change at line 316
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
class Cube<eT>::fixed : public Cube<eT> class Cube<eT>::fixed : public Cube<eT>
{ {
private: private:
static const uword fixed_n_elem = fixed_n_rows * fixed_n_cols * fix ed_n_slices; static const uword fixed_n_elem = fixed_n_rows * fixed_n_cols * fix ed_n_slices;
static const uword fixed_n_elem_slice = fixed_n_rows * fixed_n_cols; static const uword fixed_n_elem_slice = fixed_n_rows * fixed_n_cols;
static const bool use_extra = (fixed_n_elem > Cube_prealloc::mem_n_elem); static const bool use_extra = (fixed_n_elem > Cube_prealloc::mem_n_elem);
arma_aligned Mat<eT>* mat_ptrs_local_extra[ (fixed_n_slices > Cube_preall arma_aligned Mat<eT>* mat_ptrs_local_extra[ (fixed_n_slices > Cube_prea
oc::mat_ptrs_size) ? fixed_n_slices : 1 ]; lloc::mat_ptrs_size) ? fixed_n_slices : 1 ];
arma_aligned eT mem_local_extra [ use_extra arma_align_mem eT mem_local_extra [ use_extra
? fixed_n_elem : 1 ]; ? fixed_n_elem : 1 ];
arma_inline void mem_setup(); arma_inline void mem_setup();
public: public:
inline fixed() { mem_setup(); } inline fixed() { mem_setup(); }
inline const Cube& operator=(const eT val) { mem_setup(); Cube<eT>::opera tor=(val); return *this; } inline const Cube& operator=(const eT val) { mem_setup(); Cube<eT>::opera tor=(val); return *this; }
template<typename T1> template<typename T1>
inline fixed(const BaseCube<eT,T1>& A) { mem_setup(); Cube<eT>::operator= (A.get_ref()); } inline fixed(const BaseCube<eT,T1>& A) { mem_setup(); Cube<eT>::operator= (A.get_ref()); }
template<typename T1> template<typename T1>
inline const Cube& operator=(const BaseCube<eT,T1>& A) { Cube<eT>::operat or=(A.get_ref()); return *this; } inline const Cube& operator=(const BaseCube<eT,T1>& A) { Cube<eT>::operat or=(A.get_ref()); return *this; }
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit fixed(const BaseCube<pod_type,T1>& A, const BaseCube<pod_ type,T2>& B) { mem_setup(); Cube<eT>::init(A,B); } inline explicit fixed(const BaseCube<pod_type,T1>& A, const BaseCube<pod_ type,T2>& B) { mem_setup(); Cube<eT>::init(A,B); }
using Cube<eT>::operator(); using Cube<eT>::operator();
arma_inline arma_warn_unused eT& operator[] (const uword i); arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT operator[] (const uword i) const; arma_inline arma_warn_unused const eT& operator[] (const uword i) const;
arma_inline arma_warn_unused eT& at (const uword i); arma_inline arma_warn_unused eT& at (const uword i);
arma_inline arma_warn_unused eT at (const uword i) const; arma_inline arma_warn_unused const eT& at (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i); arma_inline arma_warn_unused eT& operator() (const uword i);
arma_inline arma_warn_unused eT operator() (const uword i) const; arma_inline arma_warn_unused const eT& operator() (const uword i) const;
arma_inline arma_warn_unused eT& at (const uword in_row, const uw arma_inline arma_warn_unused eT& at (const uword in_row, co
ord in_col, const uword in_slice); nst uword in_col, const uword in_slice);
arma_inline arma_warn_unused eT at (const uword in_row, const uw arma_inline arma_warn_unused const eT& at (const uword in_row, co
ord in_col, const uword in_slice) const; nst uword in_col, const uword in_slice) const;
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uw arma_inline arma_warn_unused eT& operator() (const uword in_row, co
ord in_col, const uword in_slice); nst uword in_col, const uword in_slice);
arma_inline arma_warn_unused eT operator() (const uword in_row, const uw arma_inline arma_warn_unused const eT& operator() (const uword in_row, co
ord in_col, const uword in_slice) const; nst uword in_col, const uword in_slice) const;
}; };
class Cube_aux class Cube_aux
{ {
public: public:
template<typename eT> arma_inline static void prefix_pp(Cube<eT>& x); template<typename eT> arma_inline static void prefix_pp(Cube<eT>& x);
template<typename T> arma_inline static void prefix_pp(Cube< std::comple x<T> >& x); template<typename T> arma_inline static void prefix_pp(Cube< std::comple x<T> >& x);
template<typename eT> arma_inline static void postfix_pp(Cube<eT>& x); template<typename eT> arma_inline static void postfix_pp(Cube<eT>& x);
 End of changes. 12 change blocks. 
34 lines changed or deleted 36 lines changed or added


 Cube_meat.hpp   Cube_meat.hpp 
skipping to change at line 901 skipping to change at line 901
} }
//! remove specified slice //! remove specified slice
template<typename eT> template<typename eT>
inline inline
void void
Cube<eT>::shed_slice(const uword slice_num) Cube<eT>::shed_slice(const uword slice_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( slice_num >= n_slices, "Cube::shed_slice(): out of boun ds"); arma_debug_check( slice_num >= n_slices, "Cube::shed_slice(): index out o f bounds");
shed_slices(slice_num, slice_num); shed_slices(slice_num, slice_num);
} }
//! remove specified slices //! remove specified slices
template<typename eT> template<typename eT>
inline inline
void void
Cube<eT>::shed_slices(const uword in_slice1, const uword in_slice2) Cube<eT>::shed_slices(const uword in_slice1, const uword in_slice2)
{ {
skipping to change at line 953 skipping to change at line 953
Cube<eT>::insert_slices(const uword slice_num, const uword N, const bool se t_to_zero) Cube<eT>::insert_slices(const uword slice_num, const uword N, const bool se t_to_zero)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_slices = n_slices; const uword t_n_slices = n_slices;
const uword A_n_slices = slice_num; const uword A_n_slices = slice_num;
const uword B_n_slices = t_n_slices - slice_num; const uword B_n_slices = t_n_slices - slice_num;
// insertion at slice_num == n_slices is in effect an append operation // insertion at slice_num == n_slices is in effect an append operation
arma_debug_check( (slice_num > t_n_slices), "Cube::insert_slices(): out o f bounds"); arma_debug_check( (slice_num > t_n_slices), "Cube::insert_slices(): index out of bounds");
if(N > 0) if(N > 0)
{ {
Cube<eT> out(n_rows, n_cols, t_n_slices + N); Cube<eT> out(n_rows, n_cols, t_n_slices + N);
if(A_n_slices > 0) if(A_n_slices > 0)
{ {
out.slices(0, A_n_slices-1) = slices(0, A_n_slices-1); out.slices(0, A_n_slices-1) = slices(0, A_n_slices-1);
} }
skipping to change at line 1004 skipping to change at line 1004
const Cube<eT>& C = tmp.M; const Cube<eT>& C = tmp.M;
const uword N = C.n_slices; const uword N = C.n_slices;
const uword t_n_slices = n_slices; const uword t_n_slices = n_slices;
const uword A_n_slices = slice_num; const uword A_n_slices = slice_num;
const uword B_n_slices = t_n_slices - slice_num; const uword B_n_slices = t_n_slices - slice_num;
// insertion at slice_num == n_slices is in effect an append operation // insertion at slice_num == n_slices is in effect an append operation
arma_debug_check( (slice_num > t_n_slices), "Cube::insert_slices(): out of bounds"); arma_debug_check( (slice_num > t_n_slices), "Cube::insert_slices(): ind ex out of bounds");
arma_debug_check arma_debug_check
( (
( (C.n_rows != n_rows) || (C.n_cols != n_cols) ), ( (C.n_rows != n_rows) || (C.n_cols != n_cols) ),
"Cube::insert_slices(): given object has an incompatible dimensions" "Cube::insert_slices(): given object has incompatible dimensions"
); );
if(N > 0) if(N > 0)
{ {
Cube<eT> out(n_rows, n_cols, t_n_slices + N); Cube<eT> out(n_rows, n_cols, t_n_slices + N);
if(A_n_slices > 0) if(A_n_slices > 0)
{ {
out.slices(0, A_n_slices-1) = slices(0, A_n_slices-1); out.slices(0, A_n_slices-1) = slices(0, A_n_slices-1);
} }
skipping to change at line 1740 skipping to change at line 1740
const Cube<eT>& const Cube<eT>&
Cube<eT>::operator/=(const mtGlueCube<eT, T1, T2, glue_type>& X) Cube<eT>::operator/=(const mtGlueCube<eT, T1, T2, glue_type>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const Cube<eT> m(X); const Cube<eT> m(X);
return (*this).operator/=(m); return (*this).operator/=(m);
} }
//! linear element accessor (treats the cube as a vector); no bounds check;
assumes memory is aligned
template<typename eT>
arma_inline
arma_warn_unused
const eT&
Cube<eT>::at_alt(const uword i) const
{
const eT* mem_aligned = mem;
memory::mark_as_aligned(mem_aligned);
return mem_aligned[i];
}
//! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::operator() (const uword i) Cube<eT>::operator() (const uword i)
{ {
arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ; arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ;
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::operator() (const uword i) const Cube<eT>::operator() (const uword i) const
{ {
arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ; arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ;
return mem[i]; return mem[i];
} }
//! linear element accessor (treats the cube as a vector); no bounds check. //! linear element accessor (treats the cube as a vector); no bounds check.
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::operator[] (const uword i) Cube<eT>::operator[] (const uword i)
{ {
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! linear element accessor (treats the cube as a vector); no bounds check //! linear element accessor (treats the cube as a vector); no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::operator[] (const uword i) const Cube<eT>::operator[] (const uword i) const
{ {
return mem[i]; return mem[i];
} }
//! linear element accessor (treats the cube as a vector); no bounds check. //! linear element accessor (treats the cube as a vector); no bounds check.
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::at(const uword i) Cube<eT>::at(const uword i)
{ {
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! linear element accessor (treats the cube as a vector); no bounds check //! linear element accessor (treats the cube as a vector); no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::at(const uword i) const Cube<eT>::at(const uword i) const
{ {
return mem[i]; return mem[i];
} }
//! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d //! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
skipping to change at line 1825 skipping to change at line 1838
"Cube::operator(): index out of bounds" "Cube::operator(): index out of bounds"
); );
return access::rw(mem[in_slice*n_elem_slice + in_col*n_rows + in_row]); return access::rw(mem[in_slice*n_elem_slice + in_col*n_rows + in_row]);
} }
//! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d //! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::operator() (const uword in_row, const uword in_col, const uword i n_slice) const Cube<eT>::operator() (const uword in_row, const uword in_col, const uword i n_slice) const
{ {
arma_debug_check arma_debug_check
( (
(in_row >= n_rows) || (in_row >= n_rows) ||
(in_col >= n_cols) || (in_col >= n_cols) ||
(in_slice >= n_slices) (in_slice >= n_slices)
, ,
"Cube::operator(): index out of bounds" "Cube::operator(): index out of bounds"
); );
skipping to change at line 1854 skipping to change at line 1867
eT& eT&
Cube<eT>::at(const uword in_row, const uword in_col, const uword in_slice) Cube<eT>::at(const uword in_row, const uword in_col, const uword in_slice)
{ {
return access::rw( mem[in_slice*n_elem_slice + in_col*n_rows + in_row] ); return access::rw( mem[in_slice*n_elem_slice + in_col*n_rows + in_row] );
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::at(const uword in_row, const uword in_col, const uword in_slice) const Cube<eT>::at(const uword in_row, const uword in_col, const uword in_slice) const
{ {
return mem[in_slice*n_elem_slice + in_col*n_rows + in_row]; return mem[in_slice*n_elem_slice + in_col*n_rows + in_row];
} }
//! prefix ++ //! prefix ++
template<typename eT> template<typename eT>
arma_inline arma_inline
const Cube<eT>& const Cube<eT>&
Cube<eT>::operator++() Cube<eT>::operator++()
skipping to change at line 2973 skipping to change at line 2986
eT& eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator[] (co nst uword i) Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator[] (co nst uword i)
{ {
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator[] (co nst uword i) const Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator[] (co nst uword i) const
{ {
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword i) Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword i)
{ {
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword i) const Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword i) const
{ {
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword i) Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword i)
{ {
arma_debug_check( (i >= fixed_n_elem), "Cube::operator(): out of bounds") ; arma_debug_check( (i >= fixed_n_elem), "Cube::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword i) const Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword i) const
{ {
arma_debug_check( (i >= fixed_n_elem), "Cube::operator(): out of bounds") ; arma_debug_check( (i >= fixed_n_elem), "Cube::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword in_row, const uword in_col, const uword in_slice) Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword in_row, const uword in_col, const uword in_slice)
{ {
const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_ro w; const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_ro w;
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword in_row, const uword in_col, const uword in_slice) const Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword in_row, const uword in_col, const uword in_slice) const
{ {
const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_ro w; const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_ro w;
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword in_row, const uword in_col, const uword in_slice) Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword in_row, const uword in_col, const uword in_slice)
{ {
arma_debug_check arma_debug_check
( (
(in_row >= fixed_n_rows ) || (in_row >= fixed_n_rows ) ||
(in_col >= fixed_n_cols ) || (in_col >= fixed_n_cols ) ||
(in_slice >= fixed_n_slices) (in_slice >= fixed_n_slices)
, ,
"Cube::operator(): index out of bounds" "operator(): index out of bounds"
); );
const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_ro w; const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_ro w;
return (use_extra) ? mem_local_extra[i] : mem_local[i]; return (use_extra) ? mem_local_extra[i] : mem_local[i];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices> template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword in_row, const uword in_col, const uword in_slice) const Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (co nst uword in_row, const uword in_col, const uword in_slice) const
{ {
arma_debug_check arma_debug_check
( (
(in_row >= fixed_n_rows ) || (in_row >= fixed_n_rows ) ||
(in_col >= fixed_n_cols ) || (in_col >= fixed_n_cols ) ||
(in_slice >= fixed_n_slices) (in_slice >= fixed_n_slices)
, ,
"Cube::operator(): index out of bounds" "Cube::operator(): index out of bounds"
); );
 End of changes. 18 change blocks. 
17 lines changed or deleted 31 lines changed or added


 GenCube_bones.hpp   GenCube_bones.hpp 
// Copyright (C) 2011 NICTA (www.nicta.com.au) // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2011 Conrad Sanderson // Copyright (C) 2011-2013 Conrad Sanderson
// //
// 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 GenCube //! \addtogroup GenCube
//! @{ //! @{
//! support class for generator functions (eg. zeros, randu, randn, ...) //! support class for generator functions (eg. zeros, randu, randn, ...)
template<typename eT, typename gen_type> template<typename eT, typename gen_type>
skipping to change at line 33 skipping to change at line 33
arma_aligned const uword n_cols; arma_aligned const uword n_cols;
arma_aligned const uword n_slices; arma_aligned 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(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
arma_inline ~GenCube(); arma_inline ~GenCube();
arma_inline static eT generate(); arma_inline static eT generate();
arma_inline eT operator[] (const uword i) const; arma_inline eT operator[] (const uword i) const;
arma_inline eT at (const uword row, const uword col, const uword slice) const; arma_inline eT at (const uword row, const uword col, const uword slice) const;
arma_inline eT at_alt (const uword i) const;
inline void apply (Cube<eT>& out) const; inline void apply (Cube<eT>& out) const;
inline void apply_inplace_plus (Cube<eT>& out) const; inline void apply_inplace_plus (Cube<eT>& out) const;
inline void apply_inplace_minus(Cube<eT>& out) const; inline void apply_inplace_minus(Cube<eT>& out) const;
inline void apply_inplace_schur(Cube<eT>& out) const; inline void apply_inplace_schur(Cube<eT>& out) const;
inline void apply_inplace_div (Cube<eT>& out) const; inline void apply_inplace_div (Cube<eT>& out) const;
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 GenCube_meat.hpp   GenCube_meat.hpp 
// Copyright (C) 2011 NICTA (www.nicta.com.au) // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2011 Conrad Sanderson // Copyright (C) 2011-2013 Conrad Sanderson
// //
// 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 Gen //! \addtogroup Gen
//! @{ //! @{
template<typename eT, typename gen_type> template<typename eT, typename gen_type>
arma_inline arma_inline
skipping to change at line 57 skipping to change at line 57
template<typename eT, typename gen_type> template<typename eT, typename gen_type>
arma_inline arma_inline
eT eT
GenCube<eT, gen_type>::at(const uword, const uword, const uword) const GenCube<eT, gen_type>::at(const uword, const uword, const uword) const
{ {
return GenCube<eT, gen_type>::generate(); return GenCube<eT, gen_type>::generate();
} }
template<typename eT, typename gen_type> template<typename eT, typename gen_type>
arma_inline
eT
GenCube<eT, gen_type>::at_alt(const uword) const
{
return GenCube<eT, gen_type>::generate();
}
template<typename eT, typename gen_type>
inline inline
void void
GenCube<eT, gen_type>::apply(Cube<eT>& out) const GenCube<eT, gen_type>::apply(Cube<eT>& out) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// NOTE: we're assuming that the cube has already been set to the correct size; // NOTE: we're assuming that the cube has already been set to the correct size;
// this is done by either the Cube contructor or operator=() // this is done by either the Cube contructor or operator=()
if(is_same_type<gen_type, gen_ones_full>::value == true) { out.ones( ); } if(is_same_type<gen_type, gen_ones_full>::value == true) { out.ones( ); }
 End of changes. 2 change blocks. 
2 lines changed or deleted 10 lines changed or added


 Gen_bones.hpp   Gen_bones.hpp 
// Copyright (C) 2011-2012 NICTA (www.nicta.com.au) // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2011-2012 Conrad Sanderson // Copyright (C) 2011-2013 Conrad Sanderson
// //
// 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 Gen //! \addtogroup Gen
//! @{ //! @{
//! support class for generator functions (eg. zeros, randu, randn, ...) //! support class for generator functions (eg. zeros, randu, randn, ...)
template<typename T1, typename gen_type> template<typename T1, typename gen_type>
skipping to change at line 35 skipping to change at line 35
arma_aligned const uword n_rows; arma_aligned const uword n_rows;
arma_aligned const uword n_cols; arma_aligned const uword n_cols;
arma_inline Gen(const uword in_n_rows, const uword in_n_cols); arma_inline Gen(const uword in_n_rows, const uword in_n_cols);
arma_inline ~Gen(); arma_inline ~Gen();
arma_inline static elem_type generate(); arma_inline static elem_type generate();
arma_inline elem_type operator[] (const uword ii) const ; arma_inline elem_type operator[] (const uword ii) const ;
arma_inline elem_type at (const uword row, const uword col) const ; arma_inline elem_type at (const uword row, const uword col) const ;
arma_inline elem_type at_alt (const uword ii) const ;
inline void apply (Mat<elem_type>& out) const; inline void apply (Mat<elem_type>& out) const;
inline void apply_inplace_plus (Mat<elem_type>& out) const; inline void apply_inplace_plus (Mat<elem_type>& out) const;
inline void apply_inplace_minus(Mat<elem_type>& out) const; inline void apply_inplace_minus(Mat<elem_type>& out) const;
inline void apply_inplace_schur(Mat<elem_type>& out) const; inline void apply_inplace_schur(Mat<elem_type>& out) const;
inline void apply_inplace_div (Mat<elem_type>& out) const; inline void apply_inplace_div (Mat<elem_type>& out) const;
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 Gen_meat.hpp   Gen_meat.hpp 
// Copyright (C) 2011-2012 NICTA (www.nicta.com.au) // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2011-2012 Conrad Sanderson // Copyright (C) 2011-2013 Conrad Sanderson
// //
// 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 Gen //! \addtogroup Gen
//! @{ //! @{
template<typename T1, typename gen_type> template<typename T1, typename gen_type>
arma_inline arma_inline
skipping to change at line 76 skipping to change at line 76
{ {
return (row == col) ? eT(1) : eT(0); return (row == col) ? eT(1) : eT(0);
} }
else else
{ {
return Gen<T1, gen_type>::generate(); return Gen<T1, gen_type>::generate();
} }
} }
template<typename T1, typename gen_type> template<typename T1, typename gen_type>
arma_inline
typename T1::elem_type
Gen<T1, gen_type>::at_alt(const uword ii) const
{
return operator[](ii);
}
template<typename T1, typename gen_type>
inline inline
void void
Gen<T1, gen_type>::apply(Mat<typename T1::elem_type>& out) const Gen<T1, gen_type>::apply(Mat<typename T1::elem_type>& out) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// NOTE: we're assuming that the matrix has already been set to the corre ct size; // NOTE: we're assuming that the matrix has already been set to the corre ct size;
// this is done by either the Mat contructor or operator=() // this is done by either the Mat contructor or operator=()
if(is_same_type<gen_type, gen_ones_diag>::value == true) { out.eye() ; } if(is_same_type<gen_type, gen_ones_diag>::value == true) { out.eye() ; }
 End of changes. 2 change blocks. 
2 lines changed or deleted 10 lines changed or added


 Mat_bones.hpp   Mat_bones.hpp 
skipping to change at line 39 skipping to change at line 39
const uhword mem_state; const uhword mem_state;
// mem_state = 0: normal matrix that can be resized; // mem_state = 0: normal matrix that can be resized;
// mem_state = 1: use auxiliary memory until change in the number of elem ents is requested; // mem_state = 1: use auxiliary memory until change in the number of elem ents is requested;
// mem_state = 2: use auxiliary memory and don't allow the number of elem ents to be changed; // mem_state = 2: use auxiliary memory and don't allow the number of elem ents to be changed;
// mem_state = 3: fixed size (e.g. via template based size specification) . // mem_state = 3: fixed size (e.g. via template based size specification) .
arma_aligned const eT* const mem; //!< pointer to the memory used by the matrix (memory is read-only) arma_aligned const eT* const mem; //!< pointer to the memory used by the matrix (memory is read-only)
protected: protected:
arma_aligned eT mem_local[ arma_config::mat_prealloc ]; arma_align_mem eT mem_local[ arma_config::mat_prealloc ];
public: public:
inline ~Mat(); inline ~Mat();
inline Mat(); inline Mat();
inline Mat(const uword in_rows, const uword in_cols); inline Mat(const uword in_rows, const uword in_cols);
inline Mat(const char* text); inline Mat(const char* text);
inline const Mat& operator=(const char* text); inline const Mat& operator=(const char* text);
skipping to change at line 282 skipping to change at line 282
template<typename T1, typename T2, typename eglue_type> inline const Mat& operator/=(const eGlue<T1, T2, eglue_type>& X); template<typename T1, typename T2, typename eglue_type> inline const Mat& operator/=(const eGlue<T1, T2, eglue_type>& X);
template<typename T1, typename T2, typename glue_type> inline Mat(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline Mat(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator+=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator+=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator-=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator-=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator*=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator*=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator%=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator%=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator/=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator/=(const mtGlue<eT, T1, T2, glue_type>& X);
arma_inline arma_warn_unused eT& operator[] (const uword ii); arma_inline arma_warn_unused const eT& at_alt (const uword ii) const;
arma_inline arma_warn_unused eT operator[] (const uword ii) const;
arma_inline arma_warn_unused eT& at (const uword ii); arma_inline arma_warn_unused eT& operator[] (const uword ii);
arma_inline arma_warn_unused eT at (const uword ii) const; arma_inline arma_warn_unused const eT& operator[] (const uword ii) const;
arma_inline arma_warn_unused eT& operator() (const uword ii); arma_inline arma_warn_unused eT& at (const uword ii);
arma_inline arma_warn_unused eT operator() (const uword ii) const; arma_inline arma_warn_unused const eT& at (const uword ii) const;
arma_inline arma_warn_unused eT& operator() (const uword ii);
arma_inline arma_warn_unused eT& at (const uword in_row, const uw arma_inline arma_warn_unused const eT& operator() (const uword ii) const;
ord in_col);
arma_inline arma_warn_unused eT at (const uword in_row, const uw arma_inline arma_warn_unused eT& at (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uw arma_inline arma_warn_unused const eT& at (const uword in_row, co
ord in_col); nst uword in_col) const;
arma_inline arma_warn_unused eT operator() (const uword in_row, const uw arma_inline arma_warn_unused eT& operator() (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused const eT& operator() (const uword in_row, co
nst uword in_col) const;
arma_inline const Mat& operator++(); arma_inline const Mat& operator++();
arma_inline void operator++(int); arma_inline void operator++(int);
arma_inline const Mat& operator--(); arma_inline const Mat& operator--();
arma_inline void operator--(int); arma_inline void operator--(int);
arma_inline arma_warn_unused bool is_empty() const; arma_inline arma_warn_unused bool is_empty() const;
arma_inline arma_warn_unused bool is_vec() const; arma_inline arma_warn_unused bool is_vec() const;
arma_inline arma_warn_unused bool is_rowvec() const; arma_inline arma_warn_unused bool is_rowvec() const;
skipping to change at line 519 skipping to change at line 521
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
class Mat<eT>::fixed : public Mat<eT> class Mat<eT>::fixed : public Mat<eT>
{ {
private: private:
static const uword fixed_n_elem = fixed_n_rows * fixed_n_cols; static const uword fixed_n_elem = fixed_n_rows * fixed_n_cols;
static const bool use_extra = (fixed_n_elem > arma_config::mat_preall oc); static const bool use_extra = (fixed_n_elem > arma_config::mat_preall oc);
arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
public: public:
typedef fixed<fixed_n_rows, fixed_n_cols> Mat_fixed_type; typedef fixed<fixed_n_rows, fixed_n_cols> Mat_fixed_type;
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;
static const bool is_col = (fixed_n_cols == 1) ? true : false; static const bool is_col = (fixed_n_cols == 1) ? true : false;
static const bool is_row = (fixed_n_rows == 1) ? true : false; static const bool is_row = (fixed_n_rows == 1) ? true : false;
skipping to change at line 558 skipping to change at line 560
#if defined(ARMA_USE_CXX11) #if defined(ARMA_USE_CXX11)
inline fixed(const std::initializer_list<eT>& list); inline fixed(const std::initializer_list<eT>& list);
inline const Mat& operator=(const std::initializer_list<eT>& list); inline const Mat& operator=(const std::initializer_list<eT>& list);
#endif #endif
arma_inline const Op< Mat_fixed_type, op_htrans > t() const; arma_inline const Op< Mat_fixed_type, op_htrans > t() const;
arma_inline const Op< Mat_fixed_type, op_htrans > ht() const; arma_inline const Op< Mat_fixed_type, op_htrans > ht() const;
arma_inline const Op< Mat_fixed_type, op_strans > st() const; arma_inline const Op< Mat_fixed_type, op_strans > st() const;
arma_inline arma_warn_unused eT& operator[] (const uword i); arma_inline arma_warn_unused const eT& at_alt (const uword i) const;
arma_inline arma_warn_unused eT operator[] (const uword i) const;
arma_inline arma_warn_unused eT& at (const uword i); arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT at (const uword i) const; arma_inline arma_warn_unused const eT& operator[] (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i); arma_inline arma_warn_unused eT& at (const uword i);
arma_inline arma_warn_unused eT operator() (const uword i) const; arma_inline arma_warn_unused const eT& at (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i);
arma_inline arma_warn_unused eT& at (const uword in_row, const uw arma_inline arma_warn_unused const eT& operator() (const uword i) const;
ord in_col);
arma_inline arma_warn_unused eT at (const uword in_row, const uw arma_inline arma_warn_unused eT& at (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uw arma_inline arma_warn_unused const eT& at (const uword in_row, co
ord in_col); nst uword in_col) const;
arma_inline arma_warn_unused eT operator() (const uword in_row, const uw arma_inline arma_warn_unused eT& operator() (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused const eT& operator() (const uword in_row, co
nst uword in_col) const;
arma_inline arma_warn_unused eT* colptr(const uword in_col); arma_inline arma_warn_unused eT* colptr(const uword in_col);
arma_inline arma_warn_unused const eT* colptr(const uword in_col) const; arma_inline arma_warn_unused const eT* colptr(const uword in_col) const;
arma_inline arma_warn_unused eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline arma_warn_unused const eT* memptr() const; arma_inline arma_warn_unused const eT* memptr() const;
arma_inline arma_warn_unused bool is_vec() const; arma_inline arma_warn_unused bool is_vec() const;
arma_hot inline const Mat<eT>& fill(const eT val); arma_hot inline const Mat<eT>& fill(const eT val);
 End of changes. 4 change blocks. 
32 lines changed or deleted 36 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
skipping to change at line 2143 skipping to change at line 2143
} }
//! creation of subview (row vector) //! creation of subview (row vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Mat<eT>::row(const uword row_num) Mat<eT>::row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= n_rows, "Mat::row(): out of bounds" ); arma_debug_check( row_num >= n_rows, "Mat::row(): index out of bounds" );
return subview_row<eT>(*this, row_num); return subview_row<eT>(*this, row_num);
} }
//! creation of subview (row vector) //! creation of subview (row vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Mat<eT>::row(const uword row_num) const Mat<eT>::row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= n_rows, "Mat::row(): out of bounds" ); arma_debug_check( row_num >= n_rows, "Mat::row(): index out of bounds" );
return subview_row<eT>(*this, row_num); return subview_row<eT>(*this, row_num);
} }
template<typename eT> template<typename eT>
inline inline
subview_row<eT> subview_row<eT>
Mat<eT>::operator()(const uword row_num, const span& col_span) Mat<eT>::operator()(const uword row_num, const span& col_span)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 2223 skipping to change at line 2223
} }
//! creation of subview (column vector) //! creation of subview (column vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Mat<eT>::col(const uword col_num) Mat<eT>::col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::col(): index out of bounds");
return subview_col<eT>(*this, col_num); return subview_col<eT>(*this, col_num);
} }
//! creation of subview (column vector) //! creation of subview (column vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Mat<eT>::col(const uword col_num) const Mat<eT>::col(const uword col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::col(): index out of bounds");
return subview_col<eT>(*this, col_num); return subview_col<eT>(*this, col_num);
} }
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
Mat<eT>::operator()(const span& row_span, const uword col_num) Mat<eT>::operator()(const span& row_span, const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 2307 skipping to change at line 2307
//! and does not take into account that the parent matrix object could be d eleted. //! and does not take into account that the parent matrix object could be d eleted.
//! if deleted memory is accessed by the created Col object, //! if deleted memory is accessed by the created Col object,
//! it will cause memory corruption and/or a crash //! it will cause memory corruption and/or a crash
template<typename eT> template<typename eT>
inline inline
Col<eT> Col<eT>
Mat<eT>::unsafe_col(const uword col_num) Mat<eT>::unsafe_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::unsafe_col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::unsafe_col(): index out of bou nds");
return Col<eT>(colptr(col_num), n_rows, false, true); return Col<eT>(colptr(col_num), n_rows, false, true);
} }
//! create a Col object which uses memory from an existing matrix object. //! create a Col object which uses memory from an existing matrix object.
//! this approach is currently not alias safe //! this approach is currently not alias safe
//! and does not take into account that the parent matrix object could be d eleted. //! and does not take into account that the parent matrix object could be d eleted.
//! if deleted memory is accessed by the created Col object, //! if deleted memory is accessed by the created Col object,
//! it will cause memory corruption and/or a crash //! it will cause memory corruption and/or a crash
template<typename eT> template<typename eT>
inline inline
const Col<eT> const Col<eT>
Mat<eT>::unsafe_col(const uword col_num) const Mat<eT>::unsafe_col(const uword col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::unsafe_col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::unsafe_col(): index out of bou nds");
typedef const Col<eT> out_type; typedef const Col<eT> out_type;
return out_type(const_cast<eT*>(colptr(col_num)), n_rows, false, true); return out_type(const_cast<eT*>(colptr(col_num)), n_rows, false, true);
} }
//! creation of subview (submatrix comprised of specified row vectors) //! creation of subview (submatrix comprised of specified row vectors)
template<typename eT> template<typename eT>
arma_inline arma_inline
subview<eT> subview<eT>
skipping to change at line 2788 skipping to change at line 2788
Mat<eT>::swap_rows(const uword in_row1, const uword in_row2) Mat<eT>::swap_rows(const uword in_row1, const uword in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword local_n_rows = n_rows; const uword local_n_rows = n_rows;
const uword local_n_cols = n_cols; const uword local_n_cols = n_cols;
arma_debug_check arma_debug_check
( (
(in_row1 >= local_n_rows) || (in_row2 >= local_n_rows), (in_row1 >= local_n_rows) || (in_row2 >= local_n_rows),
"Mat::swap_rows(): out of bounds" "Mat::swap_rows(): index out of bounds"
); );
if(n_elem > 0) if(n_elem > 0)
{ {
for(uword ucol=0; ucol < local_n_cols; ++ucol) for(uword ucol=0; ucol < local_n_cols; ++ucol)
{ {
const uword offset = ucol * local_n_rows; const uword offset = ucol * local_n_rows;
const uword pos1 = in_row1 + offset; const uword pos1 = in_row1 + offset;
const uword pos2 = in_row2 + offset; const uword pos2 = in_row2 + offset;
skipping to change at line 2817 skipping to change at line 2817
Mat<eT>::swap_cols(const uword in_colA, const uword in_colB) Mat<eT>::swap_cols(const uword in_colA, const uword in_colB)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword local_n_rows = n_rows; const uword local_n_rows = n_rows;
const uword local_n_cols = n_cols; const uword local_n_cols = n_cols;
arma_debug_check arma_debug_check
( (
(in_colA >= local_n_cols) || (in_colB >= local_n_cols), (in_colA >= local_n_cols) || (in_colB >= local_n_cols),
"Mat::swap_cols(): out of bounds" "Mat::swap_cols(): index out of bounds"
); );
if(n_elem > 0) if(n_elem > 0)
{ {
eT* ptrA = colptr(in_colA); eT* ptrA = colptr(in_colA);
eT* ptrB = colptr(in_colB); eT* ptrB = colptr(in_colB);
eT tmp_i; eT tmp_i;
eT tmp_j; eT tmp_j;
skipping to change at line 2856 skipping to change at line 2856
} }
//! remove specified row //! remove specified row
template<typename eT> template<typename eT>
inline inline
void void
Mat<eT>::shed_row(const uword row_num) Mat<eT>::shed_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= n_rows, "Mat::shed_row(): out of bounds"); arma_debug_check( row_num >= n_rows, "Mat::shed_row(): index out of bound s");
shed_rows(row_num, row_num); shed_rows(row_num, row_num);
} }
//! remove specified column //! remove specified column
template<typename eT> template<typename eT>
inline inline
void void
Mat<eT>::shed_col(const uword col_num) Mat<eT>::shed_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::shed_col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::shed_col(): index out of bound s");
shed_cols(col_num, col_num); shed_cols(col_num, col_num);
} }
//! remove specified rows //! remove specified rows
template<typename eT> template<typename eT>
inline inline
void void
Mat<eT>::shed_rows(const uword in_row1, const uword in_row2) Mat<eT>::shed_rows(const uword in_row1, const uword in_row2)
{ {
skipping to change at line 2954 skipping to change at line 2954
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_rows = n_rows; const uword t_n_rows = n_rows;
const uword t_n_cols = n_cols; const uword t_n_cols = n_cols;
const uword A_n_rows = row_num; const uword A_n_rows = row_num;
const uword B_n_rows = t_n_rows - row_num; const uword B_n_rows = t_n_rows - row_num;
// insertion at row_num == n_rows is in effect an append operation // insertion at row_num == n_rows is in effect an append operation
arma_debug_check( (row_num > t_n_rows), "Mat::insert_rows(): out of bound s"); arma_debug_check( (row_num > t_n_rows), "Mat::insert_rows(): index out of bounds");
if(N > 0) if(N > 0)
{ {
Mat<eT> out(t_n_rows + N, t_n_cols); Mat<eT> out(t_n_rows + N, t_n_cols);
if(A_n_rows > 0) if(A_n_rows > 0)
{ {
out.rows(0, A_n_rows-1) = rows(0, A_n_rows-1); out.rows(0, A_n_rows-1) = rows(0, A_n_rows-1);
} }
skipping to change at line 2995 skipping to change at line 2995
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_rows = n_rows; const uword t_n_rows = n_rows;
const uword t_n_cols = n_cols; const uword t_n_cols = n_cols;
const uword A_n_cols = col_num; const uword A_n_cols = col_num;
const uword B_n_cols = t_n_cols - col_num; const uword B_n_cols = t_n_cols - col_num;
// insertion at col_num == n_cols is in effect an append operation // insertion at col_num == n_cols is in effect an append operation
arma_debug_check( (col_num > t_n_cols), "Mat::insert_cols(): out of bound s"); arma_debug_check( (col_num > t_n_cols), "Mat::insert_cols(): index out of bounds");
if(N > 0) if(N > 0)
{ {
Mat<eT> out(t_n_rows, t_n_cols + N); Mat<eT> out(t_n_rows, t_n_cols + N);
if(A_n_cols > 0) if(A_n_cols > 0)
{ {
out.cols(0, A_n_cols-1) = cols(0, A_n_cols-1); out.cols(0, A_n_cols-1) = cols(0, A_n_cols-1);
} }
skipping to change at line 3052 skipping to change at line 3052
bool err_state = false; bool err_state = false;
char* err_msg = 0; char* err_msg = 0;
// insertion at row_num == n_rows is in effect an append operation // insertion at row_num == n_rows is in effect an append operation
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
(row_num > t_n_rows), (row_num > t_n_rows),
"Mat::insert_rows(): out of bounds" "Mat::insert_rows(): index out of bounds"
); );
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
( (C_n_cols != t_n_cols) && ( (t_n_rows > 0) || (t_n_cols > 0) ) && ( ( C_n_rows > 0) || (C_n_cols > 0) ) ), ( (C_n_cols != t_n_cols) && ( (t_n_rows > 0) || (t_n_cols > 0) ) && ( ( C_n_rows > 0) || (C_n_cols > 0) ) ),
"Mat::insert_rows(): given object has an incompatible number of columns " "Mat::insert_rows(): given object has an incompatible number of columns "
); );
skipping to change at line 3123 skipping to change at line 3123
bool err_state = false; bool err_state = false;
char* err_msg = 0; char* err_msg = 0;
// insertion at col_num == n_cols is in effect an append operation // insertion at col_num == n_cols is in effect an append operation
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
(col_num > t_n_cols), (col_num > t_n_cols),
"Mat::insert_cols(): out of bounds" "Mat::insert_cols(): index out of bounds"
); );
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
( (C_n_rows != t_n_rows) && ( (t_n_rows > 0) || (t_n_cols > 0) ) && ( ( C_n_rows > 0) || (C_n_cols > 0) ) ), ( (C_n_rows != t_n_rows) && ( (t_n_rows > 0) || (t_n_cols > 0) ) && ( ( C_n_rows > 0) || (C_n_cols > 0) ) ),
"Mat::insert_cols(): given object has an incompatible number of rows" "Mat::insert_cols(): given object has an incompatible number of rows"
); );
skipping to change at line 4006 skipping to change at line 4006
const Mat<eT>& const Mat<eT>&
Mat<eT>::operator/=(const mtGlue<eT, T1, T2, glue_type>& X) Mat<eT>::operator/=(const mtGlue<eT, T1, T2, glue_type>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const Mat<eT> m(X); const Mat<eT> m(X);
return (*this).operator/=(m); return (*this).operator/=(m);
} }
//! linear element accessor (treats the matrix as a vector); no bounds chec
k; assumes memory is aligned
template<typename eT>
arma_inline
arma_warn_unused
const eT&
Mat<eT>::at_alt(const uword ii) const
{
const eT* mem_aligned = mem;
memory::mark_as_aligned(mem_aligned);
return mem_aligned[ii];
}
//! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::operator() (const uword ii) Mat<eT>::operator() (const uword ii)
{ {
arma_debug_check( (ii >= n_elem), "Mat::operator(): out of bounds"); arma_debug_check( (ii >= n_elem), "Mat::operator(): index out of bounds") ;
return access::rw(mem[ii]); return access::rw(mem[ii]);
} }
//! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::operator() (const uword ii) const Mat<eT>::operator() (const uword ii) const
{ {
arma_debug_check( (ii >= n_elem), "Mat::operator(): out of bounds"); arma_debug_check( (ii >= n_elem), "Mat::operator(): index out of bounds") ;
return mem[ii]; return mem[ii];
} }
//! linear element accessor (treats the matrix as a vector); no bounds chec k. //! linear element accessor (treats the matrix as a vector); no bounds chec k.
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::operator[] (const uword ii) Mat<eT>::operator[] (const uword ii)
{ {
return access::rw(mem[ii]); return access::rw(mem[ii]);
} }
//! linear element accessor (treats the matrix as a vector); no bounds chec k //! linear element accessor (treats the matrix as a vector); no bounds chec k
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::operator[] (const uword ii) const Mat<eT>::operator[] (const uword ii) const
{ {
return mem[ii]; return mem[ii];
} }
//! linear element accessor (treats the matrix as a vector); no bounds chec k. //! linear element accessor (treats the matrix as a vector); no bounds chec k.
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::at(const uword ii) Mat<eT>::at(const uword ii)
{ {
return access::rw(mem[ii]); return access::rw(mem[ii]);
} }
//! linear element accessor (treats the matrix as a vector); no bounds chec k //! linear element accessor (treats the matrix as a vector); no bounds chec k
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::at(const uword ii) const Mat<eT>::at(const uword ii) const
{ {
return mem[ii]; return mem[ii];
} }
//! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d //! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::operator() (const uword in_row, const uword in_col) Mat<eT>::operator() (const uword in_row, const uword in_col)
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::opera tor(): out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::opera tor(): index out of bounds");
return access::rw(mem[in_row + in_col*n_rows]); return access::rw(mem[in_row + in_col*n_rows]);
} }
//! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d //! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::operator() (const uword in_row, const uword in_col) const Mat<eT>::operator() (const uword in_row, const uword in_col) const
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::opera tor(): out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::opera tor(): index out of bounds");
return mem[in_row + in_col*n_rows]; return mem[in_row + in_col*n_rows];
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::at(const uword in_row, const uword in_col) Mat<eT>::at(const uword in_row, const uword in_col)
{ {
return access::rw( mem[in_row + in_col*n_rows] ); return access::rw( mem[in_row + in_col*n_rows] );
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::at(const uword in_row, const uword in_col) const Mat<eT>::at(const uword in_row, const uword in_col) const
{ {
return mem[in_row + in_col*n_rows]; return mem[in_row + in_col*n_rows];
} }
//! prefix ++ //! prefix ++
template<typename eT> template<typename eT>
arma_inline arma_inline
const Mat<eT>& const Mat<eT>&
Mat<eT>::operator++() Mat<eT>::operator++()
skipping to change at line 5718 skipping to change at line 5731
const Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat _fixed_type, op_strans > const Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat _fixed_type, op_strans >
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::st() const Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::st() const
{ {
return Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>:: Mat_fixed_type, op_strans >(*this); return Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>:: Mat_fixed_type, op_strans >(*this);
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at_alt(const uword ii) const
{
#if defined(ARMA_HAVE_ALIGNED_ATTRIBUTE)
return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
#else
const eT* mem_aligned = (use_extra) ? mem_local_extra : mem_local;
memory::mark_as_aligned(mem_aligned);
return mem_aligned[ii];
#endif
}
template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline
arma_warn_unused
eT& eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator[] (const uword ii) Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator[] (const uword ii)
{ {
return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator[] (const uword ii) con st Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator[] (const uword ii) con st
{ {
return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword ii) Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword ii)
{ {
return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword ii) const Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword ii) const
{ {
return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword ii) Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword ii)
{ {
arma_debug_check( (ii >= fixed_n_elem), "Mat::operator(): out of bounds") ; arma_debug_check( (ii >= fixed_n_elem), "Mat::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword ii) con st Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword ii) con st
{ {
arma_debug_check( (ii >= fixed_n_elem), "Mat::operator(): out of bounds") ; arma_debug_check( (ii >= fixed_n_elem), "Mat::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[ii] : mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword in_row, const uw ord in_col) Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword in_row, const uw ord in_col)
{ {
const uword iq = in_row + in_col*fixed_n_rows; const uword iq = in_row + in_col*fixed_n_rows;
return (use_extra) ? mem_local_extra[iq] : mem_local[iq]; return (use_extra) ? mem_local_extra[iq] : mem_local[iq];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword in_row, const uw ord in_col) const Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::at(const uword in_row, const uw ord in_col) const
{ {
const uword iq = in_row + in_col*fixed_n_rows; const uword iq = in_row + in_col*fixed_n_rows;
return (use_extra) ? mem_local_extra[iq] : mem_local[iq]; return (use_extra) ? mem_local_extra[iq] : mem_local[iq];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword in_row, const uword in_col) Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword in_row, const uword in_col)
{ {
arma_debug_check( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): out of bounds"); arma_debug_check( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): index out of bounds");
const uword iq = in_row + in_col*fixed_n_rows; const uword iq = in_row + in_col*fixed_n_rows;
return (use_extra) ? mem_local_extra[iq] : mem_local[iq]; return (use_extra) ? mem_local_extra[iq] : mem_local[iq];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword in_row, const uword in_col) const Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator() (const uword in_row, const uword in_col) const
{ {
arma_debug_check( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): out of bounds"); arma_debug_check( ((in_row >= fixed_n_rows) || (in_col >= fixed_n_cols)), "Mat::operator(): index out of bounds");
const uword iq = in_row + in_col*fixed_n_rows; const uword iq = in_row + in_col*fixed_n_rows;
return (use_extra) ? mem_local_extra[iq] : mem_local[iq]; return (use_extra) ? mem_local_extra[iq] : mem_local[iq];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols> template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
 End of changes. 34 change blocks. 
32 lines changed or deleted 66 lines changed or added


 Proxy.hpp   Proxy.hpp 
skipping to change at line 30 skipping to change at line 30
} }
}; };
template<typename T1> template<typename T1>
struct Proxy_fixed struct Proxy_fixed
{ {
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef T1 stored_type; typedef T1 stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const T1& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = true; static const bool is_fixed = true;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = T1::is_row; static const bool is_row = T1::is_row;
static const bool is_col = T1::is_col; static const bool is_col = T1::is_col;
arma_aligned const T1& Q; arma_aligned const T1& Q;
skipping to change at line 53 skipping to change at line 54
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline static uword get_n_rows() { return T1::n_rows; } arma_inline static uword get_n_rows() { return T1::n_rows; }
arma_inline static uword get_n_cols() { return T1::n_cols; } arma_inline static uword get_n_cols() { return T1::n_cols; }
arma_inline static uword get_n_elem() { return T1::n_elem; } arma_inline static uword get_n_elem() { return T1::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 ea_type get_ea() const { return Q.memptr(); } 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 (void_ptr(&Q) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_aligned() const
{
#if defined(ARMA_HAVE_ALIGNED_ATTRIBUTE)
return true;
#else
return memory::is_aligned(Q.memptr());
#endif
}
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct Proxy_redirect {}; struct Proxy_redirect {};
template<typename T1> template<typename T1>
struct Proxy_redirect<T1, false> { typedef Proxy_default<T1> result; }; struct Proxy_redirect<T1, false> { typedef Proxy_default<T1> result; };
template<typename T1> template<typename T1>
struct Proxy_redirect<T1, true> { typedef Proxy_fixed<T1> result; }; struct Proxy_redirect<T1, true> { typedef Proxy_fixed<T1> result; };
skipping to change at line 88 skipping to change at line 100
template<typename eT> template<typename eT>
class Proxy< Mat<eT> > class Proxy< Mat<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;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = false; static const bool is_col = false;
arma_aligned const Mat<eT>& Q; arma_aligned const Mat<eT>& Q;
skipping to change at line 111 skipping to change at line 124
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return 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 ea_type get_ea() const { return Q.memptr(); } 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 (void_ptr(&Q) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT> template<typename eT>
class Proxy< Col<eT> > class Proxy< Col<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 Col<eT> stored_type; typedef Col<eT> stored_type;
typedef const eT* ea_type; typedef const eT* ea_type;
typedef const Col<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const Col<eT>& Q; arma_aligned const Col<eT>& Q;
skipping to change at line 148 skipping to change at line 166
inline explicit Proxy(const Col<eT>& A) inline explicit Proxy(const Col<eT>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r arma_inline elem_type operator[] (const uword i) const { r
eturn Q[i]; } eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r arma_inline elem_type at (const uword row, const uword) const { r
eturn Q[row]; } eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r
eturn Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); } 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 (void_ptr(&Q) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT> template<typename eT>
class Proxy< Row<eT> > class Proxy< Row<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 Row<eT> stored_type; typedef Row<eT> stored_type;
typedef const eT* ea_type; typedef const eT* ea_type;
typedef const Row<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = true; static const bool is_row = true;
static const bool is_col = false; static const bool is_col = false;
arma_aligned const Row<eT>& Q; arma_aligned const Row<eT>& Q;
skipping to change at line 187 skipping to change at line 210
inline explicit Proxy(const Row<eT>& A) inline explicit Proxy(const Row<eT>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return 1; } arma_inline uword get_n_rows() const { return 1; }
arma_inline uword get_n_cols() const { return Q.n_cols; } arma_inline uword get_n_cols() const { return 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 { r arma_inline elem_type operator[] (const uword i) const { r
eturn Q[i]; } eturn Q[i]; }
arma_inline elem_type at (const uword, const uword col) const { r arma_inline elem_type at (const uword, const uword col) const { r
eturn Q[col]; } eturn Q[col]; }
arma_inline elem_type at_alt (const uword i) const { r
eturn Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); } 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 (void_ptr(&Q) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1, typename gen_type> template<typename T1, typename gen_type>
class Proxy< Gen<T1, gen_type > > class Proxy< Gen<T1, gen_type > >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Gen<T1, gen_type> stored_type; typedef Gen<T1, gen_type> stored_type;
typedef const Gen<T1, gen_type>& ea_type; typedef const Gen<T1, gen_type>& ea_type;
typedef const Gen<T1, gen_type>& aligned_ea_type;
static const bool prefer_at_accessor = Gen<T1, gen_type>::prefer_at_acces sor; static const bool prefer_at_accessor = Gen<T1, gen_type>::prefer_at_acces sor;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = Gen<T1, gen_type>::is_row; static const bool is_row = Gen<T1, gen_type>::is_row;
static const bool is_col = Gen<T1, gen_type>::is_col; static const bool is_col = Gen<T1, gen_type>::is_col;
arma_aligned const Gen<T1, gen_type>& Q; arma_aligned const Gen<T1, gen_type>& Q;
skipping to change at line 228 skipping to change at line 256
{ {
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 (is_row ? 1 : Q.n_rows) * ( is_col ? 1 : Q.n_cols); } arma_inline uword get_n_elem() const { return (is_row ? 1 : Q.n_rows) * ( is_col ? 1 : Q.n_cols); }
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[i]; }
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; }
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>&) const { return false; }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1, typename op_type> template<typename T1, typename op_type>
class Proxy< Op<T1, op_type> > class Proxy< Op<T1, op_type> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_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 = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = Op<T1, op_type>::is_row; static const bool is_row = Op<T1, op_type>::is_row;
static const bool is_col = Op<T1, op_type>::is_col; static const bool is_col = Op<T1, op_type>::is_col;
arma_aligned const Mat<elem_type> Q; arma_aligned const Mat<elem_type> Q;
skipping to change at line 267 skipping to change at line 300
{ {
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 ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1> template<typename T1>
class Proxy_diagvec_mat class Proxy_diagvec_mat
{ {
inline Proxy_diagvec_mat(const T1&) {} inline Proxy_diagvec_mat(const T1&) {}
}; };
template<typename T1> template<typename T1>
class Proxy_diagvec_mat< Op<T1, op_diagvec> > class Proxy_diagvec_mat< Op<T1, op_diagvec> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef diagview<elem_type> stored_type; typedef diagview<elem_type> stored_type;
typedef const diagview<elem_type>& ea_type; typedef const diagview<elem_type>& ea_type;
typedef const diagview<elem_type>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const Mat<elem_type>& R; arma_aligned const Mat<elem_type>& R;
skipping to change at line 313 skipping to change at line 351
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q.at(row, 0); } arma_inline elem_type at (const uword row, const uword) const { r eturn Q.at(row, 0); }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&R) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&R) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1> template<typename T1>
class Proxy_diagvec_expr class Proxy_diagvec_expr
{ {
inline Proxy_diagvec_expr(const T1&) {} inline Proxy_diagvec_expr(const T1&) {}
}; };
template<typename T1> template<typename T1>
class Proxy_diagvec_expr< Op<T1, op_diagvec> > class Proxy_diagvec_expr< Op<T1, op_diagvec> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_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 = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const Mat<elem_type> Q; arma_aligned const Mat<elem_type> Q;
skipping to change at line 358 skipping to change at line 401
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q.at(row, 0); } arma_inline elem_type at (const uword row, const uword) const { r eturn Q.at(row, 0); }
arma_inline elem_type at_alt (const uword i) const { r eturn Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct Proxy_diagvec_redirect {}; struct Proxy_diagvec_redirect {};
template<typename T1> template<typename T1>
struct Proxy_diagvec_redirect< Op<T1, op_diagvec>, true > { typedef Proxy_d iagvec_mat < Op<T1, op_diagvec> > result; }; struct Proxy_diagvec_redirect< Op<T1, op_diagvec>, true > { typedef Proxy_d iagvec_mat < Op<T1, op_diagvec> > result; };
template<typename T1> template<typename T1>
struct Proxy_diagvec_redirect< Op<T1, op_diagvec>, false> { typedef Proxy_d iagvec_expr< Op<T1, op_diagvec> > result; }; struct Proxy_diagvec_redirect< Op<T1, op_diagvec>, false> { typedef Proxy_d iagvec_expr< Op<T1, op_diagvec> > result; };
skipping to change at line 499 skipping to change at line 546
< <
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 T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Mat<elem_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 // 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_row = Op<T1, op_htrans>::is_row;
static const bool is_col = Op<T1, op_htrans>::is_col; static const bool is_col = Op<T1, op_htrans>::is_col;
skipping to change at line 523 skipping to change at line 571
{ {
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 ea_type get_ea() const { return Q.memptr(); } 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 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(
)); }
}; };
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 554 skipping to change at line 606
< <
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 T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Mat<elem_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 // NOTE: the Op class takes care of swapping row and col for op_strans
static const bool is_row = Op<T1, op_strans>::is_row; static const bool is_row = Op<T1, op_strans>::is_row;
static const bool is_col = Op<T1, op_strans>::is_col; static const bool is_col = Op<T1, op_strans>::is_col;
skipping to change at line 578 skipping to change at line 631
{ {
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 ea_type get_ea() const { return Q.memptr(); } 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 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(
)); }
}; };
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;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const subview_row_htrans<eT> Q; arma_aligned const subview_row_htrans<eT> Q;
skipping to change at line 620 skipping to change at line 678
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)); }
}; };
template<typename eT> template<typename eT>
struct Proxy_subview_row_htrans_non_cx struct Proxy_subview_row_htrans_non_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_strans<eT> stored_type; typedef subview_row_strans<eT> stored_type;
typedef const subview_row_strans<eT>& ea_type; typedef const subview_row_strans<eT>& ea_type;
typedef const subview_row_strans<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const subview_row_strans<eT> Q; arma_aligned const subview_row_strans<eT> Q;
skipping to change at line 674 skipping to change at line 733
< <
eT, eT,
is_complex<eT>::value is_complex<eT>::value
>::result >::result
Proxy_sv_row_ht; Proxy_sv_row_ht;
typedef typename Proxy_sv_row_ht::elem_type elem_type; typedef typename Proxy_sv_row_ht::elem_type elem_type;
typedef typename Proxy_sv_row_ht::pod_type pod_type; typedef typename Proxy_sv_row_ht::pod_type pod_type;
typedef typename Proxy_sv_row_ht::stored_type stored_type; typedef typename Proxy_sv_row_ht::stored_type stored_type;
typedef typename Proxy_sv_row_ht::ea_type ea_type; typedef typename Proxy_sv_row_ht::ea_type ea_type;
typedef typename Proxy_sv_row_ht::ea_type aligned_ea_type;
static const bool prefer_at_accessor = Proxy_sv_row_ht::prefer_at_accesso r; static const bool prefer_at_accessor = Proxy_sv_row_ht::prefer_at_accesso r;
static const bool has_subview = Proxy_sv_row_ht::has_subview; static const bool has_subview = Proxy_sv_row_ht::has_subview;
static const bool is_fixed = Proxy_sv_row_ht::is_fixed; static const bool is_fixed = Proxy_sv_row_ht::is_fixed;
static const bool fake_mat = Proxy_sv_row_ht::fake_mat; static const bool fake_mat = Proxy_sv_row_ht::fake_mat;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
using Proxy_sv_row_ht::Q; using Proxy_sv_row_ht::Q;
skipping to change at line 697 skipping to change at line 757
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; } arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_sv_row_ ht::is_alias(X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_sv_row_ ht::is_alias(X); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename eT> template<typename eT>
class Proxy< Op<subview_row<eT>, op_strans> > class Proxy< Op<subview_row<eT>, op_strans> >
{ {
public: public:
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_strans<eT> stored_type; typedef subview_row_strans<eT> stored_type;
typedef const subview_row_strans<eT>& ea_type; typedef const subview_row_strans<eT>& ea_type;
typedef const subview_row_strans<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const subview_row_strans<eT> Q; arma_aligned const subview_row_strans<eT> Q;
skipping to change at line 736 skipping to change at line 801
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; } arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
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; }
}; };
template<typename T> template<typename T>
class Proxy< Op< Row< std::complex<T> >, op_htrans> > class Proxy< Op< Row< std::complex<T> >, op_htrans> >
{ {
public: public:
typedef typename std::complex<T> eT; typedef typename std::complex<T> eT;
typedef typename std::complex<T> elem_type; typedef typename std::complex<T> elem_type;
typedef T pod_type; typedef T pod_type;
typedef xvec_htrans<eT> stored_type; typedef xvec_htrans<eT> stored_type;
typedef const xvec_htrans<eT>& ea_type; typedef const xvec_htrans<eT>& ea_type;
typedef const xvec_htrans<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
const xvec_htrans<eT> Q; const xvec_htrans<eT> Q;
skipping to change at line 779 skipping to change at line 849
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; } arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&src ) == void_ptr(&X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&src ) == void_ptr(&X); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T> template<typename T>
class Proxy< Op< Col< std::complex<T> >, op_htrans> > class Proxy< Op< Col< std::complex<T> >, op_htrans> >
{ {
public: public:
typedef typename std::complex<T> eT; typedef typename std::complex<T> eT;
typedef typename std::complex<T> elem_type; typedef typename std::complex<T> elem_type;
typedef T pod_type; typedef T pod_type;
typedef xvec_htrans<eT> stored_type; typedef xvec_htrans<eT> stored_type;
typedef const xvec_htrans<eT>& ea_type; typedef const xvec_htrans<eT>& ea_type;
typedef const xvec_htrans<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = true; static const bool is_row = true;
static const bool is_col = false; static const bool is_col = false;
const xvec_htrans<eT> Q; const xvec_htrans<eT> Q;
skipping to change at line 822 skipping to change at line 897
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return 1; } arma_inline uword get_n_rows() const { return 1; }
arma_inline uword get_n_cols() const { return Q.n_cols; } arma_inline uword get_n_cols() const { return 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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword, const uword col) const { r eturn Q[col]; } arma_inline elem_type at (const uword, const uword col) const { r eturn Q[col]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&src ) == void_ptr(&X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&src ) == void_ptr(&X); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T> template<typename T>
class Proxy< Op< subview_col< std::complex<T> >, op_htrans> > class Proxy< Op< subview_col< std::complex<T> >, op_htrans> >
{ {
public: public:
typedef typename std::complex<T> eT; typedef typename std::complex<T> eT;
typedef typename std::complex<T> elem_type; typedef typename std::complex<T> elem_type;
typedef T pod_type; typedef T pod_type;
typedef xvec_htrans<eT> stored_type; typedef xvec_htrans<eT> stored_type;
typedef const xvec_htrans<eT>& ea_type; typedef const xvec_htrans<eT>& ea_type;
typedef const xvec_htrans<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = true; static const bool is_row = true;
static const bool is_col = false; static const bool is_col = false;
const xvec_htrans<eT> Q; const xvec_htrans<eT> Q;
skipping to change at line 865 skipping to change at line 945
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return 1; } arma_inline uword get_n_rows() const { return 1; }
arma_inline uword get_n_cols() const { return Q.n_cols; } arma_inline uword get_n_cols() const { return 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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword, const uword col) const { r eturn Q[col]; } arma_inline elem_type at (const uword, const uword col) const { r eturn Q[col]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&src .m) == void_ptr(&X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return void_ptr(&src .m) == void_ptr(&X); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1> template<typename T1>
struct Proxy_htrans2_default struct Proxy_htrans2_default
{ {
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_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 = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = false; static const bool is_col = false;
arma_aligned const Mat<elem_type> Q; arma_aligned const Mat<elem_type> Q;
skipping to change at line 901 skipping to change at line 986
inline Proxy_htrans2_default(const T1& A) inline Proxy_htrans2_default(const T1& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return 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 ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1> template<typename T1>
struct Proxy_htrans2_vector struct Proxy_htrans2_vector
{ {
inline Proxy_htrans2_vector(const T1&) {} inline Proxy_htrans2_vector(const T1&) {}
}; };
template<typename T1> template<typename T1>
struct Proxy_htrans2_vector< Op<T1, op_htrans2> > struct Proxy_htrans2_vector< Op<T1, op_htrans2> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef eOp< Op<T1, op_htrans>, eop_scalar_times> stored_type; typedef eOp< Op<T1, op_htrans>, eop_scalar_times> stored_type;
typedef const eOp< Op<T1, op_htrans>, eop_scalar_times>& ea_type; typedef const eOp< Op<T1, op_htrans>, eop_scalar_times>& ea_type;
typedef const eOp< Op<T1, op_htrans>, eop_scalar_times>& aligned_ea_type;
static const bool prefer_at_accessor = eOp< Op<T1, op_htrans>, eop_scalar _times>::prefer_at_accessor; static const bool prefer_at_accessor = eOp< Op<T1, op_htrans>, eop_scalar _times>::prefer_at_accessor;
static const bool has_subview = eOp< Op<T1, op_htrans>, eop_scalar _times>::has_subview; static const bool has_subview = eOp< Op<T1, op_htrans>, eop_scalar _times>::has_subview;
static const bool is_fixed = eOp< Op<T1, op_htrans>, eop_scalar _times>::is_fixed; static const bool is_fixed = eOp< Op<T1, op_htrans>, eop_scalar _times>::is_fixed;
static const bool fake_mat = eOp< Op<T1, op_htrans>, eop_scalar _times>::fake_mat; static const bool fake_mat = eOp< Op<T1, op_htrans>, eop_scalar _times>::fake_mat;
// NOTE: the Op class takes care of swapping row and col for op_htrans // NOTE: the Op class takes care of swapping row and col for op_htrans
static const bool is_row = eOp< Op<T1, op_htrans>, eop_scalar_times>::is_ row; static const bool is_row = eOp< Op<T1, op_htrans>, eop_scalar_times>::is_ row;
static const bool is_col = eOp< Op<T1, op_htrans>, eop_scalar_times>::is_ col; static const bool is_col = eOp< Op<T1, op_htrans>, eop_scalar_times>::is_ col;
skipping to change at line 946 skipping to change at line 1035
: R(A.m) : R(A.m)
, Q(R, A.aux) , Q(R, A.aux)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; } arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; }
arma_inline uword get_n_elem() const { return Q.get_n_elem(); } arma_inline uword get_n_elem() const { return Q.get_n_elem(); }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return Q.P.is_alias( X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return Q.P.is_alias( X); }
arma_inline bool is_aligned() const { return Q.P.is_aligned(); }
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct Proxy_htrans2_redirect {}; struct Proxy_htrans2_redirect {};
template<typename T1> template<typename T1>
struct Proxy_htrans2_redirect<T1, false> { typedef Proxy_htrans2_default<T1 > result; }; struct Proxy_htrans2_redirect<T1, false> { typedef Proxy_htrans2_default<T1 > result; };
template<typename T1> template<typename T1>
struct Proxy_htrans2_redirect<T1, true> { typedef Proxy_htrans2_vector<T1> result; }; struct Proxy_htrans2_redirect<T1, true> { typedef Proxy_htrans2_vector<T1> result; };
skipping to change at line 981 skipping to change at line 1073
typedef typedef
typename typename
Proxy_htrans2_redirect Proxy_htrans2_redirect
< <
Op<T1, op_htrans2>, Op<T1, op_htrans2>,
( (Op<T1, op_htrans2>::is_row) || (Op<T1, op_htrans2>::is_col) ) ( (Op<T1, op_htrans2>::is_row) || (Op<T1, op_htrans2>::is_col) )
>::result >::result
Proxy_htrans2; Proxy_htrans2;
typedef typename Proxy_htrans2::elem_type elem_type; typedef typename Proxy_htrans2::elem_type elem_type;
typedef typename Proxy_htrans2::pod_type pod_type; typedef typename Proxy_htrans2::pod_type pod_type;
typedef typename Proxy_htrans2::stored_type stored_type; typedef typename Proxy_htrans2::stored_type stored_type;
typedef typename Proxy_htrans2::ea_type ea_type; typedef typename Proxy_htrans2::ea_type ea_type;
typedef typename Proxy_htrans2::aligned_ea_type aligned_ea_type;
static const bool prefer_at_accessor = Proxy_htrans2::prefer_at_accessor; static const bool prefer_at_accessor = Proxy_htrans2::prefer_at_accessor;
static const bool has_subview = Proxy_htrans2::has_subview; static const bool has_subview = Proxy_htrans2::has_subview;
static const bool is_fixed = Proxy_htrans2::is_fixed; static const bool is_fixed = Proxy_htrans2::is_fixed;
static const bool fake_mat = Proxy_htrans2::fake_mat; static const bool fake_mat = Proxy_htrans2::fake_mat;
static const bool is_row = Proxy_htrans2::is_row; static const bool is_row = Proxy_htrans2::is_row;
static const bool is_col = Proxy_htrans2::is_col; static const bool is_col = Proxy_htrans2::is_col;
using Proxy_htrans2::Q; using Proxy_htrans2::Q;
skipping to change at line 1008 skipping to change at line 1101
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Proxy_htrans2::get_n_rows() ; } arma_inline uword get_n_rows() const { return Proxy_htrans2::get_n_rows() ; }
arma_inline uword get_n_cols() const { return Proxy_htrans2::get_n_cols() ; } arma_inline uword get_n_cols() const { return Proxy_htrans2::get_n_cols() ; }
arma_inline uword get_n_elem() const { return Proxy_htrans2::get_n_elem() ; } arma_inline uword get_n_elem() const { return Proxy_htrans2::get_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 ea_type get_ea() const { return Proxy_htrans2::get_ea(); } arma_inline ea_type get_ea() const { return Proxy_htrans2
::get_ea(); }
arma_inline aligned_ea_type get_aligned_ea() const { return Proxy_htrans2
::get_aligned_ea(); }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_htrans2 ::is_alias(X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return Proxy_htrans2 ::is_alias(X); }
arma_inline bool is_aligned() const { return Proxy_htrans2::is_aligned();
}
}; };
template<typename T1, typename T2, typename glue_type> template<typename T1, typename T2, typename glue_type>
class Proxy< Glue<T1, T2, glue_type> > class Proxy< Glue<T1, T2, glue_type> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_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 = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = Glue<T1, T2, glue_type>::is_row; static const bool is_row = Glue<T1, T2, glue_type>::is_row;
static const bool is_col = Glue<T1, T2, glue_type>::is_col; static const bool is_col = Glue<T1, T2, glue_type>::is_col;
arma_aligned const Mat<elem_type> Q; arma_aligned const Mat<elem_type> Q;
skipping to change at line 1047 skipping to change at line 1145
{ {
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 ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT> template<typename eT>
class Proxy< subview<eT> > class Proxy< subview<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 subview<eT> stored_type; typedef subview<eT> stored_type;
typedef const subview<eT>& ea_type; typedef const subview<eT>& ea_type;
typedef const subview<eT>& aligned_ea_type;
static const bool prefer_at_accessor = true; static const bool prefer_at_accessor = true;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = false; static const bool is_col = false;
arma_aligned const subview<eT>& Q; arma_aligned const subview<eT>& Q;
skipping to change at line 1086 skipping to change at line 1189
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return 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[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename eT> template<typename eT>
class Proxy< subview_col<eT> > class Proxy< subview_col<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 subview_col<eT> stored_type; typedef subview_col<eT> stored_type;
typedef const eT* ea_type; typedef const eT* ea_type;
typedef const subview_col<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const subview_col<eT>& Q; arma_aligned const subview_col<eT>& Q;
skipping to change at line 1123 skipping to change at line 1231
inline explicit Proxy(const subview_col<eT>& A) inline explicit Proxy(const subview_col<eT>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r arma_inline elem_type operator[] (const uword i) const { r
eturn Q[i]; } eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r arma_inline elem_type at (const uword row, const uword) const { r
eturn Q[row]; } eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r
eturn Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.colptr(0); } arma_inline ea_type get_ea() const { return Q.colmem; }
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 .m)) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.colmem)
; }
}; };
template<typename eT> template<typename eT>
class Proxy< subview_row<eT> > class Proxy< subview_row<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 subview_row<eT> stored_type; typedef subview_row<eT> stored_type;
typedef const subview_row<eT>& ea_type; typedef const subview_row<eT>& ea_type;
typedef const subview_row<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = true; static const bool is_row = true;
static const bool is_col = false; static const bool is_col = false;
arma_aligned const subview_row<eT>& Q; arma_aligned const subview_row<eT>& Q;
skipping to change at line 1164 skipping to change at line 1277
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return 1; } arma_inline uword get_n_rows() const { return 1; }
arma_inline uword get_n_cols() const { return Q.n_cols; } arma_inline uword get_n_cols() const { return 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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword, const uword col) const { r eturn Q[col]; } arma_inline elem_type at (const uword, const uword col) const { r eturn Q[col]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename eT> template<typename eT>
class Proxy< subview_row_strans<eT> > class Proxy< subview_row_strans<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 subview_row_strans<eT> stored_type; typedef subview_row_strans<eT> stored_type;
typedef const subview_row_strans<eT>& ea_type; typedef const subview_row_strans<eT>& ea_type;
typedef const subview_row_strans<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const subview_row_strans<eT>& Q; arma_aligned const subview_row_strans<eT>& Q;
skipping to change at line 1203 skipping to change at line 1321
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; } arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
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; }
}; };
template<typename eT> template<typename eT>
class Proxy< subview_row_htrans<eT> > class Proxy< subview_row_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 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;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const subview_row_htrans<eT>& Q; arma_aligned const subview_row_htrans<eT>& Q;
skipping to change at line 1242 skipping to change at line 1365
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; } arma_inline elem_type at (const uword row, const uword) const { r eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
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; }
}; };
template<typename eT, typename T1> template<typename eT, typename T1>
class Proxy< subview_elem1<eT,T1> > class Proxy< subview_elem1<eT,T1> >
{ {
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;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const Mat<eT> Q; arma_aligned const Mat<eT> Q;
skipping to change at line 1279 skipping to change at line 1407
inline explicit Proxy(const subview_elem1<eT,T1>& A) inline explicit Proxy(const subview_elem1<eT,T1>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r arma_inline elem_type operator[] (const uword i) const { r
eturn Q[i]; } eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r arma_inline elem_type at (const uword row, const uword) const { r
eturn Q[row]; } eturn Q[row]; }
arma_inline elem_type at_alt (const uword i) const { r
eturn Q.at_alt(i); }
arma_inline ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT, typename T1, typename T2> template<typename eT, typename T1, typename T2>
class Proxy< subview_elem2<eT,T1,T2> > class Proxy< subview_elem2<eT,T1,T2> >
{ {
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;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = false; static const bool is_col = false;
arma_aligned const Mat<eT> Q; arma_aligned const Mat<eT> Q;
skipping to change at line 1320 skipping to change at line 1453
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return 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 ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT> template<typename eT>
class Proxy< diagview<eT> > class Proxy< diagview<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 diagview<eT> stored_type; typedef diagview<eT> stored_type;
typedef const diagview<eT>& ea_type; typedef const diagview<eT>& ea_type;
typedef const diagview<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = 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;
static const bool is_row = false; static const bool is_row = false;
static const bool is_col = true; static const bool is_col = true;
arma_aligned const diagview<eT>& Q; arma_aligned const diagview<eT>& Q;
skipping to change at line 1359 skipping to change at line 1497
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; } arma_inline uword get_n_cols() const { return 1; }
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 { r eturn Q[i]; } arma_inline elem_type operator[] (const uword i) const { r eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r eturn Q.at(row, 0); } arma_inline elem_type at (const uword row, const uword) const { r eturn Q.at(row, 0); }
arma_inline elem_type at_alt (const uword i) const { r eturn Q[i]; }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
class Proxy< eOp<T1, eop_type > > class Proxy< eOp<T1, eop_type > >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef eOp<T1, eop_type> stored_type; typedef eOp<T1, eop_type> stored_type;
typedef const eOp<T1, eop_type>& ea_type; typedef const eOp<T1, eop_type>& ea_type;
typedef const eOp<T1, eop_type>& aligned_ea_type;
static const bool prefer_at_accessor = eOp<T1, eop_type>::prefer_at_acces sor; static const bool prefer_at_accessor = eOp<T1, eop_type>::prefer_at_acces sor;
static const bool has_subview = eOp<T1, eop_type>::has_subview; static const bool has_subview = eOp<T1, eop_type>::has_subview;
static const bool is_fixed = eOp<T1, eop_type>::is_fixed; static const bool is_fixed = eOp<T1, eop_type>::is_fixed;
static const bool fake_mat = eOp<T1, eop_type>::fake_mat; static const bool fake_mat = eOp<T1, eop_type>::fake_mat;
static const bool is_row = eOp<T1, eop_type>::is_row; static const bool is_row = eOp<T1, eop_type>::is_row;
static const bool is_col = eOp<T1, eop_type>::is_col; static const bool is_col = eOp<T1, eop_type>::is_col;
arma_aligned const eOp<T1, eop_type>& Q; arma_aligned const eOp<T1, eop_type>& Q;
skipping to change at line 1398 skipping to change at line 1541
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; } arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; }
arma_inline uword get_n_elem() const { return Q.get_n_elem(); } arma_inline uword get_n_elem() const { return Q.get_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 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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return Q.P.is_alias( X); } arma_inline bool is_alias(const Mat<eT2>& X) const { return Q.P.is_alias( X); }
arma_inline bool is_aligned() const { return Q.P.is_aligned(); }
}; };
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
class Proxy< eGlue<T1, T2, eglue_type > > class Proxy< eGlue<T1, T2, eglue_type > >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef eGlue<T1, T2, eglue_type> stored_type; typedef eGlue<T1, T2, eglue_type> stored_type;
typedef const eGlue<T1, T2, eglue_type>& ea_type; typedef const eGlue<T1, T2, eglue_type>& ea_type;
typedef const eGlue<T1, T2, eglue_type>& aligned_ea_type;
static const bool prefer_at_accessor = eGlue<T1, T2, eglue_type>::prefer_ at_accessor; static const bool prefer_at_accessor = eGlue<T1, T2, eglue_type>::prefer_ at_accessor;
static const bool has_subview = eGlue<T1, T2, eglue_type>::has_sub view; static const bool has_subview = eGlue<T1, T2, eglue_type>::has_sub view;
static const bool is_fixed = eGlue<T1, T2, eglue_type>::is_fixe d; static const bool is_fixed = eGlue<T1, T2, eglue_type>::is_fixe d;
static const bool fake_mat = eGlue<T1, T2, eglue_type>::fake_ma t; static const bool fake_mat = eGlue<T1, T2, eglue_type>::fake_ma t;
static const bool is_row = eGlue<T1, T2, eglue_type>::is_row; static const bool is_row = eGlue<T1, T2, eglue_type>::is_row;
static const bool is_col = eGlue<T1, T2, eglue_type>::is_col; static const bool is_col = eGlue<T1, T2, eglue_type>::is_col;
arma_aligned const eGlue<T1, T2, eglue_type>& Q; arma_aligned const eGlue<T1, T2, eglue_type>& Q;
skipping to change at line 1437 skipping to change at line 1585
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; } arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; }
arma_inline uword get_n_elem() const { return Q.get_n_elem(); } arma_inline uword get_n_elem() const { return Q.get_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 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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (Q.P1.is_alia s(X) || Q.P2.is_alias(X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (Q.P1.is_alia s(X) || Q.P2.is_alias(X)); }
arma_inline bool is_aligned() const { return (Q.P1.is_aligned() && Q.P2.i
s_aligned()); }
}; };
template<typename out_eT, typename T1, typename op_type> template<typename out_eT, typename T1, typename op_type>
class Proxy< mtOp<out_eT, T1, op_type> > class Proxy< mtOp<out_eT, T1, op_type> >
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
typedef Mat<out_eT> stored_type; typedef Mat<out_eT> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Mat<out_eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = mtOp<out_eT, T1, op_type>::is_row; static const bool is_row = mtOp<out_eT, T1, op_type>::is_row;
static const bool is_col = mtOp<out_eT, T1, op_type>::is_col; static const bool is_col = mtOp<out_eT, T1, op_type>::is_col;
arma_aligned const Mat<out_eT> Q; arma_aligned const Mat<out_eT> Q;
skipping to change at line 1476 skipping to change at line 1629
{ {
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 ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename out_eT, typename T1, typename T2, typename glue_type> template<typename out_eT, typename T1, typename T2, typename glue_type>
class Proxy< mtGlue<out_eT, T1, T2, glue_type > > class Proxy< mtGlue<out_eT, T1, T2, glue_type > >
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
typedef Mat<out_eT> stored_type; typedef Mat<out_eT> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Mat<out_eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
static const bool is_fixed = false; static const bool is_fixed = false;
static const bool fake_mat = false; static const bool fake_mat = false;
static const bool is_row = mtGlue<out_eT, T1, T2, glue_type>::is_row; static const bool is_row = mtGlue<out_eT, T1, T2, glue_type>::is_row;
static const bool is_col = mtGlue<out_eT, T1, T2, glue_type>::is_col; static const bool is_col = mtGlue<out_eT, T1, T2, glue_type>::is_col;
arma_aligned const Mat<out_eT> Q; arma_aligned const Mat<out_eT> Q;
skipping to change at line 1515 skipping to change at line 1673
{ {
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 ea_type get_ea() const { return Q.memptr(); } 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>&) const { return false; } arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
//! @} //! @}
 End of changes. 124 change blocks. 
51 lines changed or deleted 235 lines changed or added


 ProxyCube.hpp   ProxyCube.hpp 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2012 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 ProxyCube //! \addtogroup ProxyCube
//! @{ //! @{
template<typename T1> template<typename T1>
class ProxyCube class ProxyCube
skipping to change at line 33 skipping to change at line 33
template<typename eT> template<typename eT>
class ProxyCube< Cube<eT> > class ProxyCube< Cube<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 Cube<eT> stored_type; typedef Cube<eT> stored_type;
typedef const eT* ea_type; typedef const eT* ea_type;
typedef const Cube<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
arma_aligned const Cube<eT>& Q; arma_aligned const Cube<eT>& Q;
inline explicit ProxyCube(const Cube<eT>& A) inline explicit ProxyCube(const Cube<eT>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
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 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 Cube<eT2>& X) const { return (void_ptr(&Q ) == void_ptr(&X)); } arma_inline bool is_alias(const Cube<eT2>& X) const { return (void_ptr(&Q ) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT, typename gen_type> template<typename eT, typename gen_type>
class ProxyCube< GenCube<eT, gen_type > > class ProxyCube< GenCube<eT, gen_type > >
{ {
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 GenCube<eT, gen_type> stored_type; typedef GenCube<eT, gen_type> stored_type;
typedef const GenCube<eT, gen_type>& ea_type; typedef const GenCube<eT, gen_type>& ea_type;
typedef const GenCube<eT, gen_type>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
arma_aligned const GenCube<eT, gen_type>& Q; arma_aligned const GenCube<eT, gen_type>& Q;
inline explicit ProxyCube(const GenCube<eT, gen_type>& A) inline explicit ProxyCube(const GenCube<eT, gen_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_rows*Q.n_cols; } arma_inline uword get_n_elem_slice() const { return Q.n_rows*Q.n_cols; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
arma_inline uword get_n_elem() const { return Q.n_rows*Q.n_cols*Q.n _slices; } arma_inline uword get_n_elem() const { return Q.n_rows*Q.n_cols*Q.n _slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Cube<eT2>&) const { return false; } arma_inline bool is_alias(const Cube<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1, typename op_type> template<typename T1, typename op_type>
class ProxyCube< OpCube<T1, op_type> > class ProxyCube< OpCube<T1, op_type> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Cube<elem_type> stored_type; typedef Cube<elem_type> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Cube<elem_type>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
arma_aligned const Cube<elem_type> Q; arma_aligned const Cube<elem_type> Q;
inline explicit ProxyCube(const OpCube<T1, op_type>& A) inline explicit ProxyCube(const OpCube<T1, op_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
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 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 Cube<eT2>&) const { return false; } arma_inline bool is_alias(const Cube<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename T1, typename T2, typename glue_type> template<typename T1, typename T2, typename glue_type>
class ProxyCube< GlueCube<T1, T2, glue_type> > class ProxyCube< GlueCube<T1, T2, glue_type> >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Cube<elem_type> stored_type; typedef Cube<elem_type> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Cube<elem_type>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
arma_aligned const Cube<elem_type> Q; arma_aligned const Cube<elem_type> Q;
inline explicit ProxyCube(const GlueCube<T1, T2, glue_type>& A) inline explicit ProxyCube(const GlueCube<T1, T2, glue_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
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 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 Cube<eT2>&) const { return false; } arma_inline bool is_alias(const Cube<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename eT> template<typename eT>
class ProxyCube< subview_cube<eT> > class ProxyCube< subview_cube<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 subview_cube<eT> stored_type; typedef subview_cube<eT> stored_type;
typedef const subview_cube<eT>& ea_type; typedef const subview_cube<eT>& ea_type;
typedef const subview_cube<eT>& aligned_ea_type;
static const bool prefer_at_accessor = true; static const bool prefer_at_accessor = true;
static const bool has_subview = true; static const bool has_subview = true;
arma_aligned const subview_cube<eT>& Q; arma_aligned const subview_cube<eT>& Q;
inline explicit ProxyCube(const subview_cube<eT>& A) inline explicit ProxyCube(const subview_cube<eT>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Cube<eT2>& X) const { return (void_ptr(&( Q.m)) == void_ptr(&X)); } arma_inline bool is_alias(const Cube<eT2>& X) const { return (void_ptr(&( Q.m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; }
}; };
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
class ProxyCube< eOpCube<T1, eop_type > > class ProxyCube< eOpCube<T1, eop_type > >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef eOpCube<T1, eop_type> stored_type; typedef eOpCube<T1, eop_type> stored_type;
typedef const eOpCube<T1, eop_type>& ea_type; typedef const eOpCube<T1, eop_type>& ea_type;
typedef const eOpCube<T1, eop_type>& aligned_ea_type;
static const bool prefer_at_accessor = eOpCube<T1, eop_type>::prefer_at_a ccessor; static const bool prefer_at_accessor = eOpCube<T1, eop_type>::prefer_at_a ccessor;
static const bool has_subview = eOpCube<T1, eop_type>::has_subview ; static const bool has_subview = eOpCube<T1, eop_type>::has_subview ;
arma_aligned const eOpCube<T1, eop_type>& Q; arma_aligned const eOpCube<T1, eop_type>& Q;
inline explicit ProxyCube(const eOpCube<T1, eop_type>& A) inline explicit ProxyCube(const eOpCube<T1, eop_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.get_n_rows(); } arma_inline uword get_n_rows() const { return Q.get_n_rows(); }
arma_inline uword get_n_cols() const { return Q.get_n_cols(); } arma_inline uword get_n_cols() const { return Q.get_n_cols(); }
arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice(); } arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice(); }
arma_inline uword get_n_slices() const { return Q.get_n_slices(); } arma_inline uword get_n_slices() const { return Q.get_n_slices(); }
arma_inline uword get_n_elem() const { return Q.get_n_elem(); } arma_inline uword get_n_elem() const { return Q.get_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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Cube<eT2>& X) const { return Q.P.is_alias (X); } arma_inline bool is_alias(const Cube<eT2>& X) const { return Q.P.is_alias (X); }
arma_inline bool is_aligned() const { return Q.P.is_aligned(); }
}; };
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
class ProxyCube< eGlueCube<T1, T2, eglue_type > > class ProxyCube< eGlueCube<T1, T2, eglue_type > >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef eGlueCube<T1, T2, eglue_type> stored_type; typedef eGlueCube<T1, T2, eglue_type> stored_type;
typedef const eGlueCube<T1, T2, eglue_type>& ea_type; typedef const eGlueCube<T1, T2, eglue_type>& ea_type;
typedef const eGlueCube<T1, T2, eglue_type>& aligned_ea_type;
static const bool prefer_at_accessor = eGlueCube<T1, T2, eglue_type>::pre fer_at_accessor; static const bool prefer_at_accessor = eGlueCube<T1, T2, eglue_type>::pre fer_at_accessor;
static const bool has_subview = eGlueCube<T1, T2, eglue_type>::has _subview; static const bool has_subview = eGlueCube<T1, T2, eglue_type>::has _subview;
arma_aligned const eGlueCube<T1, T2, eglue_type>& Q; arma_aligned const eGlueCube<T1, T2, eglue_type>& Q;
inline explicit ProxyCube(const eGlueCube<T1, T2, eglue_type>& A) inline explicit ProxyCube(const eGlueCube<T1, T2, eglue_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.get_n_rows(); } arma_inline uword get_n_rows() const { return Q.get_n_rows(); }
arma_inline uword get_n_cols() const { return Q.get_n_cols(); } arma_inline uword get_n_cols() const { return Q.get_n_cols(); }
arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice(); } arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice(); }
arma_inline uword get_n_slices() const { return Q.get_n_slices(); } arma_inline uword get_n_slices() const { return Q.get_n_slices(); }
arma_inline uword get_n_elem() const { return Q.get_n_elem(); } arma_inline uword get_n_elem() const { return Q.get_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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); }
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; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Cube<eT2>& X) const { return (Q.P1.is_ali as(X) || Q.P2.is_alias(X)); } arma_inline bool is_alias(const Cube<eT2>& X) const { return (Q.P1.is_ali as(X) || Q.P2.is_alias(X)); }
arma_inline bool is_aligned() const { return Q.P1.is_aligned() && Q.P2.is
_aligned(); }
}; };
template<typename out_eT, typename T1, typename op_type> template<typename out_eT, typename T1, typename op_type>
class ProxyCube< mtOpCube<out_eT, T1, op_type> > class ProxyCube< mtOpCube<out_eT, T1, op_type> >
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
typedef Cube<out_eT> stored_type; typedef Cube<out_eT> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Cube<out_eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
arma_aligned const Cube<out_eT> Q; arma_aligned const Cube<out_eT> Q;
inline explicit ProxyCube(const mtOpCube<out_eT, T1, op_type>& A) inline explicit ProxyCube(const mtOpCube<out_eT, T1, op_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
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 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 Cube<eT2>&) const { return false; } arma_inline bool is_alias(const Cube<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
template<typename out_eT, typename T1, typename T2, typename glue_type> template<typename out_eT, typename T1, typename T2, typename glue_type>
class ProxyCube< mtGlueCube<out_eT, T1, T2, glue_type > > class ProxyCube< mtGlueCube<out_eT, T1, T2, glue_type > >
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
typedef Cube<out_eT> stored_type; typedef Cube<out_eT> stored_type;
typedef const elem_type* ea_type; typedef const elem_type* ea_type;
typedef const Cube<out_eT>& aligned_ea_type;
static const bool prefer_at_accessor = false; static const bool prefer_at_accessor = false;
static const bool has_subview = false; static const bool has_subview = false;
arma_aligned const Cube<out_eT> Q; arma_aligned const Cube<out_eT> Q;
inline explicit ProxyCube(const mtGlueCube<out_eT, T1, T2, glue_type>& A) inline explicit ProxyCube(const mtGlueCube<out_eT, T1, T2, glue_type>& A)
: Q(A) : Q(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return Q.n_rows; } 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_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; }
arma_inline uword get_n_slices() const { return Q.n_slices; } arma_inline uword get_n_slices() const { return Q.n_slices; }
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 uword slice) const { return Q.at(row, col, slice); } arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
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 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 Cube<eT2>&) const { return false; } arma_inline bool is_alias(const Cube<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr(
)); }
}; };
//! @} //! @}
 End of changes. 37 change blocks. 
11 lines changed or deleted 62 lines changed or added


 Row_bones.hpp   Row_bones.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2013 Conrad Sanderson
// //
// 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 Row //! \addtogroup Row
//! @{ //! @{
//! Class for row vectors (matrices with only one row) //! Class for row vectors (matrices with only one row)
skipping to change at line 91 skipping to change at line 91
arma_inline subview_row<eT> operator()(const span& col_span); arma_inline subview_row<eT> operator()(const span& col_span);
arma_inline const subview_row<eT> operator()(const span& col_span) const; arma_inline const subview_row<eT> operator()(const span& col_span) const;
inline void shed_col (const uword col_num); inline void shed_col (const uword col_num);
inline void shed_cols(const uword in_col1, const uword in_col2); inline void shed_cols(const uword in_col1, const uword in_col2);
inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero = true); inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero = true);
template<typename T1> inline void insert_cols(const uword col_num, const Base<eT,T1>& X); template<typename T1> inline void insert_cols(const uword col_num, const Base<eT,T1>& X);
arma_inline arma_warn_unused eT& at(const uword i); arma_inline arma_warn_unused eT& at(const uword i);
arma_inline arma_warn_unused eT at(const uword i) const; arma_inline arma_warn_unused const eT& at(const uword i) const;
arma_inline arma_warn_unused eT& at(const uword in_row, const uword in_co arma_inline arma_warn_unused eT& at(const uword in_row, const uword
l); in_col);
arma_inline arma_warn_unused eT at(const uword in_row, const uword in_co arma_inline arma_warn_unused const eT& at(const uword in_row, const uword
l) const; in_col) const;
typedef eT* row_iterator; typedef eT* row_iterator;
typedef const eT* const_row_iterator; typedef const eT* const_row_iterator;
inline row_iterator begin_row(const uword row_num); inline row_iterator begin_row(const uword row_num);
inline const_row_iterator begin_row(const uword row_num) const; inline const_row_iterator begin_row(const uword row_num) const;
inline row_iterator end_row (const uword row_num); inline row_iterator end_row (const uword row_num);
inline const_row_iterator end_row (const uword row_num) const; inline const_row_iterator end_row (const uword row_num) const;
skipping to change at line 127 skipping to change at line 127
}; };
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
class Row<eT>::fixed : public Row<eT> class Row<eT>::fixed : public Row<eT>
{ {
private: private:
static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc); static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
public: public:
typedef fixed<fixed_n_elem> Row_fixed_type; typedef fixed<fixed_n_elem> Row_fixed_type;
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;
static const bool is_col = false; static const bool is_col = false;
static const bool is_row = true; static const bool is_row = true;
skipping to change at line 173 skipping to change at line 173
#if defined(ARMA_USE_CXX11) #if defined(ARMA_USE_CXX11)
inline fixed(const std::initializer_list<eT>& list); inline fixed(const std::initializer_list<eT>& list);
inline const Row& operator=(const std::initializer_list<eT>& list); inline const Row& operator=(const std::initializer_list<eT>& list);
#endif #endif
arma_inline const Op< Row_fixed_type, op_htrans > t() const; arma_inline const Op< Row_fixed_type, op_htrans > t() const;
arma_inline const Op< Row_fixed_type, op_htrans > ht() const; arma_inline const Op< Row_fixed_type, op_htrans > ht() const;
arma_inline const Op< Row_fixed_type, op_strans > st() const; arma_inline const Op< Row_fixed_type, op_strans > st() const;
arma_inline arma_warn_unused eT& operator[] (const uword i); arma_inline arma_warn_unused const eT& at_alt (const uword i) const;
arma_inline arma_warn_unused eT operator[] (const uword i) const;
arma_inline arma_warn_unused eT& at (const uword i); arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT at (const uword i) const; arma_inline arma_warn_unused const eT& operator[] (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i); arma_inline arma_warn_unused eT& at (const uword i);
arma_inline arma_warn_unused eT operator() (const uword i) const; arma_inline arma_warn_unused const eT& at (const uword i) const;
arma_inline arma_warn_unused eT& operator() (const uword i);
arma_inline arma_warn_unused eT& at (const uword in_row, const uw arma_inline arma_warn_unused const eT& operator() (const uword i) const;
ord in_col);
arma_inline arma_warn_unused eT at (const uword in_row, const uw arma_inline arma_warn_unused eT& at (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uw arma_inline arma_warn_unused const eT& at (const uword in_row, co
ord in_col); nst uword in_col) const;
arma_inline arma_warn_unused eT operator() (const uword in_row, const uw arma_inline arma_warn_unused eT& operator() (const uword in_row, co
ord in_col) const; nst uword in_col);
arma_inline arma_warn_unused const eT& operator() (const uword in_row, co
nst uword in_col) const;
arma_inline arma_warn_unused eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline arma_warn_unused const eT* memptr() const; arma_inline arma_warn_unused const eT* memptr() const;
arma_hot inline const Row<eT>& fill(const eT val); arma_hot inline const Row<eT>& fill(const eT val);
arma_hot inline const Row<eT>& zeros(); arma_hot inline const Row<eT>& zeros();
arma_hot inline const Row<eT>& ones(); arma_hot inline const Row<eT>& ones();
}; };
//! @} //! @}
 End of changes. 5 change blocks. 
24 lines changed or deleted 26 lines changed or added


 Row_meat.hpp   Row_meat.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2013 Conrad Sanderson
// //
// 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 Row //! \addtogroup Row
//! @{ //! @{
//! construct an empty row vector //! construct an empty row vector
template<typename eT> template<typename eT>
skipping to change at line 326 skipping to change at line 326
Row<eT>::st() const Row<eT>::st() const
{ {
return Op<Row<eT>,op_strans>(*this); return Op<Row<eT>,op_strans>(*this);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT& eT&
Row<eT>::col(const uword col_num) Row<eT>::col(const uword col_num)
{ {
arma_debug_check( (col_num >= Mat<eT>::n_cols), "Row::col(): out of bound s" ); arma_debug_check( (col_num >= Mat<eT>::n_cols), "Row::col(): index out of bounds" );
return access::rw(Mat<eT>::mem[col_num]); return access::rw(Mat<eT>::mem[col_num]);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
Row<eT>::col(const uword col_num) const Row<eT>::col(const uword col_num) const
{ {
arma_debug_check( (col_num >= Mat<eT>::n_cols), "Row::col(): out of bound s" ); arma_debug_check( (col_num >= Mat<eT>::n_cols), "Row::col(): index out of bounds" );
return Mat<eT>::mem[col_num]; return Mat<eT>::mem[col_num];
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::cols(const uword in_col1, const uword in_col2) Row<eT>::cols(const uword in_col1, const uword in_col2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 465 skipping to change at line 465
} }
//! remove specified columns //! remove specified columns
template<typename eT> template<typename eT>
inline inline
void void
Row<eT>::shed_col(const uword col_num) Row<eT>::shed_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= Mat<eT>::n_cols, "Row::shed_col(): out of bo unds"); arma_debug_check( col_num >= Mat<eT>::n_cols, "Row::shed_col(): index out of bounds");
shed_cols(col_num, col_num); shed_cols(col_num, col_num);
} }
//! remove specified columns //! remove specified columns
template<typename eT> template<typename eT>
inline inline
void void
Row<eT>::shed_cols(const uword in_col1, const uword in_col2) Row<eT>::shed_cols(const uword in_col1, const uword in_col2)
{ {
skipping to change at line 520 skipping to change at line 520
Row<eT>::insert_cols(const uword col_num, const uword N, const bool set_to_ zero) Row<eT>::insert_cols(const uword col_num, const uword N, const bool set_to_ zero)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_cols = Mat<eT>::n_cols; const uword t_n_cols = Mat<eT>::n_cols;
const uword A_n_cols = col_num; const uword A_n_cols = col_num;
const uword B_n_cols = t_n_cols - col_num; const uword B_n_cols = t_n_cols - col_num;
// insertion at col_num == n_cols is in effect an append operation // insertion at col_num == n_cols is in effect an append operation
arma_debug_check( (col_num > t_n_cols), "Row::insert_cols(): out of bound s"); arma_debug_check( (col_num > t_n_cols), "Row::insert_cols(): index out of bounds");
if(N > 0) if(N > 0)
{ {
Row<eT> out(t_n_cols + N); Row<eT> out(t_n_cols + N);
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const eT* t_mem = (*this).memptr(); const eT* t_mem = (*this).memptr();
if(A_n_cols > 0) if(A_n_cols > 0)
{ {
skipping to change at line 573 skipping to change at line 573
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::at(const uword i) Row<eT>::at(const uword i)
{ {
return access::rw(Mat<eT>::mem[i]); return access::rw(Mat<eT>::mem[i]);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::at(const uword i) const Row<eT>::at(const uword i) const
{ {
return Mat<eT>::mem[i]; return Mat<eT>::mem[i];
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::at(const uword, const uword in_col) Row<eT>::at(const uword, const uword in_col)
{ {
return access::rw( Mat<eT>::mem[in_col] ); return access::rw( Mat<eT>::mem[in_col] );
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::at(const uword, const uword in_col) const Row<eT>::at(const uword, const uword in_col) const
{ {
return Mat<eT>::mem[in_col]; return Mat<eT>::mem[in_col];
} }
template<typename eT> template<typename eT>
inline inline
typename Row<eT>::row_iterator typename Row<eT>::row_iterator
Row<eT>::begin_row(const uword row_num) Row<eT>::begin_row(const uword row_num)
{ {
skipping to change at line 865 skipping to change at line 865
const Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, o p_strans > const Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, o p_strans >
Row<eT>::fixed<fixed_n_elem>::st() const Row<eT>::fixed<fixed_n_elem>::st() const
{ {
return Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type , op_strans >(*this); return Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type , op_strans >(*this);
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const eT&
Row<eT>::fixed<fixed_n_elem>::at_alt(const uword ii) const
{
#if defined(ARMA_HAVE_ALIGNED_ATTRIBUTE)
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
#else
const eT* mem_aligned = (use_extra) ? mem_local_extra : Mat<eT>::mem_lo
cal;
memory::mark_as_aligned(mem_aligned);
return mem_aligned[ii];
#endif
}
template<typename eT>
template<uword fixed_n_elem>
arma_inline
arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::operator[] (const uword ii) Row<eT>::fixed<fixed_n_elem>::operator[] (const uword ii)
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::fixed<fixed_n_elem>::operator[] (const uword ii) const Row<eT>::fixed<fixed_n_elem>::operator[] (const uword ii) const
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::at(const uword ii) Row<eT>::fixed<fixed_n_elem>::at(const uword ii)
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::fixed<fixed_n_elem>::at(const uword ii) const Row<eT>::fixed<fixed_n_elem>::at(const uword ii) const
{ {
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii) Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii)
{ {
arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): out of bounds") ; arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const
{ {
arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): out of bounds") ; arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): index out of bo unds");
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::at(const uword, const uword in_col) Row<eT>::fixed<fixed_n_elem>::at(const uword, const uword in_col)
{ {
return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ; return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::fixed<fixed_n_elem>::at(const uword, const uword in_col) const Row<eT>::fixed<fixed_n_elem>::at(const uword, const uword in_col) const
{ {
return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ; return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col) Row<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col)
{ {
arma_debug_check( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::opera tor(): out of bounds" ); arma_debug_check( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::opera tor(): index out of bounds" );
return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ; return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT const eT&
Row<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col) const Row<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword i n_col) const
{ {
arma_debug_check( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::opera tor(): out of bounds" ); arma_debug_check( ((in_row > 0) || (in_col >= fixed_n_elem)), "Row::opera tor(): index out of bounds" );
return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ; return (use_extra) ? mem_local_extra[in_col] : Mat<eT>::mem_local[in_col] ;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT* eT*
Row<eT>::fixed<fixed_n_elem>::memptr() Row<eT>::fixed<fixed_n_elem>::memptr()
 End of changes. 17 change blocks. 
17 lines changed or deleted 38 lines changed or added


 access.hpp   access.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2013 Conrad Sanderson
// //
// 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 access //! \addtogroup access
//! @{ //! @{
class access class access
{ {
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 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-2013 Conrad Sanderson // Copyright (C) 2009-2013 Conrad Sanderson
// //
// 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 3 #define ARMA_VERSION_MAJOR 3
#define ARMA_VERSION_MINOR 829 #define ARMA_VERSION_MINOR 900
#define ARMA_VERSION_PATCH 0 #define ARMA_VERSION_PATCH 0
#define ARMA_VERSION_NAME "experimental -- not for production use" #define ARMA_VERSION_NAME "Bavarian Sunflower"
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. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 arrayops_bones.hpp   arrayops_bones.hpp 
// Copyright (C) 2011-2012 NICTA (www.nicta.com.au) // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2011-2012 Conrad Sanderson // Copyright (C) 2011-2013 Conrad Sanderson
// //
// 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 arrayops //! \addtogroup arrayops
//! @{ //! @{
class arrayops class arrayops
{ {
skipping to change at line 77 skipping to change at line 77
template<typename eT> template<typename eT>
arma_hot inline static arma_hot inline static
void void
inplace_mul(eT* dest, const eT* src, const uword n_elem); inplace_mul(eT* dest, const eT* src, const uword n_elem);
template<typename eT> template<typename eT>
arma_hot inline static arma_hot inline static
void void
inplace_div(eT* dest, const eT* src, const uword n_elem); inplace_div(eT* dest, const eT* src, const uword n_elem);
template<typename eT>
arma_hot inline static
void
inplace_plus_base(eT* dest, const eT* src, const uword n_elem);
template<typename eT>
arma_hot inline static
void
inplace_minus_base(eT* dest, const eT* src, const uword n_elem);
template<typename eT>
arma_hot inline static
void
inplace_mul_base(eT* dest, const eT* src, const uword n_elem);
template<typename eT>
arma_hot inline static
void
inplace_div_base(eT* dest, const eT* src, const uword n_elem);
// //
// array op= scalar // array op= scalar
template<typename eT> template<typename eT>
arma_hot inline static arma_hot inline static
void void
inplace_set(eT* dest, const eT val, const uword n_elem); inplace_set(eT* dest, const eT val, const uword n_elem);
template<typename eT, const uword n_elem> template<typename eT, const uword n_elem>
arma_hot inline static arma_hot inline static
 End of changes. 2 change blocks. 
2 lines changed or deleted 22 lines changed or added


 arrayops_meat.hpp   arrayops_meat.hpp 
// Copyright (C) 2011-2012 NICTA (www.nicta.com.au) // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2011-2012 Conrad Sanderson // Copyright (C) 2011-2013 Conrad Sanderson
// //
// 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 arrayops //! \addtogroup arrayops
//! @{ //! @{
template<typename eT> template<typename eT>
arma_hot arma_hot
skipping to change at line 311 skipping to change at line 311
arrayops::convert_cx_scalar( dest[i], src[i] ); arrayops::convert_cx_scalar( dest[i], src[i] );
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_plus(eT* dest, const eT* src, const uword n_elem) arrayops::inplace_plus(eT* dest, const eT* src, const uword n_elem)
{ {
if(memory::is_aligned(dest))
{
memory::mark_as_aligned(dest);
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_plus_base(dest, src, n_elem);
}
else
{
arrayops::inplace_plus_base(dest, src, n_elem);
}
}
else
{
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_plus_base(dest, src, n_elem);
}
else
{
arrayops::inplace_plus_base(dest, src, n_elem);
}
}
}
template<typename eT>
arma_hot
inline
void
arrayops::inplace_minus(eT* dest, const eT* src, const uword n_elem)
{
if(memory::is_aligned(dest))
{
memory::mark_as_aligned(dest);
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_minus_base(dest, src, n_elem);
}
else
{
arrayops::inplace_minus_base(dest, src, n_elem);
}
}
else
{
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_minus_base(dest, src, n_elem);
}
else
{
arrayops::inplace_minus_base(dest, src, n_elem);
}
}
}
template<typename eT>
arma_hot
inline
void
arrayops::inplace_mul(eT* dest, const eT* src, const uword n_elem)
{
if(memory::is_aligned(dest))
{
memory::mark_as_aligned(dest);
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_mul_base(dest, src, n_elem);
}
else
{
arrayops::inplace_mul_base(dest, src, n_elem);
}
}
else
{
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_mul_base(dest, src, n_elem);
}
else
{
arrayops::inplace_mul_base(dest, src, n_elem);
}
}
}
template<typename eT>
arma_hot
inline
void
arrayops::inplace_div(eT* dest, const eT* src, const uword n_elem)
{
if(memory::is_aligned(dest))
{
memory::mark_as_aligned(dest);
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_div_base(dest, src, n_elem);
}
else
{
arrayops::inplace_div_base(dest, src, n_elem);
}
}
else
{
if(memory::is_aligned(src))
{
memory::mark_as_aligned(src);
arrayops::inplace_div_base(dest, src, n_elem);
}
else
{
arrayops::inplace_div_base(dest, src, n_elem);
}
}
}
template<typename eT>
arma_hot
inline
void
arrayops::inplace_plus_base(eT* dest, const eT* src, const uword n_elem)
{
uword i,j; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2) for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
const eT tmp_i = src[i]; const eT tmp_i = src[i];
const eT tmp_j = src[j]; const eT tmp_j = src[j];
dest[i] += tmp_i; dest[i] += tmp_i;
dest[j] += tmp_j; dest[j] += tmp_j;
} }
skipping to change at line 332 skipping to change at line 476
if(i < n_elem) if(i < n_elem)
{ {
dest[i] += src[i]; dest[i] += src[i];
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_minus(eT* dest, const eT* src, const uword n_elem) arrayops::inplace_minus_base(eT* dest, const eT* src, const uword n_elem)
{ {
uword i,j; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2) for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
const eT tmp_i = src[i]; const eT tmp_i = src[i];
const eT tmp_j = src[j]; const eT tmp_j = src[j];
dest[i] -= tmp_i; dest[i] -= tmp_i;
dest[j] -= tmp_j; dest[j] -= tmp_j;
skipping to change at line 355 skipping to change at line 499
if(i < n_elem) if(i < n_elem)
{ {
dest[i] -= src[i]; dest[i] -= src[i];
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_mul(eT* dest, const eT* src, const uword n_elem) arrayops::inplace_mul_base(eT* dest, const eT* src, const uword n_elem)
{ {
uword i,j; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2) for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
const eT tmp_i = src[i]; const eT tmp_i = src[i];
const eT tmp_j = src[j]; const eT tmp_j = src[j];
dest[i] *= tmp_i; dest[i] *= tmp_i;
dest[j] *= tmp_j; dest[j] *= tmp_j;
skipping to change at line 378 skipping to change at line 522
if(i < n_elem) if(i < n_elem)
{ {
dest[i] *= src[i]; dest[i] *= src[i];
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_div(eT* dest, const eT* src, const uword n_elem) arrayops::inplace_div_base(eT* dest, const eT* src, const uword n_elem)
{ {
uword i,j; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2) for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
const eT tmp_i = src[i]; const eT tmp_i = src[i];
const eT tmp_j = src[j]; const eT tmp_j = src[j];
dest[i] /= tmp_i; dest[i] /= tmp_i;
dest[j] /= tmp_j; dest[j] /= tmp_j;
skipping to change at line 403 skipping to change at line 547
dest[i] /= src[i]; dest[i] /= src[i];
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_set(eT* dest, const eT val, const uword n_elem) arrayops::inplace_set(eT* dest, const eT val, const uword n_elem)
{ {
uword i,j; if(memory::is_aligned(dest))
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
dest[i] = val; memory::mark_as_aligned(dest);
dest[j] = val;
}
if(i < n_elem) uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] = val;
dest[j] = val;
}
if(i < n_elem)
{
dest[i] = val;
}
}
else
{ {
dest[i] = val; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] = val;
dest[j] = val;
}
if(i < n_elem)
{
dest[i] = val;
}
} }
} }
template<typename eT, const uword n_elem> template<typename eT, const uword n_elem>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_set_fixed(eT* dest, const eT val) arrayops::inplace_set_fixed(eT* dest, const eT val)
{ {
for(uword i=0; i<n_elem; ++i) for(uword i=0; i<n_elem; ++i)
skipping to change at line 435 skipping to change at line 599
dest[i] = val; dest[i] = val;
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_plus(eT* dest, const eT val, const uword n_elem) arrayops::inplace_plus(eT* dest, const eT val, const uword n_elem)
{ {
uword i,j; if(memory::is_aligned(dest))
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
dest[i] += val; memory::mark_as_aligned(dest);
dest[j] += val;
}
if(i < n_elem) uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] += val;
dest[j] += val;
}
if(i < n_elem)
{
dest[i] += val;
}
}
else
{ {
dest[i] += val; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] += val;
dest[j] += val;
}
if(i < n_elem)
{
dest[i] += val;
}
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_minus(eT* dest, const eT val, const uword n_elem) arrayops::inplace_minus(eT* dest, const eT val, const uword n_elem)
{ {
uword i,j; if(memory::is_aligned(dest))
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
dest[i] -= val; memory::mark_as_aligned(dest);
dest[j] -= val;
}
if(i < n_elem) uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] -= val;
dest[j] -= val;
}
if(i < n_elem)
{
dest[i] -= val;
}
}
else
{ {
dest[i] -= val; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] -= val;
dest[j] -= val;
}
if(i < n_elem)
{
dest[i] -= val;
}
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_mul(eT* dest, const eT val, const uword n_elem) arrayops::inplace_mul(eT* dest, const eT val, const uword n_elem)
{ {
uword i,j; if(memory::is_aligned(dest))
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
dest[i] *= val; memory::mark_as_aligned(dest);
dest[j] *= val;
}
if(i < n_elem) uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] *= val;
dest[j] *= val;
}
if(i < n_elem)
{
dest[i] *= val;
}
}
else
{ {
dest[i] *= val; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] *= val;
dest[j] *= val;
}
if(i < n_elem)
{
dest[i] *= val;
}
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
inline inline
void void
arrayops::inplace_div(eT* dest, const eT val, const uword n_elem) arrayops::inplace_div(eT* dest, const eT val, const uword n_elem)
{ {
uword i,j; if(memory::is_aligned(dest))
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
dest[i] /= val; memory::mark_as_aligned(dest);
dest[j] /= val;
}
if(i < n_elem) uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] /= val;
dest[j] /= val;
}
if(i < n_elem)
{
dest[i] /= val;
}
}
else
{ {
dest[i] /= val; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2)
{
dest[i] /= val;
dest[j] /= val;
}
if(i < n_elem)
{
dest[i] /= val;
}
} }
} }
template<typename eT> template<typename eT>
arma_hot arma_hot
arma_pure arma_pure
inline inline
eT eT
arrayops::accumulate(const eT* src, const uword n_elem) arrayops::accumulate(const eT* src, const uword n_elem)
{ {
 End of changes. 25 change blocks. 
45 lines changed or deleted 289 lines changed or added


 compiler_setup.hpp   compiler_setup.hpp 
skipping to change at line 13 skipping to change at line 13
// //
// 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/.
#define arma_hot #define arma_hot
#define arma_cold #define arma_cold
#define arma_pure #define arma_pure
#define arma_const #define arma_const
#define arma_aligned #define arma_aligned
#define arma_align_mem
#define arma_warn_unused #define arma_warn_unused
#define arma_deprecated #define arma_deprecated
#define arma_malloc #define arma_malloc
#define arma_inline inline #define arma_inline inline
#define arma_noinline #define arma_noinline
#define arma_ignore(variable) ((void)(variable)) #define arma_ignore(variable) ((void)(variable))
#if defined(ARMA_BLAS_UNDERSCORE) #if defined(ARMA_BLAS_UNDERSCORE)
#define arma_fortran2_noprefix(function) function##_ #define arma_fortran2_noprefix(function) function##_
#define arma_fortran2_prefix(function) wrapper_##function##_ #define arma_fortran2_prefix(function) wrapper_##function##_
skipping to change at line 41 skipping to change at line 42
#else #else
#define arma_fortran(function) arma_fortran2_noprefix(function) #define arma_fortran(function) arma_fortran2_noprefix(function)
#define arma_atlas(function) function #define arma_atlas(function) function
#endif #endif
#define arma_fortran_prefix(function) arma_fortran2_prefix(function) #define arma_fortran_prefix(function) arma_fortran2_prefix(function)
#define arma_fortran_noprefix(function) arma_fortran2_noprefix(function) #define arma_fortran_noprefix(function) arma_fortran2_noprefix(function)
#define ARMA_INCFILE_WRAP(x) <x> #define ARMA_INCFILE_WRAP(x) <x>
#if ( ((_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600)) && !defined(
__MINGW32__) && !defined(__APPLE__) )
#define ARMA_HAVE_POSIX_MEMALIGN
#endif
#if (__cplusplus >= 201103L) #if (__cplusplus >= 201103L)
#if !defined(ARMA_USE_CXX11) #if !defined(ARMA_USE_CXX11)
#define ARMA_USE_CXX11 #define ARMA_USE_CXX11
#endif #endif
#endif #endif
#if defined(ARMA_USE_CXX11) #if defined(ARMA_USE_CXX11)
#if !defined(ARMA_USE_U64S64) #if !defined(ARMA_USE_U64S64)
#define ARMA_USE_U64S64 #define ARMA_USE_U64S64
#endif #endif
skipping to change at line 72 skipping to change at line 77
#error "*** Need a newer compiler ***" #error "*** Need a newer compiler ***"
#endif #endif
#define ARMA_GOOD_COMPILER #define ARMA_GOOD_COMPILER
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
#if (__INTEL_COMPILER <= 1110) #if (__INTEL_COMPILER <= 1110)
#undef ARMA_HAVE_STD_ISFINITE #undef ARMA_HAVE_STD_ISFINITE
#endif #endif
#undef arma_aligned
#undef arma_align_mem
#define arma_aligned __attribute__((aligned(16)));
#define arma_align_mem __attribute__((aligned(16)));
#define ARMA_HAVE_ALIGNED_ATTRIBUTE
#define ARMA_HAVE_ICC_ASSUME_ALIGNED
#elif defined(__GNUG__) #elif defined(__GNUG__)
#if (__GNUC__ < 4) #if (__GNUC__ < 4)
#error "*** Need a newer compiler ***" #error "*** Need a newer compiler ***"
#endif #endif
#define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNU C_PATCHLEVEL__) #define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNU C_PATCHLEVEL__)
#define ARMA_GOOD_COMPILER #define ARMA_GOOD_COMPILER
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
#undef arma_pure #undef arma_pure
#undef arma_const #undef arma_const
#undef arma_aligned #undef arma_aligned
#undef arma_align_mem
#undef arma_warn_unused #undef arma_warn_unused
#undef arma_deprecated #undef arma_deprecated
#undef arma_malloc #undef arma_malloc
#undef arma_inline #undef arma_inline
#undef arma_noinline #undef arma_noinline
#define arma_pure __attribute__((__pure__)) #define arma_pure __attribute__((__pure__))
#define arma_const __attribute__((__const__)) #define arma_const __attribute__((__const__))
#define arma_aligned __attribute__((__aligned__)) #define arma_aligned __attribute__((__aligned__))
#define arma_align_mem __attribute__((__aligned__(16)))
#define arma_warn_unused __attribute__((__warn_unused_result__)) #define arma_warn_unused __attribute__((__warn_unused_result__))
#define arma_deprecated __attribute__((__deprecated__)) #define arma_deprecated __attribute__((__deprecated__))
#define arma_malloc __attribute__((__malloc__)) #define arma_malloc __attribute__((__malloc__))
#define arma_inline inline __attribute__((__always_inline__)) #define arma_inline inline __attribute__((__always_inline__))
#define arma_noinline __attribute__((__noinline__)) #define arma_noinline __attribute__((__noinline__))
#define ARMA_HAVE_ALIGNED_ATTRIBUTE
#if (ARMA_GCC_VERSION >= 40300) #if (ARMA_GCC_VERSION >= 40300)
#undef arma_hot #undef arma_hot
#undef arma_cold #undef arma_cold
#define arma_hot __attribute__((__hot__)) #define arma_hot __attribute__((__hot__))
#define arma_cold __attribute__((__cold__)) #define arma_cold __attribute__((__cold__))
#endif #endif
#if (ARMA_GCC_VERSION >= 40200) #if (ARMA_GCC_VERSION >= 40200)
#if defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(_GLIBCXX_USE_C99_COMP LEX_TR1) #if defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(_GLIBCXX_USE_C99_COMP LEX_TR1)
skipping to change at line 133 skipping to change at line 151
#if defined(__clang__) #if defined(__clang__)
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
//#undef ARMA_GOOD_COMPILER //#undef ARMA_GOOD_COMPILER
#endif #endif
#if ( (ARMA_GCC_VERSION >= 40700) && (ARMA_GCC_VERSION <= 40701) ) #if ( (ARMA_GCC_VERSION >= 40700) && (ARMA_GCC_VERSION <= 40701) )
#error "gcc versions 4.7.0 and 4.7.1 are unsupported; use 4.7.2 or late r" #error "gcc versions 4.7.0 and 4.7.1 are unsupported; use 4.7.2 or late r"
// due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549 // due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549
#endif #endif
#if (ARMA_GCC_VERSION >= 40700)
#define ARMA_HAVE_GCC_ASSUME_ALIGNED
// TODO: future versions of clang may also have __builtin_assume_aligne
d
#endif
#undef ARMA_GCC_VERSION #undef ARMA_GCC_VERSION
#endif #endif
#if defined(__APPLE__) #if defined(__APPLE__)
#define ARMA_BLAS_SDOT_BUG #define ARMA_BLAS_SDOT_BUG
#endif #endif
#if defined(_MSC_VER) #if defined(_MSC_VER)
skipping to change at line 159 skipping to change at line 182
#undef ARMA_HAVE_STD_SNPRINTF #undef ARMA_HAVE_STD_SNPRINTF
#undef ARMA_HAVE_LOG1P #undef ARMA_HAVE_LOG1P
#undef ARMA_HAVE_STD_ISINF #undef ARMA_HAVE_STD_ISINF
#undef ARMA_HAVE_STD_ISNAN #undef ARMA_HAVE_STD_ISNAN
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
#undef arma_inline #undef arma_inline
#define arma_inline inline __forceinline #define arma_inline inline __forceinline
#undef arma_aligned #undef arma_aligned
#define arma_aligned __declspec(align(16)) #undef arma_align_mem
#define arma_aligned __declspec(align(16))
#define arma_align_mem __declspec(align(16))
#define ARMA_HAVE_ALIGNED_ATTRIBUTE
#endif #endif
#if defined(__CUDACC__) #if defined(__CUDACC__)
#undef ARMA_HAVE_STD_ISFINITE #undef ARMA_HAVE_STD_ISFINITE
#undef ARMA_HAVE_STD_SNPRINTF #undef ARMA_HAVE_STD_SNPRINTF
#undef ARMA_HAVE_LOG1P #undef ARMA_HAVE_LOG1P
#undef ARMA_HAVE_STD_ISINF #undef ARMA_HAVE_STD_ISINF
#undef ARMA_HAVE_STD_ISNAN #undef ARMA_HAVE_STD_ISNAN
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
 End of changes. 8 change blocks. 
1 lines changed or deleted 31 lines changed or added


 config.hpp   config.hpp 
skipping to change at line 42 skipping to change at line 42
//// Uncomment the above line if your BLAS and LAPACK libraries have functi on names with a trailing underscore. //// Uncomment the above line if your BLAS and LAPACK libraries have functi on names with a trailing underscore.
//// Conversely, comment it out if the function names don't have a trailing underscore. //// Conversely, comment it out if the function names don't have a trailing underscore.
// #define ARMA_BLAS_LONG // #define ARMA_BLAS_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int" //// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int"
// #define ARMA_BLAS_LONG_LONG // #define ARMA_BLAS_LONG_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long l ong" instead of "int" //// Uncomment the above line if your BLAS and LAPACK libraries use "long l ong" instead of "int"
// #define ARMA_USE_TBB_ALLOC // #define ARMA_USE_TBB_ALLOC
//// Uncomment the above line if you want to use Intel TBB scalable_malloc( ) and scalable_free() instead of standard new[] and delete[] //// Uncomment the above line if you want to use Intel TBB scalable_malloc( ) and scalable_free() instead of standard malloc() and free()
// #define ARMA_USE_MKL_ALLOC // #define ARMA_USE_MKL_ALLOC
//// Uncomment the above line if you want to use Intel MKL mkl_malloc() and mkl_free() instead of standard new[] and delete[] //// Uncomment the above line if you want to use Intel MKL mkl_malloc() and mkl_free() instead of standard malloc() and free()
#define ARMA_USE_ATLAS #define ARMA_USE_ATLAS
#define ARMA_ATLAS_INCLUDE_DIR /usr/include/ #define ARMA_ATLAS_INCLUDE_DIR /usr/include/
//// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h //// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h
//// uncomment the above define and specify the appropriate include directo ry. //// uncomment the above define and specify the appropriate include directo ry.
//// Make sure the directory has a trailing / //// Make sure the directory has a trailing /
#if !defined(ARMA_64BIT_WORD) #if !defined(ARMA_64BIT_WORD)
// #define ARMA_64BIT_WORD // #define ARMA_64BIT_WORD
//// Uncomment the above line if you require matrices/vectors capable of ho lding more than 4 billion elements. //// Uncomment the above line if you require matrices/vectors capable of ho lding more than 4 billion elements.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 diagview_bones.hpp   diagview_bones.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2013 Conrad Sanderson
// //
// 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 diagview //! \addtogroup diagview
//! @{ //! @{
//! Class for storing data required to extract and set the diagonals of a m atrix //! Class for storing data required to extract and set the diagonals of a m atrix
template<typename eT> template<typename eT>
skipping to change at line 54 skipping to change at line 54
inline void operator-=(const eT val); inline void operator-=(const eT val);
inline void operator*=(const eT val); inline void operator*=(const eT val);
inline void operator/=(const eT val); inline void operator/=(const eT val);
template<typename T1> inline void operator= (const Base<eT,T1>& x); template<typename T1> inline void operator= (const Base<eT,T1>& x);
template<typename T1> inline void operator+=(const Base<eT,T1>& x); template<typename T1> inline void operator+=(const Base<eT,T1>& x);
template<typename T1> inline void operator-=(const Base<eT,T1>& x); template<typename T1> inline void operator-=(const Base<eT,T1>& x);
template<typename T1> inline void operator%=(const Base<eT,T1>& x); template<typename T1> inline void operator%=(const Base<eT,T1>& x);
template<typename T1> inline void operator/=(const Base<eT,T1>& x); template<typename T1> inline void operator/=(const Base<eT,T1>& x);
arma_inline eT at_alt (const uword ii) const;
arma_inline eT& operator[](const uword ii); arma_inline eT& operator[](const uword ii);
arma_inline eT operator[](const uword ii) const; arma_inline eT operator[](const uword ii) const;
arma_inline eT& at(const uword ii); arma_inline eT& at(const uword ii);
arma_inline eT at(const uword ii) const; arma_inline eT at(const uword ii) const;
arma_inline eT& operator()(const uword ii); arma_inline eT& operator()(const uword ii);
arma_inline eT operator()(const uword ii) const; arma_inline eT operator()(const uword ii) const;
arma_inline eT& at(const uword in_n_row, const uword); arma_inline eT& at(const uword in_n_row, const uword);
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 diagview_meat.hpp   diagview_meat.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2013 Conrad Sanderson
// //
// 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 diagview //! \addtogroup diagview
//! @{ //! @{
template<typename eT> template<typename eT>
inline inline
skipping to change at line 682 skipping to change at line 682
} }
if(i < in_n_elem) if(i < in_n_elem)
{ {
out_mem[i] /= in_m.at( i + in_row_offset, i + in_col_offset ); out_mem[i] /= in_m.at( i + in_row_offset, i + in_col_offset );
} }
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT
diagview<eT>::at_alt(const uword ii) const
{
return m.at(ii+row_offset, ii+col_offset);
}
template<typename eT>
arma_inline
eT& eT&
diagview<eT>::operator[](const uword ii) diagview<eT>::operator[](const uword ii)
{ {
return (const_cast< Mat<eT>& >(m)).at(ii+row_offset, ii+col_offset); return (const_cast< Mat<eT>& >(m)).at(ii+row_offset, ii+col_offset);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
diagview<eT>::operator[](const uword ii) const diagview<eT>::operator[](const uword ii) const
 End of changes. 2 change blocks. 
2 lines changed or deleted 10 lines changed or added


 diskio_meat.hpp   diskio_meat.hpp 
skipping to change at line 2012 skipping to change at line 2012
// If these are the same type, it is simple. // If these are the same type, it is simple.
if(H5Tequal(datatype, mat_type) > 0) if(H5Tequal(datatype, mat_type) > 0)
{ {
// Load directly; H5S_ALL used so that we load the entire dataset . // Load directly; H5S_ALL used so that we load the entire dataset .
hid_t read_status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, void_ptr(x.memptr())); hid_t read_status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, void_ptr(x.memptr()));
if(read_status >= 0) { load_okay = true; } if(read_status >= 0) { load_okay = true; }
} }
else else
{ {
// Load as another matrix and convert accordingly. // Load into another array and convert its type accordingly.
hid_t read_status = hdf5_misc::load_and_convert_hdf5(x.memptr(), dataset, datatype, x.n_elem); hid_t read_status = hdf5_misc::load_and_convert_hdf5(x.memptr(), dataset, datatype, x.n_elem);
if(read_status >= 0) { load_okay = true; } if(read_status >= 0) { load_okay = true; }
} }
// Now clean up. // Now clean up.
H5Tclose(datatype); H5Tclose(datatype);
H5Tclose(mat_type); H5Tclose(mat_type);
H5Sclose(filespace); H5Sclose(filespace);
} }
skipping to change at line 3558 skipping to change at line 3558
// If these are the same type, it is simple. // If these are the same type, it is simple.
if(H5Tequal(datatype, mat_type) > 0) if(H5Tequal(datatype, mat_type) > 0)
{ {
// Load directly; H5S_ALL used so that we load the entire dataset . // Load directly; H5S_ALL used so that we load the entire dataset .
hid_t read_status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, void_ptr(x.memptr())); hid_t read_status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, void_ptr(x.memptr()));
if(read_status >= 0) { load_okay = true; } if(read_status >= 0) { load_okay = true; }
} }
else else
{ {
// Load as another matrix and convert accordingly. // Load into another array and convert its type accordingly.
hid_t read_status = hdf5_misc::load_and_convert_hdf5(x.memptr(), dataset, datatype, x.n_elem); hid_t read_status = hdf5_misc::load_and_convert_hdf5(x.memptr(), dataset, datatype, x.n_elem);
if(read_status >= 0) { load_okay = true; } if(read_status >= 0) { load_okay = true; }
} }
// Now clean up. // Now clean up.
H5Tclose(datatype); H5Tclose(datatype);
H5Tclose(mat_type); H5Tclose(mat_type);
H5Sclose(filespace); H5Sclose(filespace);
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 eGlueCube_bones.hpp   eGlueCube_bones.hpp 
// Copyright (C) 2010-2011 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2011 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eGlueCube //! \addtogroup eGlueCube
//! @{ //! @{
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
class eGlueCube : public BaseCube<typename T1::elem_type, eGlueCube<T1, T2, eglue_type> > class eGlueCube : public BaseCube<typename T1::elem_type, eGlueCube<T1, T2, eglue_type> >
skipping to change at line 34 skipping to change at line 34
arma_inline ~eGlueCube(); arma_inline ~eGlueCube();
arma_inline eGlueCube(const T1& in_A, const T2& in_B); arma_inline eGlueCube(const T1& in_A, const T2& in_B);
arma_inline uword get_n_rows() const; arma_inline uword get_n_rows() const;
arma_inline uword get_n_cols() const; arma_inline uword get_n_cols() const;
arma_inline uword get_n_elem_slice() const; arma_inline uword get_n_elem_slice() const;
arma_inline uword get_n_slices() const; arma_inline uword get_n_slices() const;
arma_inline uword get_n_elem() const; arma_inline uword get_n_elem() const;
arma_inline elem_type operator[] (const uword i) const; arma_inline elem_type operator[] (const uword i) const;
arma_inline elem_type at (const uword row, const uword col, const uword slice) const; arma_inline elem_type at (const uword row, const uword col, const uword slice) const;
arma_inline elem_type at_alt (const uword i) const;
}; };
//! @} //! @}
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added


 eGlueCube_meat.hpp   eGlueCube_meat.hpp 
// Copyright (C) 2010-2011 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2011 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eGlueCube //! \addtogroup eGlueCube
//! @{ //! @{
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
arma_inline arma_inline
skipping to change at line 100 skipping to change at line 100
eGlueCube<T1,T2,eglue_type>::at(const uword row, const uword col, const uwo rd slice) const eGlueCube<T1,T2,eglue_type>::at(const uword row, const uword col, const uwo rd slice) const
{ {
// the optimiser will keep only one return statement // the optimiser will keep only one return statement
if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1 .at(row,col,slice) + P2.at(row,col,slice); } if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1 .at(row,col,slice) + P2.at(row,col,slice); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1 .at(row,col,slice) - P2.at(row,col,slice); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1 .at(row,col,slice) - P2.at(row,col,slice); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { return P1 .at(row,col,slice) / P2.at(row,col,slice); } else if(is_same_type<eglue_type, eglue_div >::value == true) { return P1 .at(row,col,slice) / P2.at(row,col,slice); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1 .at(row,col,slice) * P2.at(row,col,slice); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1 .at(row,col,slice) * P2.at(row,col,slice); }
} }
template<typename T1, typename T2, typename eglue_type>
arma_inline
typename T1::elem_type
eGlueCube<T1,T2,eglue_type>::at_alt(const uword i) const
{
// the optimiser will keep only one return statement
if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1
.at_alt(i) + P2.at_alt(i); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1
.at_alt(i) - P2.at_alt(i); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { return P1
.at_alt(i) / P2.at_alt(i); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1
.at_alt(i) * P2.at_alt(i); }
}
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 19 lines changed or added


 eGlue_bones.hpp   eGlue_bones.hpp 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2012 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eGlue //! \addtogroup eGlue
//! @{ //! @{
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
class eGlue : public Base<typename T1::elem_type, eGlue<T1, T2, eglue_type> > class eGlue : public Base<typename T1::elem_type, eGlue<T1, T2, eglue_type> >
skipping to change at line 41 skipping to change at line 41
arma_inline ~eGlue(); arma_inline ~eGlue();
arma_inline eGlue(const T1& in_A, const T2& in_B); arma_inline eGlue(const T1& in_A, const T2& in_B);
arma_inline uword get_n_rows() const; arma_inline uword get_n_rows() const;
arma_inline uword get_n_cols() const; arma_inline uword get_n_cols() const;
arma_inline uword get_n_elem() const; arma_inline uword get_n_elem() const;
arma_inline elem_type operator[] (const uword ii) const ; arma_inline elem_type operator[] (const uword ii) const ;
arma_inline elem_type at (const uword row, const uword col) const ; arma_inline elem_type at (const uword row, const uword col) const ;
arma_inline elem_type at_alt (const uword ii) const ;
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 eGlue_meat.hpp   eGlue_meat.hpp 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2012 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eGlue //! \addtogroup eGlue
//! @{ //! @{
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
arma_inline arma_inline
skipping to change at line 85 skipping to change at line 85
eGlue<T1,T2,eglue_type>::at(const uword row, const uword col) const eGlue<T1,T2,eglue_type>::at(const uword row, const uword col) const
{ {
// the optimiser will keep only one return statement // the optimiser will keep only one return statement
if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1 .at(row,col) + P2.at(row,col); } if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1 .at(row,col) + P2.at(row,col); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1 .at(row,col) - P2.at(row,col); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1 .at(row,col) - P2.at(row,col); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { return P1 .at(row,col) / P2.at(row,col); } else if(is_same_type<eglue_type, eglue_div >::value == true) { return P1 .at(row,col) / P2.at(row,col); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1 .at(row,col) * P2.at(row,col); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1 .at(row,col) * P2.at(row,col); }
} }
template<typename T1, typename T2, typename eglue_type>
arma_inline
typename T1::elem_type
eGlue<T1,T2,eglue_type>::at_alt(const uword ii) const
{
// the optimiser will keep only one return statement
if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1
.at_alt(ii) + P2.at_alt(ii); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1
.at_alt(ii) - P2.at_alt(ii); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { return P1
.at_alt(ii) / P2.at_alt(ii); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1
.at_alt(ii) * P2.at_alt(ii); }
}
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 19 lines changed or added


 eOpCube_bones.hpp   eOpCube_bones.hpp 
// Copyright (C) 2010-2011 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2011 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eOpCube //! \addtogroup eOpCube
//! @{ //! @{
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
class eOpCube : public BaseCube<typename T1::elem_type, eOpCube<T1, eop_typ e> > class eOpCube : public BaseCube<typename T1::elem_type, eOpCube<T1, eop_typ e> >
skipping to change at line 43 skipping to change at line 43
inline eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uwo rd_b, const uword in_aux_uword_c); inline eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uwo rd_b, const uword in_aux_uword_c);
arma_inline uword get_n_rows() const; arma_inline uword get_n_rows() const;
arma_inline uword get_n_cols() const; arma_inline uword get_n_cols() const;
arma_inline uword get_n_elem_slice() const; arma_inline uword get_n_elem_slice() const;
arma_inline uword get_n_slices() const; arma_inline uword get_n_slices() const;
arma_inline uword get_n_elem() const; arma_inline uword get_n_elem() const;
arma_inline elem_type operator[] (const uword i) const; arma_inline elem_type operator[] (const uword i) const;
arma_inline elem_type at (const uword row, const uword col, const uword slice) const; arma_inline elem_type at (const uword row, const uword col, const uword slice) const;
arma_inline elem_type at_alt (const uword i) const;
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 eOpCube_meat.hpp   eOpCube_meat.hpp 
// Copyright (C) 2010-2011 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2011 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eOpCube //! \addtogroup eOpCube
//! @{ //! @{
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m) eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m)
skipping to change at line 118 skipping to change at line 118
} }
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
arma_inline arma_inline
typename T1::elem_type typename T1::elem_type
eOpCube<T1, eop_type>::at(const uword row, const uword col, const uword sli ce) const eOpCube<T1, eop_type>::at(const uword row, const uword col, const uword sli ce) const
{ {
return eop_core<eop_type>::process(P.at(row, col, slice), aux); return eop_core<eop_type>::process(P.at(row, col, slice), aux);
} }
template<typename T1, typename eop_type>
arma_inline
typename T1::elem_type
eOpCube<T1, eop_type>::at_alt(const uword i) const
{
return eop_core<eop_type>::process(P.at_alt(i), aux);
}
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 10 lines changed or added


 eOp_bones.hpp   eOp_bones.hpp 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2012 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eOp //! \addtogroup eOp
//! @{ //! @{
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
class eOp : public Base<typename T1::elem_type, eOp<T1, eop_type> > class eOp : public Base<typename T1::elem_type, eOp<T1, eop_type> >
skipping to change at line 46 skipping to change at line 46
inline eOp(const T1& in_m, const elem_type in_aux); inline eOp(const T1& in_m, const elem_type in_aux);
inline eOp(const T1& in_m, const uword in_aux_uword_a, const uwo rd in_aux_uword_b); inline eOp(const T1& in_m, const uword in_aux_uword_a, const uwo rd in_aux_uword_b);
inline eOp(const T1& in_m, const elem_type in_aux, const uword i n_aux_uword_a, const uword in_aux_uword_b); inline eOp(const T1& in_m, const elem_type in_aux, const uword i n_aux_uword_a, const uword in_aux_uword_b);
arma_inline uword get_n_rows() const; arma_inline uword get_n_rows() const;
arma_inline uword get_n_cols() const; arma_inline uword get_n_cols() const;
arma_inline uword get_n_elem() const; arma_inline uword get_n_elem() const;
arma_inline elem_type operator[] (const uword ii) const ; arma_inline elem_type operator[] (const uword ii) const ;
arma_inline elem_type at (const uword row, const uword col) const ; arma_inline elem_type at (const uword row, const uword col) const ;
arma_inline elem_type at_alt (const uword ii) const ;
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 eOp_meat.hpp   eOp_meat.hpp 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2012 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eOp //! \addtogroup eOp
//! @{ //! @{
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
eOp<T1, eop_type>::eOp(const T1& in_m) eOp<T1, eop_type>::eOp(const T1& in_m)
skipping to change at line 103 skipping to change at line 103
if(is_col) if(is_col)
{ {
return eop_core<eop_type>::process(P.at(row, 0), aux); return eop_core<eop_type>::process(P.at(row, 0), aux);
} }
else else
{ {
return eop_core<eop_type>::process(P.at(row, col), aux); return eop_core<eop_type>::process(P.at(row, col), aux);
} }
} }
template<typename T1, typename eop_type>
arma_inline
typename T1::elem_type
eOp<T1, eop_type>::at_alt(const uword ii) const
{
return eop_core<eop_type>::process(P.at_alt(ii), aux);
}
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 10 lines changed or added


 eglue_core_meat.hpp   eglue_core_meat.hpp 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2012 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eglue_core //! \addtogroup eglue_core
//! @{ //! @{
#undef arma_applier_1 #undef arma_applier_1u
#undef arma_applier_1a
#undef arma_applier_2 #undef arma_applier_2
#undef arma_applier_3 #undef arma_applier_3
#undef operatorA #undef operatorA
#undef operatorB #undef operatorB
#define arma_applier_1(operatorA, operatorB) \ #define arma_applier_1u(operatorA, operatorB) \
{\ {\
uword i,j;\ uword i,j;\
\ \
for(i=0, j=1; j<n_elem; i+=2, j+=2)\ for(i=0, j=1; j<n_elem; i+=2, j+=2)\
{\ {\
eT tmp_i = P1[i];\ eT tmp_i = P1[i];\
eT tmp_j = P1[j];\ eT tmp_j = P1[j];\
\ \
tmp_i operatorB##= P2[i];\ tmp_i operatorB##= P2[i];\
tmp_j operatorB##= P2[j];\ tmp_j operatorB##= P2[j];\
skipping to change at line 39 skipping to change at line 40
out_mem[i] operatorA tmp_i;\ out_mem[i] operatorA tmp_i;\
out_mem[j] operatorA tmp_j;\ out_mem[j] operatorA tmp_j;\
}\ }\
\ \
if(i < n_elem)\ if(i < n_elem)\
{\ {\
out_mem[i] operatorA P1[i] operatorB P2[i];\ out_mem[i] operatorA P1[i] operatorB P2[i];\
}\ }\
} }
#define arma_applier_1a(operatorA, operatorB) \
{\
uword i,j;\
\
for(i=0, j=1; j<n_elem; i+=2, j+=2)\
{\
eT tmp_i = P1.at_alt(i);\
eT tmp_j = P1.at_alt(j);\
\
tmp_i operatorB##= P2.at_alt(i);\
tmp_j operatorB##= P2.at_alt(j);\
\
out_mem[i] operatorA tmp_i;\
out_mem[j] operatorA tmp_j;\
}\
\
if(i < n_elem)\
{\
out_mem[i] operatorA P1.at_alt(i) operatorB P2.at_alt(i);\
}\
}
#define arma_applier_2(operatorA, operatorB) \ #define arma_applier_2(operatorA, operatorB) \
{\ {\
if(n_rows != 1)\ if(n_rows != 1)\
{\ {\
for(uword col=0; col<n_cols; ++col)\ for(uword col=0; col<n_cols; ++col)\
{\ {\
uword i,j;\ uword i,j;\
\ \
for(i=0, j=1; j<n_rows; i+=2, j+=2)\ for(i=0, j=1; j<n_rows; i+=2, j+=2)\
{\ {\
skipping to change at line 140 skipping to change at line 163
// NOTE: we're assuming that the matrix has already been set to the corre ct size and there is no aliasing; // NOTE: we're assuming that the matrix has already been set to the corre ct size and there is no aliasing;
// size setting and alias checking is done by either the Mat contructor o r operator=() // size setting and alias checking is done by either the Mat contructor o r operator=()
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem; const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem;
typename Proxy<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename Proxy<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(=, -); } typename Proxy<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename Proxy<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(=, *); } a_applier_1a(=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(=, *); }
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(=, *); }
}
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(=, *); }
}
} }
else else
{ {
const uword n_rows = x.get_n_rows(); const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols(); const uword n_cols = x.get_n_cols();
const Proxy<T1>& P1 = x.P1; const Proxy<T1>& P1 = x.P1;
const Proxy<T2>& P2 = x.P2; const Proxy<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(=, +); }
skipping to change at line 187 skipping to change at line 238
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor); const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem; const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem;
typename Proxy<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename Proxy<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(+=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(+=, -); } typename Proxy<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename Proxy<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(+=, *); } a_applier_1a(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(+=, *); }
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(+=, *); }
}
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(+=, *); }
}
} }
else else
{ {
const Proxy<T1>& P1 = x.P1; const Proxy<T1>& P1 = x.P1;
const Proxy<T2>& P2 = x.P2; const Proxy<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(+=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_2(+=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_2(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_2(+=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_2(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_2(+=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_2(+=, *); }
skipping to change at line 231 skipping to change at line 310
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor); const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem; const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem;
typename Proxy<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename Proxy<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(-=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(-=, -); } typename Proxy<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename Proxy<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(-=, *); } a_applier_1a(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(-=, *); }
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(-=, *); }
}
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(-=, *); }
}
} }
else else
{ {
const Proxy<T1>& P1 = x.P1; const Proxy<T1>& P1 = x.P1;
const Proxy<T2>& P2 = x.P2; const Proxy<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(-=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_2(-=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_2(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_2(-=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_2(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_2(-=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_2(-=, *); }
skipping to change at line 275 skipping to change at line 382
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor); const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem; const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem;
typename Proxy<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename Proxy<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(*=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(*=, -); } typename Proxy<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename Proxy<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(*=, *); } a_applier_1a(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(*=, *); }
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(*=, *); }
}
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(*=, *); }
}
} }
else else
{ {
const Proxy<T1>& P1 = x.P1; const Proxy<T1>& P1 = x.P1;
const Proxy<T2>& P2 = x.P2; const Proxy<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(*=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_2(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_2(*=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_2(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_2(*=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_2(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_2(*=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_2(*=, *); }
skipping to change at line 319 skipping to change at line 454
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor); const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T 2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem; const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.g et_n_elem() : out.n_elem;
typename Proxy<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename Proxy<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(/=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(/=, -); } typename Proxy<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename Proxy<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(/=, *); } a_applier_1a(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(/=, *); }
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(/=, *); }
}
}
else
{
typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(/=, *); }
}
} }
else else
{ {
const Proxy<T1>& P1 = x.P1; const Proxy<T1>& P1 = x.P1;
const Proxy<T2>& P2 = x.P2; const Proxy<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_2(*=, +); } plier_2(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap
plier_2(*=, -); } plier_2(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap
plier_2(*=, /); } plier_2(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap
plier_2(*=, *); } plier_2(/=, *); }
} }
} }
// //
// cubes // cubes
template<typename eglue_type> template<typename eglue_type>
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
skipping to change at line 364 skipping to change at line 527
// NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing; // NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing;
// size setting and alias checking is done by either the Cube contructor or operator=() // size setting and alias checking is done by either the Cube contructor or operator=()
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(=, -); } typename ProxyCube<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename ProxyCube<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(=, *); } a_applier_1a(=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(=, *); }
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(=, *); }
}
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(=, *); }
}
} }
else else
{ {
const uword n_rows = x.get_n_rows(); const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols(); const uword n_cols = x.get_n_cols();
const uword n_slices = x.get_n_slices(); const uword n_slices = x.get_n_slices();
const ProxyCube<T1>& P1 = x.P1; const ProxyCube<T1>& P1 = x.P1;
const ProxyCube<T2>& P2 = x.P2; const ProxyCube<T2>& P2 = x.P2;
skipping to change at line 413 skipping to change at line 604
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor); const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(+=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(+=, -); } typename ProxyCube<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename ProxyCube<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(+=, *); } a_applier_1a(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(+=, *); }
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(+=, *); }
}
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(+=, *); }
}
} }
else else
{ {
const ProxyCube<T1>& P1 = x.P1; const ProxyCube<T1>& P1 = x.P1;
const ProxyCube<T2>& P2 = x.P2; const ProxyCube<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(+=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(+=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(+=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(+=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(+=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(+=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(+=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(+=, *); }
skipping to change at line 458 skipping to change at line 677
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor); const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(-=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(-=, -); } typename ProxyCube<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename ProxyCube<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(-=, *); } a_applier_1a(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(-=, *); }
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(-=, *); }
}
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(-=, *); }
}
} }
else else
{ {
const ProxyCube<T1>& P1 = x.P1; const ProxyCube<T1>& P1 = x.P1;
const ProxyCube<T2>& P2 = x.P2; const ProxyCube<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(-=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(-=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(-=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(-=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(-=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(-=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(-=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(-=, *); }
skipping to change at line 503 skipping to change at line 750
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor); const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(*=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(*=, -); } typename ProxyCube<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename ProxyCube<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(*=, *); } a_applier_1a(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(*=, *); }
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(*=, *); }
}
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(*=, *); }
}
} }
else else
{ {
const ProxyCube<T1>& P1 = x.P1; const ProxyCube<T1>& P1 = x.P1;
const ProxyCube<T2>& P2 = x.P2; const ProxyCube<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(*=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(*=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(*=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(*=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(*=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(*=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(*=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(*=, *); }
skipping to change at line 548 skipping to change at line 823
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor); const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro xyCube<T2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea(); if(memory::is_aligned(out_mem))
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea(); {
memory::mark_as_aligned(out_mem);
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap
plier_1(/=, +); } if(x.P1.is_aligned() && x.P2.is_aligned())
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap {
plier_1(/=, -); } typename ProxyCube<T1>::aligned_ea_type P1 = x.P1.get_aligned_ea();
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap typename ProxyCube<T2>::aligned_ea_type P2 = x.P2.get_aligned_ea();
plier_1(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
plier_1(/=, *); } a_applier_1a(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1a(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1a(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1a(/=, *); }
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arm
a_applier_1u(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arm
a_applier_1u(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arm
a_applier_1u(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arm
a_applier_1u(/=, *); }
}
}
else
{
typename ProxyCube<T1>::ea_type P1 = x.P1.get_ea();
typename ProxyCube<T2>::ea_type P2 = x.P2.get_ea();
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_
applier_1u(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_
applier_1u(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_
applier_1u(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_
applier_1u(/=, *); }
}
} }
else else
{ {
const ProxyCube<T1>& P1 = x.P1; const ProxyCube<T1>& P1 = x.P1;
const ProxyCube<T2>& P2 = x.P2; const ProxyCube<T2>& P2 = x.P2;
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(/=, +); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_ap plier_3(/=, +); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(/=, -); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_ap plier_3(/=, -); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(/=, /); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_ap plier_3(/=, /); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(/=, *); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_ap plier_3(/=, *); }
} }
} }
#undef arma_applier_1 #undef arma_applier_1u
#undef arma_applier_1a
#undef arma_applier_2 #undef arma_applier_2
#undef arma_applier_3 #undef arma_applier_3
//! @} //! @}
 End of changes. 16 change blocks. 
123 lines changed or deleted 507 lines changed or added


 eop_core_meat.hpp   eop_core_meat.hpp 
// Copyright (C) 2010-2013 NICTA (www.nicta.com.au) // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2010-2013 Conrad Sanderson // Copyright (C) 2010-2013 Conrad Sanderson
// //
// 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 eop_core //! \addtogroup eop_core
//! @{ //! @{
#undef arma_applier_1 #undef arma_applier_1u
#undef arma_applier_1a
#undef arma_applier_2 #undef arma_applier_2
#undef arma_applier_3 #undef arma_applier_3
#undef operatorA #undef operatorA
#define arma_applier_1(operatorA) \ #define arma_applier_1u(operatorA) \
{\ {\
uword i,j;\ uword i,j;\
\ \
for(i=0, j=1; j<n_elem; i+=2, j+=2)\ for(i=0, j=1; j<n_elem; i+=2, j+=2)\
{\ {\
eT tmp_i = P[i];\ eT tmp_i = P[i];\
eT tmp_j = P[j];\ eT tmp_j = P[j];\
\ \
tmp_i = eop_core<eop_type>::process(tmp_i, k);\ tmp_i = eop_core<eop_type>::process(tmp_i, k);\
tmp_j = eop_core<eop_type>::process(tmp_j, k);\ tmp_j = eop_core<eop_type>::process(tmp_j, k);\
skipping to change at line 38 skipping to change at line 39
out_mem[i] operatorA tmp_i;\ out_mem[i] operatorA tmp_i;\
out_mem[j] operatorA tmp_j;\ out_mem[j] operatorA tmp_j;\
}\ }\
\ \
if(i < n_elem)\ if(i < n_elem)\
{\ {\
out_mem[i] operatorA eop_core<eop_type>::process(P[i], k);\ out_mem[i] operatorA eop_core<eop_type>::process(P[i], k);\
}\ }\
} }
#define arma_applier_1a(operatorA) \
{\
uword i,j;\
\
for(i=0, j=1; j<n_elem; i+=2, j+=2)\
{\
eT tmp_i = P.at_alt(i);\
eT tmp_j = P.at_alt(j);\
\
tmp_i = eop_core<eop_type>::process(tmp_i, k);\
tmp_j = eop_core<eop_type>::process(tmp_j, k);\
\
out_mem[i] operatorA tmp_i;\
out_mem[j] operatorA tmp_j;\
}\
\
if(i < n_elem)\
{\
out_mem[i] operatorA eop_core<eop_type>::process(P.at_alt(i), k);\
}\
}
#define arma_applier_2(operatorA) \ #define arma_applier_2(operatorA) \
{\ {\
if(n_rows != 1)\ if(n_rows != 1)\
{\ {\
for(uword col=0; col<n_cols; ++col)\ for(uword col=0; col<n_cols; ++col)\
{\ {\
uword i,j;\ uword i,j;\
\ \
for(i=0, j=1; j<n_rows; i+=2, j+=2)\ for(i=0, j=1; j<n_rows; i+=2, j+=2)\
{\ {\
skipping to change at line 125 skipping to change at line 148
// NOTE: we're assuming that the matrix has already been set to the corre ct size and there is no aliasing; // NOTE: we're assuming that the matrix has already been set to the corre ct size and there is no aliasing;
// size setting and alias checking is done by either the Mat contructor o r operator=() // size setting and alias checking is done by either the Mat contructor o r operator=()
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m; const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m;
typename Proxy<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename Proxy<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(=);
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(=);
}
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1(=); arma_applier_1u(=);
}
} }
else else
{ {
const uword n_rows = x.get_n_rows(); const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols(); const uword n_cols = x.get_n_cols();
const Proxy<T1>& P = x.P; const Proxy<T1>& P = x.P;
arma_applier_2(=); arma_applier_2(=);
} }
skipping to change at line 163 skipping to change at line 206
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addi tion"); arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addi tion");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m; const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m;
typename Proxy<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename Proxy<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(+=);
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(+=);
}
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1(+=); arma_applier_1u(+=);
}
} }
else else
{ {
const Proxy<T1>& P = x.P; const Proxy<T1>& P = x.P;
arma_applier_2(+=); arma_applier_2(+=);
} }
} }
template<typename eop_type> template<typename eop_type>
skipping to change at line 198 skipping to change at line 261
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subt raction"); arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subt raction");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m; const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m;
typename Proxy<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename Proxy<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(-=);
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(-=);
}
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1(-=); arma_applier_1u(-=);
}
} }
else else
{ {
const Proxy<T1>& P = x.P; const Proxy<T1>& P = x.P;
arma_applier_2(-=); arma_applier_2(-=);
} }
} }
template<typename eop_type> template<typename eop_type>
skipping to change at line 233 skipping to change at line 316
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "elem ent-wise multiplication"); arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "elem ent-wise multiplication");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m; const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m;
typename Proxy<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename Proxy<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(*=);
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(*=);
}
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1(*=); arma_applier_1u(*=);
}
} }
else else
{ {
const Proxy<T1>& P = x.P; const Proxy<T1>& P = x.P;
arma_applier_2(*=); arma_applier_2(*=);
} }
} }
template<typename eop_type> template<typename eop_type>
skipping to change at line 268 skipping to change at line 371
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "elem ent-wise division"); arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "elem ent-wise division");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m; const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_ele m;
typename Proxy<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename Proxy<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(/=);
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(/=);
}
}
else
{
typename Proxy<T1>::ea_type P = x.P.get_ea();
arma_applier_1(/=); arma_applier_1u(/=);
}
} }
else else
{ {
const Proxy<T1>& P = x.P; const Proxy<T1>& P = x.P;
arma_applier_2(/=); arma_applier_2(/=);
} }
} }
// //
skipping to change at line 304 skipping to change at line 427
// NOTE: we're assuming that the matrix has already been set to the corre ct size and there is no aliasing; // NOTE: we're assuming that the matrix has already been set to the corre ct size and there is no aliasing;
// size setting and alias checking is done by either the Mat contructor o r operator=() // size setting and alias checking is done by either the Mat contructor o r operator=()
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(ProxyCube<T1>::prefer_at_accessor == false) if(ProxyCube<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename ProxyCube<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(=);
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(=);
}
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1(=); arma_applier_1u(=);
}
} }
else else
{ {
const uword n_rows = x.get_n_rows(); const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols(); const uword n_cols = x.get_n_cols();
const uword n_slices = x.get_n_slices(); const uword n_slices = x.get_n_slices();
const ProxyCube<T1>& P = x.P; const ProxyCube<T1>& P = x.P;
arma_applier_3(=); arma_applier_3(=);
skipping to change at line 344 skipping to change at line 487
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition"); arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(ProxyCube<T1>::prefer_at_accessor == false) if(ProxyCube<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename ProxyCube<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(+=);
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(+=);
}
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1(+=); arma_applier_1u(+=);
}
} }
else else
{ {
const ProxyCube<T1>& P = x.P; const ProxyCube<T1>& P = x.P;
arma_applier_3(+=); arma_applier_3(+=);
} }
} }
template<typename eop_type> template<typename eop_type>
skipping to change at line 380 skipping to change at line 543
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction"); arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(ProxyCube<T1>::prefer_at_accessor == false) if(ProxyCube<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename ProxyCube<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(-=);
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(-=);
}
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1(-=); arma_applier_1u(-=);
}
} }
else else
{ {
const ProxyCube<T1>& P = x.P; const ProxyCube<T1>& P = x.P;
arma_applier_3(-=); arma_applier_3(-=);
} }
} }
template<typename eop_type> template<typename eop_type>
skipping to change at line 416 skipping to change at line 599
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication"); arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(ProxyCube<T1>::prefer_at_accessor == false) if(ProxyCube<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename ProxyCube<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(*=);
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(*=);
}
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1(*=); arma_applier_1u(*=);
}
} }
else else
{ {
const ProxyCube<T1>& P = x.P; const ProxyCube<T1>& P = x.P;
arma_applier_3(*=); arma_applier_3(*=);
} }
} }
template<typename eop_type> template<typename eop_type>
skipping to change at line 452 skipping to change at line 655
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division"); arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division");
const eT k = x.aux; const eT k = x.aux;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
if(ProxyCube<T1>::prefer_at_accessor == false) if(ProxyCube<T1>::prefer_at_accessor == false)
{ {
const uword n_elem = out.n_elem; const uword n_elem = out.n_elem;
typename ProxyCube<T1>::ea_type P = x.P.get_ea(); if(memory::is_aligned(out_mem))
{
memory::mark_as_aligned(out_mem);
if(x.P.is_aligned())
{
typename ProxyCube<T1>::aligned_ea_type P = x.P.get_aligned_ea();
arma_applier_1a(/=);
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1u(/=);
}
}
else
{
typename ProxyCube<T1>::ea_type P = x.P.get_ea();
arma_applier_1(/=); arma_applier_1u(/=);
}
} }
else else
{ {
const ProxyCube<T1>& P = x.P; const ProxyCube<T1>& P = x.P;
arma_applier_3(/=); arma_applier_3(/=);
} }
} }
// //
skipping to change at line 587 skipping to change at line 810
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_floor >::process(const eT val, const eT ) { return eop_aux::floor(val); } eop_core<eop_floor >::process(const eT val, const eT ) { return eop_aux::floor(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_ceil >::process(const eT val, const eT ) { return eop_aux::ceil(val); } eop_core<eop_ceil >::process(const eT val, const eT ) { return eop_aux::ceil(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_round >::process(const eT val, const eT ) { return eop_aux::round(val); } eop_core<eop_round >::process(const eT val, const eT ) { return eop_aux::round(val); }
#undef arma_applier_1 #undef arma_applier_1u
#undef arma_applier_1a
#undef arma_applier_2 #undef arma_applier_2
#undef arma_applier_3 #undef arma_applier_3
//! @} //! @}
 End of changes. 24 change blocks. 
23 lines changed or deleted 247 lines changed or added


 hdf5_misc.hpp   hdf5_misc.hpp 
skipping to change at line 459 skipping to change at line 459
// u8 // u8
search_type = get_hdf5_type<u8>(); search_type = get_hdf5_type<u8>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<u8> v(n_elem); Col<u8> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// s8 // s8
search_type = get_hdf5_type<s8>(); search_type = get_hdf5_type<s8>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<s8> v(n_elem); Col<s8> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// u16 // u16
search_type = get_hdf5_type<u16>(); search_type = get_hdf5_type<u16>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<u16> v(n_elem); Col<u16> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// s16 // s16
search_type = get_hdf5_type<s16>(); search_type = get_hdf5_type<s16>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<s16> v(n_elem); Col<s16> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// u32 // u32
search_type = get_hdf5_type<u32>(); search_type = get_hdf5_type<u32>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<u32> v(n_elem); Col<u32> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// s32 // s32
search_type = get_hdf5_type<s32>(); search_type = get_hdf5_type<s32>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<s32> v(n_elem); Col<s32> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
#if defined(ARMA_USE_U64S64) #if defined(ARMA_USE_U64S64)
{ {
// u64 // u64
search_type = get_hdf5_type<u64>(); search_type = get_hdf5_type<u64>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<u64> v(n_elem); Col<u64> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// s64 // s64
search_type = get_hdf5_type<s64>(); search_type = get_hdf5_type<s64>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<s64> v(n_elem); Col<s64> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
} }
#endif #endif
#if defined(ARMA_ALLOW_LONG) #if defined(ARMA_ALLOW_LONG)
{ {
// ulng_t // ulng_t
search_type = get_hdf5_type<ulng_t>(); search_type = get_hdf5_type<ulng_t>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<ulng_t> v(n_elem); Col<ulng_t> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// slng_t // slng_t
search_type = get_hdf5_type<slng_t>(); search_type = get_hdf5_type<slng_t>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<slng_t> v(n_elem); Col<slng_t> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAU LT, void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
} }
#endif #endif
// float // float
search_type = get_hdf5_type<float>(); search_type = get_hdf5_type<float>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<float> v(n_elem); Col<float> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// double // double
search_type = get_hdf5_type<double>(); search_type = get_hdf5_type<double>();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
Col<double> v(n_elem); Col<double> v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert(dest, v.memptr(), n_elem); // convert arrayops::convert(dest, v.memptr(), n_elem);
return status; return status;
} }
// complex float // complex float
search_type = get_hdf5_type< std::complex<float> >(); search_type = get_hdf5_type< std::complex<float> >();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
if(is_complex<eT>::value == false)
{
return -1; // can't read complex data into non-complex matrix/cube
}
Col< std::complex<float> > v(n_elem); Col< std::complex<float> > v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert_cx(dest, v.memptr(), n_elem); // convert arrayops::convert_cx(dest, v.memptr(), n_elem);
return status; return status;
} }
// complex double // complex double
search_type = get_hdf5_type< std::complex<double> >(); search_type = get_hdf5_type< std::complex<double> >();
is_equal = (H5Tequal(datatype, search_type) > 0); is_equal = (H5Tequal(datatype, search_type) > 0);
H5Tclose(search_type); H5Tclose(search_type);
if(is_equal) if(is_equal)
{ {
if(is_complex<eT>::value == false)
{
return -1; // can't read complex data into non-complex matrix/cube
}
Col< std::complex<double> > v(n_elem); Col< std::complex<double> > v(n_elem);
hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr())); hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT , void_ptr(v.memptr()));
arrayops::convert_cx(dest, v.memptr(), n_elem); // convert arrayops::convert_cx(dest, v.memptr(), n_elem);
return status; return status;
} }
return -1; // Failure. return -1; // Failure.
} }
} // namespace hdf5_misc } // namespace hdf5_misc
#endif // #if defined(ARMA_USE_HDF5) #endif // #if defined(ARMA_USE_HDF5)
 End of changes. 16 change blocks. 
14 lines changed or deleted 24 lines changed or added


 memory.hpp   memory.hpp 
// Copyright (C) 2012 NICTA (www.nicta.com.au) // Copyright (C) 2012-2013 NICTA (www.nicta.com.au)
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012-2013 Conrad Sanderson
// //
// 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 memory //! \addtogroup memory
//! @{ //! @{
class memory class memory
{ {
public: public:
arma_inline static uword enlarge_to_mul t_of_chunksize(const uword n_elem); arma_inline static uword enlarge_to_mul t_of_chunksize(const uword n_elem);
template<typename eT> arma_inline arma_malloc static eT* acquire(const uword n_elem); template<typename eT> arma_inline arma_malloc static eT* acquire(const uword n_elem);
template<typename eT> arma_inline arma_malloc static eT* acquire_chunke d(const uword n_elem); template<typename eT> arma_inline arma_malloc static eT* acquire_chunke d(const uword n_elem);
template<typename eT> arma_inline static void release(eT* me m); template<typename eT> arma_inline static void release(eT* me m);
template<typename eT> arma_inline static bool is_aligned(const eT*
mem);
template<typename eT> arma_inline static void mark_as_aligned( eT*&
mem);
template<typename eT> arma_inline static void mark_as_aligned(const eT*&
mem);
}; };
arma_inline arma_inline
uword uword
memory::enlarge_to_mult_of_chunksize(const uword n_elem) memory::enlarge_to_mult_of_chunksize(const uword n_elem)
{ {
const uword chunksize = arma_config::spmat_chunksize; const uword chunksize = arma_config::spmat_chunksize;
// this relies on integer division // this relies on integer division
const uword n_elem_mod = ((n_elem % chunksize) != 0) ? ((n_elem / chunksi ze) + 1) * chunksize : n_elem; const uword n_elem_mod = ((n_elem % chunksize) != 0) ? ((n_elem / chunksi ze) + 1) * chunksize : n_elem;
skipping to change at line 44 skipping to change at line 48
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_malloc arma_malloc
eT* eT*
memory::acquire(const uword n_elem) memory::acquire(const uword n_elem)
{ {
#if defined(ARMA_USE_TBB_ALLOC) #if defined(ARMA_USE_TBB_ALLOC)
{ {
return ( (eT *) scalable_malloc( sizeof(eT)*n_elem) ); return ( (eT *) scalable_malloc(sizeof(eT)*n_elem) );
} }
#elif defined(ARMA_USE_MKL_ALLOC) #elif defined(ARMA_USE_MKL_ALLOC)
{ {
return ( (eT *) mkl_malloc( sizeof(eT)*n_elem, 128 ) ); return ( (eT *) mkl_malloc( sizeof(eT)*n_elem, 128 ) );
} }
#elif defined(ARMA_HAVE_POSIX_MEMALIGN)
{
eT* memptr;
const size_t alignment = 16; // change the 16 to 64 if you wish to ali
gn to the cache line
int status = posix_memalign((void **)&memptr, ( (alignment >= sizeof(vo
id*)) ? alignment : sizeof(void*) ), sizeof(eT)*n_elem);
return (status == 0) ? memptr : NULL;
}
#elif defined(_MSC_VER)
{
return ( (eT *) _aligned_malloc( sizeof(eT)*n_elem, 16 ) ); // lives i
n malloc.h
}
#else #else
{ {
return ( new(std::nothrow) eT[n_elem] ); //return ( new(std::nothrow) eT[n_elem] );
return ( (eT *) malloc(sizeof(eT)*n_elem) );
} }
#endif #endif
// TODO: for mingw, use __mingw_aligned_malloc
} }
//! get memory in multiples of chunks, holding at least n_elem //! get memory in multiples of chunks, holding at least n_elem
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_malloc arma_malloc
eT* eT*
memory::acquire_chunked(const uword n_elem) memory::acquire_chunked(const uword n_elem)
{ {
const uword n_elem_mod = memory::enlarge_to_mult_of_chunksize(n_elem); const uword n_elem_mod = memory::enlarge_to_mult_of_chunksize(n_elem);
skipping to change at line 82 skipping to change at line 103
memory::release(eT* mem) memory::release(eT* mem)
{ {
#if defined(ARMA_USE_TBB_ALLOC) #if defined(ARMA_USE_TBB_ALLOC)
{ {
scalable_free( (void *)(mem) ); scalable_free( (void *)(mem) );
} }
#elif defined(ARMA_USE_MKL_ALLOC) #elif defined(ARMA_USE_MKL_ALLOC)
{ {
mkl_free( (void *)(mem) ); mkl_free( (void *)(mem) );
} }
#elif defined(ARMA_HAVE_POSIX_MEMALIGN)
{
free( (void *)(mem) );
}
#elif defined(_MSC_VER)
{
_aligned_free( (void *)(mem) );
}
#else
{
//delete [] mem;
free( (void *)(mem) );
}
#endif
// TODO: for mingw, use __mingw_aligned_free
}
template<typename eT>
arma_inline
bool
memory::is_aligned(const eT* mem)
{
#if (defined(ARMA_HAVE_ICC_ASSUME_ALIGNED) || defined(ARMA_HAVE_GCC_ASSUM
E_ALIGNED)) && !defined(ARMA_DONT_CHECK_ALIGNMENT)
{
return ((std::ptrdiff_t(mem) & 0x0F) == 0);
}
#else
{
return false;
}
#endif
}
template<typename eT>
arma_inline
void
memory::mark_as_aligned(eT*& mem)
{
#if defined(ARMA_HAVE_ICC_ASSUME_ALIGNED)
{
__assume_aligned(mem, 16);
}
#elif defined(ARMA_HAVE_GCC_ASSUME_ALIGNED)
{
mem = (eT*)__builtin_assume_aligned(mem, 16);
}
#else
{
arma_ignore(mem);
}
#endif
// TODO: MSVC? __assume( (mem & 0x0F) == 0 );
//
// http://comments.gmane.org/gmane.comp.gcc.patches/239430
// GCC __builtin_assume_aligned is similar to ICC's __assume_aligned,
// so for lvalue first argument ICC's __assume_aligned can be emulated us
ing
// #define __assume_aligned(lvalueptr, align) lvalueptr = __builtin_assum
e_aligned (lvalueptr, align)
//
// http://www.inf.ethz.ch/personal/markusp/teaching/263-2300-ETH-spring11
/slides/class19.pdf
// http://software.intel.com/sites/products/documentation/hpc/composerxe/
en-us/cpp/lin/index.htm
// http://d3f8ykwhia686p.cloudfront.net/1live/intel/CompilerAutovectoriza
tionGuide.pdf
}
template<typename eT>
arma_inline
void
memory::mark_as_aligned(const eT*& mem)
{
#if defined(ARMA_HAVE_ICC_ASSUME_ALIGNED)
{
__assume_aligned(mem, 16);
}
#elif defined(ARMA_HAVE_GCC_ASSUME_ALIGNED)
{
mem = (const eT*)__builtin_assume_aligned(mem, 16);
}
#else #else
{ {
delete [] mem; arma_ignore(mem);
} }
#endif #endif
} }
//! @} //! @}
 End of changes. 8 change blocks. 
5 lines changed or deleted 116 lines changed or added


 podarray_bones.hpp   podarray_bones.hpp 
skipping to change at line 26 skipping to change at line 26
//! A lightweight array for POD types. For internal use only! //! A lightweight array for POD types. For internal use only!
template<typename eT> template<typename eT>
class podarray class podarray
{ {
public: public:
arma_aligned const uword n_elem; //!< number of elements held arma_aligned const uword n_elem; //!< number of elements held
arma_aligned eT* mem; //!< pointer to memory used by the objec t arma_aligned eT* mem; //!< pointer to memory used by the objec t
protected: protected:
//! Internal memory, to avoid calling the 'new' operator for small amount //! internal memory, to avoid calling the 'new' operator for small amount
s of memory. s of memory.
arma_aligned eT mem_local[ podarray_prealloc_n_elem::val ]; arma_align_mem eT mem_local[ podarray_prealloc_n_elem::val ];
public: public:
inline ~podarray(); inline ~podarray();
inline podarray(); inline podarray();
inline podarray (const podarray& x); inline podarray (const podarray& x);
inline const podarray& operator=(const podarray& x); inline const podarray& operator=(const podarray& x);
arma_inline explicit podarray(const uword new_N); arma_inline explicit podarray(const uword new_N);
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added


 subview_bones.hpp   subview_bones.hpp 
skipping to change at line 75 skipping to change at line 75
inline static void div_inplace(Mat<eT>& out, const subview& in); inline static void div_inplace(Mat<eT>& out, const subview& in);
template<typename functor> inline void transform(functor F); template<typename functor> inline void transform(functor F);
template<typename functor> inline void imbue(functor F); template<typename functor> inline void imbue(functor F);
inline void fill(const eT val); inline void fill(const eT val);
inline void zeros(); inline void zeros();
inline void ones(); inline void ones();
inline void eye(); inline void eye();
inline eT at_alt (const uword ii) const;
inline eT& operator[](const uword ii); inline eT& operator[](const uword ii);
inline eT operator[](const uword ii) const; inline eT operator[](const uword ii) const;
inline eT& operator()(const uword ii); inline eT& operator()(const uword ii);
inline eT operator()(const uword ii) const; inline eT operator()(const uword ii) const;
inline eT& operator()(const uword in_row, const uword in_col); inline eT& operator()(const uword in_row, const uword in_col);
inline eT operator()(const uword in_row, const uword in_col) const; inline eT operator()(const uword in_row, const uword in_col) const;
inline eT& at(const uword in_row, const uword in_col); inline eT& at(const uword in_row, const uword in_col);
skipping to change at line 192 skipping to change at line 194
inline void operator= (const subview<eT>& x); inline void operator= (const subview<eT>& x);
inline void operator= (const subview_col& x); inline void operator= (const subview_col& x);
template<typename T1> template<typename T1>
inline void operator= (const Base<eT,T1>& x); inline void operator= (const Base<eT,T1>& x);
arma_inline const Op<subview_col<eT>,op_htrans> t() const; arma_inline const Op<subview_col<eT>,op_htrans> t() const;
arma_inline const Op<subview_col<eT>,op_htrans> ht() const; arma_inline const Op<subview_col<eT>,op_htrans> ht() const;
arma_inline const Op<subview_col<eT>,op_strans> st() const; arma_inline const Op<subview_col<eT>,op_strans> st() const;
inline eT& operator[](const uword i); arma_inline eT at_alt (const uword i) const;
inline eT operator[](const uword i) const;
arma_inline eT& operator[](const uword i);
arma_inline eT operator[](const uword i) const;
inline eT& operator()(const uword i); inline eT& operator()(const uword i);
inline eT operator()(const uword i) const; inline eT operator()(const uword i) const;
inline eT& operator()(const uword in_row, const uword in_col); inline eT& operator()(const uword in_row, const uword in_col);
inline eT operator()(const uword in_row, const uword in_col) const; inline eT operator()(const uword in_row, const uword in_col) const;
inline eT& at(const uword in_row, const uword in_col); inline eT& at(const uword in_row, const uword in_col);
inline eT at(const uword in_row, const uword in_col) const; inline eT at(const uword in_row, const uword in_col) const;
skipping to change at line 250 skipping to change at line 254
inline void operator= (const subview<eT>& x); inline void operator= (const subview<eT>& x);
inline void operator= (const subview_row& x); inline void operator= (const subview_row& x);
template<typename T1> template<typename T1>
inline void operator= (const Base<eT,T1>& x); inline void operator= (const Base<eT,T1>& x);
arma_inline const Op<subview_row<eT>,op_htrans> t() const; arma_inline const Op<subview_row<eT>,op_htrans> t() const;
arma_inline const Op<subview_row<eT>,op_htrans> ht() const; arma_inline const Op<subview_row<eT>,op_htrans> ht() const;
arma_inline const Op<subview_row<eT>,op_strans> st() const; arma_inline const Op<subview_row<eT>,op_strans> st() const;
inline eT at_alt (const uword i) const;
inline eT& operator[](const uword i); inline eT& operator[](const uword i);
inline eT operator[](const uword i) const; inline eT operator[](const uword i) const;
inline eT& operator()(const uword i); inline eT& operator()(const uword i);
inline eT operator()(const uword i) const; inline eT operator()(const uword i) const;
inline eT& operator()(const uword in_row, const uword in_col); inline eT& operator()(const uword in_row, const uword in_col);
inline eT operator()(const uword in_row, const uword in_col) const; inline eT operator()(const uword in_row, const uword in_col) const;
inline eT& at(const uword in_row, const uword in_col); inline eT& at(const uword in_row, const uword in_col);
skipping to change at line 305 skipping to change at line 311
arma_aligned const subview_row<eT>& sv_row; arma_aligned const subview_row<eT>& sv_row;
const uword n_rows; // equal to n_elem const uword n_rows; // equal to n_elem
const uword n_elem; const uword n_elem;
static const uword n_cols = 1; static const uword n_cols = 1;
inline explicit subview_row_strans(const subview_row<eT>& in_sv_row); inline explicit subview_row_strans(const subview_row<eT>& in_sv_row);
inline void extract(Mat<eT>& out) const; inline void extract(Mat<eT>& out) const;
inline eT at_alt (const uword i) const;
inline eT operator[](const uword i) const; inline eT operator[](const uword i) const;
inline eT operator()(const uword i) const; inline eT operator()(const uword i) const;
inline eT operator()(const uword in_row, const uword in_col) const; inline eT operator()(const uword in_row, const uword in_col) const;
inline eT at(const uword in_row, const uword in_col) const; inline eT at(const uword in_row, const uword in_col) const;
}; };
template<typename eT> template<typename eT>
class subview_row_htrans : public Base<eT, subview_row_htrans<eT> > class subview_row_htrans : public Base<eT, subview_row_htrans<eT> >
{ {
skipping to change at line 333 skipping to change at line 341
arma_aligned const subview_row<eT>& sv_row; arma_aligned const subview_row<eT>& sv_row;
const uword n_rows; // equal to n_elem const uword n_rows; // equal to n_elem
const uword n_elem; const uword n_elem;
static const uword n_cols = 1; static const uword n_cols = 1;
inline explicit subview_row_htrans(const subview_row<eT>& in_sv_row); inline explicit subview_row_htrans(const subview_row<eT>& in_sv_row);
inline void extract(Mat<eT>& out) const; inline void extract(Mat<eT>& out) const;
inline eT at_alt (const uword i) const;
inline eT operator[](const uword i) const; inline eT operator[](const uword i) const;
inline eT operator()(const uword i) const; inline eT operator()(const uword i) const;
inline eT operator()(const uword in_row, const uword in_col) const; inline eT operator()(const uword in_row, const uword in_col) const;
inline eT at(const uword in_row, const uword in_col) const; inline eT at(const uword in_row, const uword in_col) const;
}; };
//! @} //! @}
 End of changes. 5 change blocks. 
2 lines changed or deleted 12 lines changed or added


 subview_cube_bones.hpp   subview_cube_bones.hpp 
skipping to change at line 84 skipping to change at line 84
inline static void schur_inplace(Mat<eT>& out, const subview_cube& in); inline static void schur_inplace(Mat<eT>& out, const subview_cube& in);
inline static void div_inplace(Mat<eT>& out, const subview_cube& in); inline static void div_inplace(Mat<eT>& out, const subview_cube& in);
template<typename functor> inline void transform(functor F); template<typename functor> inline void transform(functor F);
template<typename functor> inline void imbue(functor F); template<typename functor> inline void imbue(functor F);
inline void fill(const eT val); inline void fill(const eT val);
inline void zeros(); inline void zeros();
inline void ones(); inline void ones();
inline eT at_alt (const uword i) const;
inline eT& operator[](const uword i); inline eT& operator[](const uword i);
inline eT operator[](const uword i) const; inline eT operator[](const uword i) const;
inline eT& operator()(const uword i); inline eT& operator()(const uword i);
inline eT operator()(const uword i) const; inline eT operator()(const uword i) const;
arma_inline eT& operator()(const uword in_row, const uword in_col, const uword in_slice); arma_inline eT& operator()(const uword in_row, const uword in_col, const uword in_slice);
arma_inline eT operator()(const uword in_row, const uword in_col, const uword in_slice) const; arma_inline eT operator()(const uword in_row, const uword in_col, const uword in_slice) const;
arma_inline eT& at(const uword in_row, const uword in_col, const uword in_slice); arma_inline eT& at(const uword in_row, const uword in_col, const uword in_slice);
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 subview_cube_meat.hpp   subview_cube_meat.hpp 
skipping to change at line 923 skipping to change at line 923
void void
subview_cube<eT>::ones() subview_cube<eT>::ones()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
fill(eT(1)); fill(eT(1));
} }
template<typename eT> template<typename eT>
inline inline
eT
subview_cube<eT>::at_alt(const uword i) const
{
return operator[](i);
}
template<typename eT>
inline
eT& eT&
subview_cube<eT>::operator[](const uword i) subview_cube<eT>::operator[](const uword i)
{ {
const uword in_slice = i / n_elem_slice; const uword in_slice = i / n_elem_slice;
const uword offset = in_slice * n_elem_slice; const uword offset = in_slice * n_elem_slice;
const uword j = i - offset; const uword j = i - offset;
const uword in_col = j / n_rows; const uword in_col = j / n_rows;
const uword in_row = j % n_rows; const uword in_row = j % n_rows;
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added


 subview_meat.hpp   subview_meat.hpp 
skipping to change at line 1178 skipping to change at line 1178
const uword N = (std::min)(n_rows, n_cols); const uword N = (std::min)(n_rows, n_cols);
for(uword ii=0; ii < N; ++ii) for(uword ii=0; ii < N; ++ii)
{ {
at(ii,ii) = eT(1); at(ii,ii) = eT(1);
} }
} }
template<typename eT> template<typename eT>
inline inline
eT
subview<eT>::at_alt(const uword ii) const
{
return operator[](ii);
}
template<typename eT>
inline
eT& eT&
subview<eT>::operator[](const uword ii) subview<eT>::operator[](const uword ii)
{ {
const uword in_col = ii / n_rows; const uword in_col = ii / n_rows;
const uword in_row = ii % n_rows; const uword in_row = ii % n_rows;
const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row;
return access::rw( (const_cast< Mat<eT>& >(m)).mem[index] ); return access::rw( (const_cast< Mat<eT>& >(m)).mem[index] );
} }
skipping to change at line 2314 skipping to change at line 2322
template<typename eT> template<typename eT>
arma_inline arma_inline
const Op<subview_col<eT>,op_strans> const Op<subview_col<eT>,op_strans>
subview_col<eT>::st() const subview_col<eT>::st() const
{ {
return Op<subview_col<eT>,op_strans>(*this); return Op<subview_col<eT>,op_strans>(*this);
} }
template<typename eT> template<typename eT>
inline arma_inline
eT
subview_col<eT>::at_alt(const uword ii) const
{
const eT* colmem_aligned = colmem;
memory::mark_as_aligned(colmem_aligned);
return colmem_aligned[ii];
}
template<typename eT>
arma_inline
eT& eT&
subview_col<eT>::operator[](const uword ii) subview_col<eT>::operator[](const uword ii)
{ {
return access::rw( colmem[ii] ); return access::rw( colmem[ii] );
} }
template<typename eT> template<typename eT>
inline arma_inline
eT eT
subview_col<eT>::operator[](const uword ii) const subview_col<eT>::operator[](const uword ii) const
{ {
return colmem[ii]; return colmem[ii];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_col<eT>::operator()(const uword ii) subview_col<eT>::operator()(const uword ii)
skipping to change at line 2545 skipping to change at line 2564
template<typename eT> template<typename eT>
arma_inline arma_inline
const Op<subview_row<eT>,op_strans> const Op<subview_row<eT>,op_strans>
subview_row<eT>::st() const subview_row<eT>::st() const
{ {
return Op<subview_row<eT>,op_strans>(*this); return Op<subview_row<eT>,op_strans>(*this);
} }
template<typename eT> template<typename eT>
inline inline
eT
subview_row<eT>::at_alt(const uword ii) const
{
const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_row
s + (subview<eT>::aux_row1);
return subview<eT>::m.mem[index];
}
template<typename eT>
inline
eT& eT&
subview_row<eT>::operator[](const uword ii) subview_row<eT>::operator[](const uword ii)
{ {
const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_row s + (subview<eT>::aux_row1); const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_row s + (subview<eT>::aux_row1);
return access::rw( (const_cast< Mat<eT>& >(subview<eT>::m)).mem[index] ); return access::rw( (const_cast< Mat<eT>& >(subview<eT>::m)).mem[index] );
} }
template<typename eT> template<typename eT>
inline inline
skipping to change at line 2746 skipping to change at line 2775
if(ii < sv_row_n_cols) if(ii < sv_row_n_cols)
{ {
out_mem[ii] = X.at(row, start_col+ii); out_mem[ii] = X.at(row, start_col+ii);
} }
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_row_strans<eT>::at_alt(const uword ii) const
{
return sv_row[ii];
}
template<typename eT>
inline
eT
subview_row_strans<eT>::operator[](const uword ii) const subview_row_strans<eT>::operator[](const uword ii) const
{ {
return sv_row[ii]; return sv_row[ii];
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_row_strans<eT>::operator()(const uword ii) const subview_row_strans<eT>::operator()(const uword ii) const
{ {
skipping to change at line 2815 skipping to change at line 2852
for(uword ii=0; ii < sv_row_n_cols; ++ii) for(uword ii=0; ii < sv_row_n_cols; ++ii)
{ {
out_mem[ii] = access::alt_conj( X.at(row, start_col+ii) ); out_mem[ii] = access::alt_conj( X.at(row, start_col+ii) );
} }
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_row_htrans<eT>::at_alt(const uword ii) const
{
return access::alt_conj( sv_row[ii] );
}
template<typename eT>
inline
eT
subview_row_htrans<eT>::operator[](const uword ii) const subview_row_htrans<eT>::operator[](const uword ii) const
{ {
return access::alt_conj( sv_row[ii] ); return access::alt_conj( sv_row[ii] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_row_htrans<eT>::operator()(const uword ii) const subview_row_htrans<eT>::operator()(const uword ii) const
{ {
 End of changes. 6 change blocks. 
2 lines changed or deleted 48 lines changed or added


 xvec_htrans_bones.hpp   xvec_htrans_bones.hpp 
skipping to change at line 32 skipping to change at line 32
const uword n_rows; const uword n_rows;
const uword n_cols; const uword n_cols;
const uword n_elem; const uword n_elem;
inline explicit xvec_htrans(const eT* const in_mem, const uword in_n_rows , const uword in_n_cols); inline explicit xvec_htrans(const eT* const in_mem, const uword in_n_rows , const uword in_n_cols);
inline void extract(Mat<eT>& out) const; inline void extract(Mat<eT>& out) const;
inline eT operator[](const uword ii) const; inline eT operator[](const uword ii) const;
inline eT at_alt (const uword ii) const;
}; };
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 xvec_htrans_meat.hpp   xvec_htrans_meat.hpp 
skipping to change at line 49 skipping to change at line 49
} }
template<typename eT> template<typename eT>
inline inline
eT eT
xvec_htrans<eT>::operator[](const uword ii) const xvec_htrans<eT>::operator[](const uword ii) const
{ {
return access::alt_conj( mem[ii] ); return access::alt_conj( mem[ii] );
} }
template<typename eT>
inline
eT
xvec_htrans<eT>::at_alt(const uword ii) const
{
return access::alt_conj( mem[ii] );
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 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/