Base_bones.hpp | Base_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
template<typename derived, bool condition> | template<typename derived, bool condition> | |||
struct Base_extra {}; | struct Base_extra {}; | |||
template<typename derived> | template<typename derived> | |||
struct Base_extra<derived, true> { typedef Base_blas_elem_type<derived> r esult; }; | struct Base_extra<derived, true> { typedef Base_blas_elem_type<derived> r esult; }; | |||
template<typename derived> | template<typename derived> | |||
struct Base_extra<derived, false> { typedef Base_other_elem_type<derived> r esult; }; | struct Base_extra<derived, false> { typedef Base_other_elem_type<derived> r esult; }; | |||
template<typename elem_type, typename derived> | ||||
struct Base_eval_Mat | ||||
{ | ||||
const derived& eval() const; | ||||
}; | ||||
template<typename elem_type, typename derived> | ||||
struct Base_eval_expr | ||||
{ | ||||
Mat<elem_type> eval() const; | ||||
}; | ||||
template<typename elem_type, typename derived, bool condition> | ||||
struct Base_eval {}; | ||||
template<typename elem_type, typename derived> | ||||
struct Base_eval<elem_type, derived, true> { typedef Base_eval_Mat<elem_ty | ||||
pe, derived> result; }; | ||||
template<typename elem_type, typename derived> | ||||
struct Base_eval<elem_type, derived, false> { typedef Base_eval_expr<elem_t | ||||
ype, derived> result; }; | ||||
//! Class for static polymorphism, modelled after the "Curiously Recurring Template Pattern" (CRTP). | //! Class for static polymorphism, modelled after the "Curiously Recurring Template Pattern" (CRTP). | |||
//! Used for type-safe downcasting in functions that restrict their input(s ) to be classes that are | //! Used for type-safe downcasting in functions that restrict their input(s ) to be classes that are | |||
//! derived from Base (e.g. Mat, Op, Glue, diagview, subview). | //! derived from Base (e.g. Mat, Op, Glue, diagview, subview). | |||
//! A Base object can be converted to a Mat object by the unwrap class. | //! A Base object can be converted to a Mat object by the unwrap class. | |||
template<typename elem_type, typename derived> | template<typename elem_type, typename derived> | |||
struct Base : public Base_extra<derived, is_supported_blas_type<elem_type>: | struct Base | |||
:value>::result | : public Base_extra<derived, is_supported_blas_type<elem_type>::value>::r | |||
esult | ||||
, public Base_eval<elem_type, derived, is_Mat<derived>::value>::result | ||||
{ | { | |||
arma_inline const derived& get_ref() const; | arma_inline const derived& get_ref() const; | |||
arma_inline const Op<derived,op_htrans> t() const; //!< Hermitian trans pose | arma_inline const Op<derived,op_htrans> t() const; //!< Hermitian trans pose | |||
arma_inline const Op<derived,op_htrans> ht() const; //!< Hermitian trans pose | arma_inline const Op<derived,op_htrans> ht() const; //!< Hermitian trans pose | |||
arma_inline const Op<derived,op_strans> st() const; //!< simple transpos e | arma_inline const Op<derived,op_strans> st() const; //!< simple transpos e | |||
inline void print(const std::string extra_text = "") const; | inline void print(const std::string extra_text = "") const; | |||
inline void print(std::ostream& user_stream, const std::string extra_text = "") const; | inline void print(std::ostream& user_stream, const std::string extra_text = "") const; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 27 lines changed or added | |||
Base_meat.hpp | Base_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 53 | skipping to change at line 53 | |||
Base<elem_type,derived>::st() const | Base<elem_type,derived>::st() const | |||
{ | { | |||
return Op<derived,op_strans>( (*this).get_ref() ); | return Op<derived,op_strans>( (*this).get_ref() ); | |||
} | } | |||
template<typename elem_type, typename derived> | template<typename elem_type, typename derived> | |||
inline | inline | |||
void | void | |||
Base<elem_type,derived>::print(const std::string extra_text) const | Base<elem_type,derived>::print(const std::string extra_text) const | |||
{ | { | |||
const unwrap<derived> tmp( (*this).get_ref() ); | const Proxy<derived> P( (*this).get_ref() ); | |||
const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q); | ||||
tmp.M.impl_print(extra_text); | tmp.M.impl_print(extra_text); | |||
} | } | |||
template<typename elem_type, typename derived> | template<typename elem_type, typename derived> | |||
inline | inline | |||
void | void | |||
Base<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const | Base<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const | |||
{ | { | |||
const unwrap<derived> tmp( (*this).get_ref() ); | const Proxy<derived> P( (*this).get_ref() ); | |||
const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q); | ||||
tmp.M.impl_print(user_stream, extra_text); | tmp.M.impl_print(user_stream, extra_text); | |||
} | } | |||
template<typename elem_type, typename derived> | template<typename elem_type, typename derived> | |||
inline | inline | |||
void | void | |||
Base<elem_type,derived>::raw_print(const std::string extra_text) const | Base<elem_type,derived>::raw_print(const std::string extra_text) const | |||
{ | { | |||
const unwrap<derived> tmp( (*this).get_ref() ); | const Proxy<derived> P( (*this).get_ref() ); | |||
const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q); | ||||
tmp.M.impl_raw_print(extra_text); | tmp.M.impl_raw_print(extra_text); | |||
} | } | |||
template<typename elem_type, typename derived> | template<typename elem_type, typename derived> | |||
inline | inline | |||
void | void | |||
Base<elem_type,derived>::raw_print(std::ostream& user_stream, const std::st ring extra_text) const | Base<elem_type,derived>::raw_print(std::ostream& user_stream, const std::st ring extra_text) const | |||
{ | { | |||
const unwrap<derived> tmp( (*this).get_ref() ); | const Proxy<derived> P( (*this).get_ref() ); | |||
const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q); | ||||
tmp.M.impl_raw_print(user_stream, extra_text); | tmp.M.impl_raw_print(user_stream, extra_text); | |||
} | } | |||
// | // | |||
// extra functions defined in Base_blas_elem_type | // extra functions defined in Base_blas_elem_type | |||
template<typename derived> | template<typename derived> | |||
arma_inline | arma_inline | |||
const Op<derived,op_inv> | const Op<derived,op_inv> | |||
Base_blas_elem_type<derived>::i(const bool slow) const | Base_blas_elem_type<derived>::i(const bool slow) const | |||
{ | { | |||
return Op<derived,op_inv>( static_cast<const derived&>(*this), ((slow == false) ? 0 : 1), 0 ); | return Op<derived,op_inv>( static_cast<const derived&>(*this), ((slow == false) ? 0 : 1), 0 ); | |||
} | } | |||
// | ||||
// extra functions defined in Base_eval_Mat | ||||
template<typename elem_type, typename derived> | ||||
arma_inline | ||||
const derived& | ||||
Base_eval_Mat<elem_type, derived>::eval() const | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
return static_cast<const derived&>(*this); | ||||
} | ||||
// | ||||
// extra functions defined in Base_eval_expr | ||||
template<typename elem_type, typename derived> | ||||
arma_inline | ||||
Mat<elem_type> | ||||
Base_eval_expr<elem_type, derived>::eval() const | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
return Mat<elem_type>( static_cast<const derived&>(*this) ); | ||||
} | ||||
//! @} | //! @} | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 38 lines changed or added | |||
Col_bones.hpp | Col_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 115 | skipping to change at line 115 | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
class fixed : public Col<eT> | class 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_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; | |||
arma_inline void mem_setup(); | ||||
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; | |||
static const bool is_col = true; | static const bool is_col = true; | |||
skipping to change at line 178 | skipping to change at line 177 | |||
arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col) const; | arma_inline arma_warn_unused eT operator() (const uword in_row, 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_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(); | |||
}; | }; | |||
protected: | ||||
inline Col(const arma_fixed_indicator&, const uword in_n_elem, const eT* | ||||
in_mem); | ||||
public: | ||||
#ifdef ARMA_EXTRA_COL_PROTO | #ifdef ARMA_EXTRA_COL_PROTO | |||
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO) | #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO) | |||
#endif | #endif | |||
}; | }; | |||
//! @} | //! @} | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 7 lines changed or added | |||
Col_meat.hpp | Col_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 643 | skipping to change at line 643 | |||
arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds"); | arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds"); | |||
return Mat<eT>::memptr() + row_num + 1; | return Mat<eT>::memptr() + row_num + 1; | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
arma_inline | arma_inline | |||
void | void | |||
Col<eT>::fixed<fixed_n_elem>::mem_setup() | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
access::rw(Mat<eT>::n_rows) = fixed_n_elem; | ||||
access::rw(Mat<eT>::n_cols) = 1; | ||||
access::rw(Mat<eT>::n_elem) = fixed_n_elem; | ||||
access::rw(Mat<eT>::vec_state) = 1; | ||||
access::rw(Mat<eT>::mem_state) = 3; | ||||
access::rw(Mat<eT>::mem) = (use_extra) ? mem_local_extra : Mat<eT>: | ||||
:mem_local; | ||||
} | ||||
template<typename eT> | ||||
template<uword fixed_n_elem> | ||||
arma_inline | ||||
void | ||||
Col<eT>::fixed<fixed_n_elem>::change_to_row() | Col<eT>::fixed<fixed_n_elem>::change_to_row() | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
access::rw(Mat<eT>::n_cols) = fixed_n_elem; | access::rw(Mat<eT>::n_cols) = fixed_n_elem; | |||
access::rw(Mat<eT>::n_rows) = 1; | access::rw(Mat<eT>::n_rows) = 1; | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
arma_inline | arma_inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed() | Col<eT>::fixed<fixed_n_elem>::fixed() | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
arma_inline | arma_inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X) | Col<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local; | eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local; | |||
arrayops::copy( dest, X.mem, fixed_n_elem ); | arrayops::copy( dest, X.mem, fixed_n_elem ); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X) | Col<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Col<eT>::operator=(X); | Col<eT>::operator=(X); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
template<typename T1> | template<typename T1> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A) | Col<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Col<eT>::operator=(A.get_ref()); | Col<eT>::operator=(A.get_ref()); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
template<typename T1, typename T2> | template<typename T1, typename T2> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base< pod_type,T2>& B) | Col<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base< pod_type,T2>& B) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Col<eT>::init(A,B); | Col<eT>::init(A,B); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem) | Col<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local; | |||
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem ); | arrayops::copy( dest, aux_mem, fixed_n_elem ); | |||
} | } | |||
//! NOTE: this function relies on | //! NOTE: this function relies on | |||
//! Col::operator=(text), to change vec_state as well as swapping n_rows an d n_cols, | //! Col::operator=(text), to change vec_state as well as swapping n_rows an d n_cols, | |||
//! and Mat::init(), to check that the given vector will not have a differe nt size than fixed_n_elem. | //! and Mat::init(), to check that the given vector will not have a differe nt size than fixed_n_elem. | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const char* text) | Col<eT>::fixed<fixed_n_elem>::fixed(const char* text) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
change_to_row(); | change_to_row(); | |||
Col<eT>::operator=(text); | Col<eT>::operator=(text); | |||
} | } | |||
//! NOTE: this function relies on | //! NOTE: this function relies on | |||
//! Col::operator=(text), to change vec_state as well as swapping n_rows an d n_cols, | //! Col::operator=(text), to change vec_state as well as swapping n_rows an d n_cols, | |||
//! and Mat::init(), to check that the given vector will not have a differe nt size than fixed_n_elem. | //! and Mat::init(), to check that the given vector will not have a differe nt size than fixed_n_elem. | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const std::string& text) | Col<eT>::fixed<fixed_n_elem>::fixed(const std::string& text) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
change_to_row(); | change_to_row(); | |||
Col<eT>::operator=(text); | Col<eT>::operator=(text); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
template<typename T1> | template<typename T1> | |||
const Col<eT>& | const Col<eT>& | |||
Col<eT>::fixed<fixed_n_elem>::operator=(const Base<eT,T1>& A) | Col<eT>::fixed<fixed_n_elem>::operator=(const Base<eT,T1>& A) | |||
skipping to change at line 846 | skipping to change at line 824 | |||
return *this; | return *this; | |||
} | } | |||
#if defined(ARMA_USE_CXX11) | #if defined(ARMA_USE_CXX11) | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Col<eT>::fixed<fixed_n_elem>::fixed(const std::initializer_list<eT>& list) | Col<eT>::fixed<fixed_n_elem>::fixed(const std::initializer_list<eT>& list) | |||
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
(*this).operator=(list); | (*this).operator=(list); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
const Col<eT>& | const Col<eT>& | |||
Col<eT>::fixed<fixed_n_elem>::operator=(const std::initializer_list<eT>& li st) | Col<eT>::fixed<fixed_n_elem>::operator=(const std::initializer_list<eT>& li st) | |||
{ | { | |||
skipping to change at line 1053 | skipping to change at line 1030 | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat<eT>::mem_local[ 0]); | eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat<eT>::mem_local[ 0]); | |||
arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(1) ); | arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(1) ); | |||
return *this; | return *this; | |||
} | } | |||
template<typename eT> | ||||
inline | ||||
Col<eT>::Col(const arma_fixed_indicator&, const uword in_n_elem, const eT* | ||||
in_mem) | ||||
: Mat<eT>(arma_fixed_indicator(), in_n_elem, 1, 1, in_mem) | ||||
{ | ||||
arma_extra_debug_sigprint_this(this); | ||||
} | ||||
#ifdef ARMA_EXTRA_COL_MEAT | #ifdef ARMA_EXTRA_COL_MEAT | |||
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_MEAT) | #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_MEAT) | |||
#endif | #endif | |||
//! @} | //! @} | |||
End of changes. 21 change blocks. | ||||
36 lines changed or deleted | 21 lines changed or added | |||
Cube_meat.hpp | Cube_meat.hpp | |||
---|---|---|---|---|
// Copyright (C) 2008-2011 NICTA (www.nicta.com.au) | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2008-2011 Conrad Sanderson | // Copyright (C) 2008-2012 Conrad Sanderson | |||
// | // | |||
// This file is part of the Armadillo C++ library. | // This file is part of the Armadillo C++ library. | |||
// It is provided without any warranty of fitness | // It is provided without any warranty of fitness | |||
// for any purpose. You can redistribute this file | // for any purpose. You can redistribute this file | |||
// and/or modify it under the terms of the GNU | // and/or modify it under the terms of the GNU | |||
// Lesser General Public License (LGPL) as published | // Lesser General Public License (LGPL) as published | |||
// by the Free Software Foundation, either version 3 | // by the Free Software Foundation, either version 3 | |||
// of the License or (at your option) any later version. | // of the License or (at your option) any later version. | |||
// (see http://www.opensource.org/licenses for more info) | // (see http://www.opensource.org/licenses for more info) | |||
skipping to change at line 35 | skipping to change at line 35 | |||
{ | { | |||
if(n_elem > Cube_prealloc::mem_n_elem) | if(n_elem > Cube_prealloc::mem_n_elem) | |||
{ | { | |||
memory::release( access::rw(mem) ); | memory::release( access::rw(mem) ); | |||
} | } | |||
} | } | |||
if(arma_config::debug == true) | if(arma_config::debug == true) | |||
{ | { | |||
// try to expose buggy user code that accesses deleted objects | // try to expose buggy user code that accesses deleted objects | |||
access::rw(n_rows) = 0; | ||||
access::rw(n_cols) = 0; | ||||
access::rw(n_slices) = 0; | ||||
access::rw(n_elem) = 0; | ||||
access::rw(mat_ptrs) = 0; | access::rw(mat_ptrs) = 0; | |||
access::rw(mem) = 0; | access::rw(mem) = 0; | |||
} | } | |||
arma_type_check(( is_supported_elem_type<eT>::value == false )); | arma_type_check(( is_supported_elem_type<eT>::value == false )); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
Cube<eT>::Cube() | Cube<eT>::Cube() | |||
End of changes. 2 change blocks. | ||||
6 lines changed or deleted | 2 lines changed or added | |||
Mat_bones.hpp | Mat_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 451 | skipping to change at line 451 | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
class fixed : public Mat<eT> | class 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_prea lloc); | static const bool use_extra = (fixed_n_elem > arma_config::mat_prea lloc); | |||
arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; | arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; | |||
arma_inline void mem_setup(); | ||||
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 527 | skipping to change at line 525 | |||
#endif | #endif | |||
template<typename T1, typename T2> | template<typename T1, typename T2> | |||
inline void init(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B); | inline void init(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B); | |||
inline Mat(const char junk, const eT* aux_mem, const uword aux_n_rows, co nst uword aux_n_cols); | inline Mat(const char junk, const eT* aux_mem, const uword aux_n_rows, co nst uword aux_n_cols); | |||
inline Mat(const arma_vec_indicator&, const uhword in_vec_state); | inline Mat(const arma_vec_indicator&, const uhword in_vec_state); | |||
inline Mat(const arma_vec_indicator&, const uword in_n_rows, const uword in_n_cols, const uhword in_vec_state); | inline Mat(const arma_vec_indicator&, const uword in_n_rows, const uword in_n_cols, const uhword in_vec_state); | |||
inline Mat(const arma_fixed_indicator&, const uword in_n_rows, const uwor | ||||
d in_n_cols, const uhword in_vec_state, const eT* in_mem); | ||||
friend class Cube<eT>; | friend class Cube<eT>; | |||
friend class glue_join; | friend class glue_join; | |||
friend class op_strans; | friend class op_strans; | |||
friend class op_htrans; | friend class op_htrans; | |||
friend class op_resize; | friend class op_resize; | |||
public: | public: | |||
#ifdef ARMA_EXTRA_MAT_PROTO | #ifdef ARMA_EXTRA_MAT_PROTO | |||
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_MAT_PROTO) | #include ARMA_INCFILE_WRAP(ARMA_EXTRA_MAT_PROTO) | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added | |||
Mat_meat.hpp | Mat_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
{ | { | |||
if(n_elem > arma_config::mat_prealloc) | if(n_elem > arma_config::mat_prealloc) | |||
{ | { | |||
memory::release( access::rw(mem) ); | memory::release( access::rw(mem) ); | |||
} | } | |||
} | } | |||
if(arma_config::debug == true) | if(arma_config::debug == true) | |||
{ | { | |||
// try to expose buggy user code that accesses deleted objects | // try to expose buggy user code that accesses deleted objects | |||
access::rw(n_rows) = 0; | access::rw(mem) = 0; | |||
access::rw(n_cols) = 0; | ||||
access::rw(n_elem) = 0; | ||||
access::rw(mem) = 0; | ||||
} | } | |||
arma_type_check(( is_supported_elem_type<eT>::value == false )); | arma_type_check(( is_supported_elem_type<eT>::value == false )); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
Mat<eT>::Mat() | Mat<eT>::Mat() | |||
: n_rows(0) | : n_rows(0) | |||
, n_cols(0) | , n_cols(0) | |||
skipping to change at line 103 | skipping to change at line 100 | |||
, mem_state(0) | , mem_state(0) | |||
, mem() | , mem() | |||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
init_cold(); | init_cold(); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
Mat<eT>::Mat(const arma_fixed_indicator&, const uword in_n_rows, const uwor | ||||
d in_n_cols, const uhword in_vec_state, const eT* in_mem) | ||||
: n_rows (in_n_rows) | ||||
, n_cols (in_n_cols) | ||||
, n_elem (in_n_rows*in_n_cols) | ||||
, vec_state (in_vec_state) | ||||
, mem_state (3) | ||||
, mem (in_mem) | ||||
{ | ||||
arma_extra_debug_sigprint_this(this); | ||||
} | ||||
template<typename eT> | ||||
inline | ||||
void | void | |||
Mat<eT>::init_cold() | Mat<eT>::init_cold() | |||
{ | { | |||
arma_extra_debug_sigprint( arma_boost::format("n_rows = %d, n_cols = %d") % n_rows % n_cols ); | arma_extra_debug_sigprint( arma_boost::format("n_rows = %d, n_cols = %d") % n_rows % n_cols ); | |||
// ensure that n_elem can hold the result of (n_rows * n_cols) | // ensure that n_elem can hold the result of (n_rows * n_cols) | |||
arma_debug_check | arma_debug_check | |||
( | ( | |||
( | ( | |||
skipping to change at line 182 | skipping to change at line 192 | |||
in_n_rows = 1; | in_n_rows = 1; | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
arma_debug_set_error | arma_debug_set_error | |||
( | ( | |||
err_state, | err_state, | |||
err_msg, | err_msg, | |||
( ((t_vec_state == 1) && (in_n_cols != 1)) || ((t_vec_state == 2) & & (in_n_rows != 1)) ), | ( ((t_vec_state == 1) && (in_n_cols != 1)) || ((t_vec_state == 2) & & (in_n_rows != 1)) ), | |||
"Mat::init(): object is a vector; requested size is not compatible" | "Mat::init(): object is a row or column vector; requested size is n ot compatible" | |||
); | ); | |||
} | } | |||
} | } | |||
// ensure that n_elem can hold the result of (n_rows * n_cols) | // ensure that n_elem can hold the result of (n_rows * n_cols) | |||
arma_debug_set_error | arma_debug_set_error | |||
( | ( | |||
err_state, | err_state, | |||
err_msg, | err_msg, | |||
skipping to change at line 5088 | skipping to change at line 5098 | |||
inline | inline | |||
uword | uword | |||
Mat<eT>::size() const | Mat<eT>::size() const | |||
{ | { | |||
return n_elem; | return n_elem; | |||
} | } | |||
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 | |||
void | ||||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::mem_setup() | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
access::rw(Mat<eT>::n_rows) = fixed_n_rows; | ||||
access::rw(Mat<eT>::n_cols) = fixed_n_cols; | ||||
access::rw(Mat<eT>::n_elem) = fixed_n_elem; | ||||
access::rw(Mat<eT>::vec_state) = 0; | ||||
access::rw(Mat<eT>::mem_state) = 3; | ||||
access::rw(Mat<eT>::mem) = (use_extra) ? mem_local_extra : mem_loca | ||||
l; | ||||
} | ||||
template<typename eT> | ||||
template<uword fixed_n_rows, uword fixed_n_cols> | ||||
arma_inline | ||||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed() | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed() | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
} | } | |||
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 | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const fixed<fixed_n_rows, fixed_n_cols>& X) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const fixed<fixed_n_rows, fixed_n_cols>& X) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
eT* dest = (use_extra) ? mem_local_extra : mem_local; | eT* dest = (use_extra) ? mem_local_extra : mem_local; | |||
arrayops::copy( dest, X.mem, fixed_n_elem ); | arrayops::copy( dest, X.mem, fixed_n_elem ); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
template<typename T1> | template<typename T1> | |||
inline | inline | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const Base<eT,T1>& A) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const Base<eT,T1>& A) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Mat<eT>::operator=(A.get_ref()); | Mat<eT>::operator=(A.get_ref()); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
template<typename T1, typename T2> | template<typename T1, typename T2> | |||
inline | inline | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Mat<eT>::init(A,B); | Mat<eT>::init(A,B); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
inline | inline | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const eT* aux_mem) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const eT* aux_mem) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | eT* dest = (use_extra) ? mem_local_extra : mem_local; | |||
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem ); | arrayops::copy( dest, aux_mem, fixed_n_elem ); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
inline | inline | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const char* text) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const char* text) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Mat<eT>::operator=(text); | Mat<eT>::operator=(text); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
inline | inline | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const std::string& text) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const std::string& text) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Mat<eT>::operator=(text); | Mat<eT>::operator=(text); | |||
} | } | |||
#if defined(ARMA_USE_CXX11) | #if defined(ARMA_USE_CXX11) | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
inline | inline | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const std::initializer_li st<eT>& list) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const std::initializer_li st<eT>& list) | |||
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_e xtra) ? mem_local_extra : mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
(*this).operator=(list); | (*this).operator=(list); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_rows, uword fixed_n_cols> | template<uword fixed_n_rows, uword fixed_n_cols> | |||
inline | inline | |||
const Mat<eT>& | const Mat<eT>& | |||
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator=(const std::initialize r_list<eT>& list) | Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator=(const std::initialize r_list<eT>& list) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
End of changes. 21 change blocks. | ||||
38 lines changed or deleted | 26 lines changed or added | |||
Proxy.hpp | Proxy.hpp | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
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; | |||
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 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; | |||
inline explicit Proxy_fixed(const T1& A) | inline explicit Proxy_fixed(const T1& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 96 | skipping to change at line 97 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const Mat<eT>& A) | inline explicit Proxy(const Mat<eT>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 134 | skipping to change at line 136 | |||
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; | |||
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 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; | |||
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(); | |||
skipping to change at line 172 | skipping to change at line 175 | |||
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; | |||
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 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; | |||
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(); | |||
skipping to change at line 210 | skipping to change at line 214 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const Gen<T1, gen_type>& A) | inline explicit Proxy(const Gen<T1, gen_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 248 | skipping to change at line 253 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const Op<T1, op_type>& A) | inline explicit Proxy(const Op<T1, op_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 281 | skipping to change at line 287 | |||
}; | }; | |||
template<typename T1> | template<typename T1> | |||
struct Proxy_xtrans_default | struct Proxy_xtrans_default | |||
{ | { | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
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; | ||||
arma_aligned const Mat<eT> Q; | arma_aligned const Mat<eT> Q; | |||
arma_hot | arma_hot | |||
inline Proxy_xtrans_default(const T1& A) | inline Proxy_xtrans_default(const T1& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
} | } | |||
skipping to change at line 309 | skipping to change at line 316 | |||
}; | }; | |||
template<typename T1> | template<typename T1> | |||
struct Proxy_xtrans_vector< Op<T1, op_htrans> > | struct Proxy_xtrans_vector< Op<T1, op_htrans> > | |||
{ | { | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
static const bool prefer_at_accessor = false; | static const bool prefer_at_accessor = false; | |||
static const bool has_subview = quasi_unwrap<T1>::has_subview; | static const bool has_subview = quasi_unwrap<T1>::has_subview; | |||
static const bool is_fixed = false; | static const bool is_fixed = false; | |||
static const bool fake_mat = true; | ||||
arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col | arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col | |||
arma_aligned const Mat<eT> Q; | arma_aligned const Mat<eT> Q; | |||
inline Proxy_xtrans_vector(const Op<T1, op_htrans>& A) | inline Proxy_xtrans_vector(const Op<T1, op_htrans>& A) | |||
: U(A.m) | : U(A.m) | |||
, Q(const_cast<eT*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false ) | , Q(const_cast<eT*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false ) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
} | } | |||
skipping to change at line 332 | skipping to change at line 340 | |||
}; | }; | |||
template<typename T1> | template<typename T1> | |||
struct Proxy_xtrans_vector< Op<T1, op_strans> > | struct Proxy_xtrans_vector< Op<T1, op_strans> > | |||
{ | { | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
static const bool prefer_at_accessor = false; | static const bool prefer_at_accessor = false; | |||
static const bool has_subview = quasi_unwrap<T1>::has_subview; | static const bool has_subview = quasi_unwrap<T1>::has_subview; | |||
static const bool is_fixed = false; | static const bool is_fixed = false; | |||
static const bool fake_mat = true; | ||||
arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col | arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col | |||
arma_aligned const Mat<eT> Q; | arma_aligned const Mat<eT> Q; | |||
inline Proxy_xtrans_vector(const Op<T1, op_strans>& A) | inline Proxy_xtrans_vector(const Op<T1, op_strans>& A) | |||
: U(A.m) | : U(A.m) | |||
, Q(const_cast<eT*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false ) | , Q(const_cast<eT*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false ) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
} | } | |||
skipping to change at line 384 | skipping to change at line 393 | |||
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; | |||
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; | ||||
// 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; | |||
using Proxy_xtrans::Q; | using Proxy_xtrans::Q; | |||
inline explicit Proxy(const Op<T1, op_htrans>& A) | inline explicit Proxy(const Op<T1, op_htrans>& A) | |||
: Proxy_xtrans(A) | : Proxy_xtrans(A) | |||
{ | { | |||
skipping to change at line 438 | skipping to change at line 448 | |||
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; | |||
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; | ||||
// 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; | |||
using Proxy_xtrans::Q; | using Proxy_xtrans::Q; | |||
inline explicit Proxy(const Op<T1, op_strans>& A) | inline explicit Proxy(const Op<T1, op_strans>& A) | |||
: Proxy_xtrans(A) | : Proxy_xtrans(A) | |||
{ | { | |||
skipping to change at line 477 | skipping to change at line 488 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const Glue<T1, T2, glue_type>& A) | inline explicit Proxy(const Glue<T1, T2, glue_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 515 | skipping to change at line 527 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const subview<eT>& A) | inline explicit Proxy(const subview<eT>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 553 | skipping to change at line 566 | |||
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; | |||
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 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; | |||
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(); | |||
skipping to change at line 591 | skipping to change at line 605 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const subview_row<eT>& A) | inline explicit Proxy(const subview_row<eT>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 629 | skipping to change at line 644 | |||
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; | |||
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 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; | |||
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(); | |||
skipping to change at line 667 | skipping to change at line 683 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const subview_elem2<eT,T1,T2>& A) | inline explicit Proxy(const subview_elem2<eT,T1,T2>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 705 | skipping to change at line 722 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const diagview<eT>& A) | inline explicit Proxy(const diagview<eT>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 743 | skipping to change at line 761 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const eOp<T1, eop_type>& A) | inline explicit Proxy(const eOp<T1, eop_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 781 | skipping to change at line 800 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const eGlue<T1, T2, eglue_type>& A) | inline explicit Proxy(const eGlue<T1, T2, eglue_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 819 | skipping to change at line 839 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const mtOp<out_eT, T1, op_type>& A) | inline explicit Proxy(const mtOp<out_eT, T1, op_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 857 | skipping to change at line 878 | |||
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; | |||
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 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; | |||
inline explicit Proxy(const mtGlue<out_eT, T1, T2, glue_type>& A) | inline explicit Proxy(const mtGlue<out_eT, T1, T2, glue_type>& A) | |||
: Q(A) | : Q(A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
End of changes. 22 change blocks. | ||||
0 lines changed or deleted | 22 lines changed or added | |||
Row_bones.hpp | Row_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 115 | skipping to change at line 115 | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
class fixed : public Row<eT> | class 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_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; | |||
arma_inline void mem_setup(); | ||||
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 177 | skipping to change at line 175 | |||
arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col) const; | arma_inline arma_warn_unused eT operator() (const uword in_row, 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_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(); | |||
}; | }; | |||
protected: | ||||
inline Row(const arma_fixed_indicator&, const uword in_n_elem, const eT* | ||||
in_mem); | ||||
public: | ||||
#ifdef ARMA_EXTRA_ROW_PROTO | #ifdef ARMA_EXTRA_ROW_PROTO | |||
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_PROTO) | #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_PROTO) | |||
#endif | #endif | |||
}; | }; | |||
//! @} | //! @} | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 7 lines changed or added | |||
Row_meat.hpp | Row_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 607 | skipping to change at line 607 | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds"); | arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds"); | |||
return Mat<eT>::memptr() + Mat<eT>::n_cols; | return Mat<eT>::memptr() + Mat<eT>::n_cols; | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
arma_inline | ||||
void | ||||
Row<eT>::fixed<fixed_n_elem>::mem_setup() | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
access::rw(Mat<eT>::n_rows) = 1; | ||||
access::rw(Mat<eT>::n_cols) = fixed_n_elem; | ||||
access::rw(Mat<eT>::n_elem) = fixed_n_elem; | ||||
access::rw(Mat<eT>::vec_state) = 2; | ||||
access::rw(Mat<eT>::mem_state) = 3; | ||||
access::rw(Mat<eT>::mem) = (use_extra) ? mem_local_extra : Mat<eT>: | ||||
:mem_local; | ||||
} | ||||
template<typename eT> | ||||
template<uword fixed_n_elem> | ||||
inline | inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed() | Row<eT>::fixed<fixed_n_elem>::fixed() | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
arma_inline | arma_inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X) | Row<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local; | eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local; | |||
arrayops::copy( dest, X.mem, fixed_n_elem ); | arrayops::copy( dest, X.mem, fixed_n_elem ); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
arma_inline | arma_inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X) | Row<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Row<eT>::operator=(X); | Row<eT>::operator=(X); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
template<typename T1> | template<typename T1> | |||
arma_inline | arma_inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A) | Row<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Row<eT>::operator=(A.get_ref()); | Row<eT>::operator=(A.get_ref()); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
template<typename T1, typename T2> | template<typename T1, typename T2> | |||
arma_inline | arma_inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base< pod_type,T2>& B) | Row<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base< pod_type,T2>& B) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Row<eT>::init(A,B); | Row<eT>::init(A,B); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem) | Row<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local; | |||
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem ); | arrayops::copy( dest, aux_mem, fixed_n_elem ); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const char* text) | Row<eT>::fixed<fixed_n_elem>::fixed(const char* text) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Row<eT>::operator=(text); | Row<eT>::operator=(text); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const std::string& text) | Row<eT>::fixed<fixed_n_elem>::fixed(const std::string& text) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
Row<eT>::operator=(text); | Row<eT>::operator=(text); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
template<typename T1> | template<typename T1> | |||
const Row<eT>& | const Row<eT>& | |||
Row<eT>::fixed<fixed_n_elem>::operator=(const Base<eT,T1>& A) | Row<eT>::fixed<fixed_n_elem>::operator=(const Base<eT,T1>& A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 786 | skipping to change at line 764 | |||
return *this; | return *this; | |||
} | } | |||
#if defined(ARMA_USE_CXX11) | #if defined(ARMA_USE_CXX11) | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
Row<eT>::fixed<fixed_n_elem>::fixed(const std::initializer_list<eT>& list) | Row<eT>::fixed<fixed_n_elem>::fixed(const std::initializer_list<eT>& list) | |||
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) ) | ||||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint_this(this); | |||
mem_setup(); | ||||
(*this).operator=(list); | (*this).operator=(list); | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
template<uword fixed_n_elem> | template<uword fixed_n_elem> | |||
inline | inline | |||
const Row<eT>& | const Row<eT>& | |||
Row<eT>::fixed<fixed_n_elem>::operator=(const std::initializer_list<eT>& li st) | Row<eT>::fixed<fixed_n_elem>::operator=(const std::initializer_list<eT>& li st) | |||
{ | { | |||
skipping to change at line 993 | skipping to change at line 970 | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat<eT>::mem_local[ 0]); | eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat<eT>::mem_local[ 0]); | |||
arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(1) ); | arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(1) ); | |||
return *this; | return *this; | |||
} | } | |||
template<typename eT> | ||||
inline | ||||
Row<eT>::Row(const arma_fixed_indicator&, const uword in_n_elem, const eT* | ||||
in_mem) | ||||
: Mat<eT>(arma_fixed_indicator(), 1, in_n_elem, 2, in_mem) | ||||
{ | ||||
arma_extra_debug_sigprint_this(this); | ||||
} | ||||
#ifdef ARMA_EXTRA_ROW_MEAT | #ifdef ARMA_EXTRA_ROW_MEAT | |||
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_MEAT) | #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_MEAT) | |||
#endif | #endif | |||
//! @} | //! @} | |||
End of changes. 21 change blocks. | ||||
36 lines changed or deleted | 21 lines changed or added | |||
arma_version.hpp | arma_version.hpp | |||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
// Lesser General Public License (LGPL) as published | // Lesser General Public License (LGPL) as published | |||
// by the Free Software Foundation, either version 3 | // by the Free Software Foundation, either version 3 | |||
// of the License or (at your option) any later version. | // of the License or (at your option) any later version. | |||
// (see http://www.opensource.org/licenses for more info) | // (see http://www.opensource.org/licenses for more info) | |||
//! \addtogroup arma_version | //! \addtogroup arma_version | |||
//! @{ | //! @{ | |||
#define ARMA_VERSION_MAJOR 3 | #define ARMA_VERSION_MAJOR 3 | |||
#define ARMA_VERSION_MINOR 1 | #define ARMA_VERSION_MINOR 1 | |||
#define ARMA_VERSION_PATCH 91 | #define ARMA_VERSION_PATCH 92 | |||
#define ARMA_VERSION_NAME "v3.2 beta 1" | #define ARMA_VERSION_NAME "v3.2 beta 2" | |||
struct arma_version | struct arma_version | |||
{ | { | |||
static const unsigned int major = ARMA_VERSION_MAJOR; | static const unsigned int major = ARMA_VERSION_MAJOR; | |||
static const unsigned int minor = ARMA_VERSION_MINOR; | static const unsigned int minor = ARMA_VERSION_MINOR; | |||
static const unsigned int patch = ARMA_VERSION_PATCH; | static const unsigned int patch = ARMA_VERSION_PATCH; | |||
static | static | |||
inline | inline | |||
std::string | std::string | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
config.hpp | config.hpp | |||
---|---|---|---|---|
skipping to change at line 72 | skipping to change at line 72 | |||
#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 / | |||
#define ARMA_USE_BOOST | #define ARMA_USE_BOOST | |||
#define ARMA_USE_BOOST_DATE | #define ARMA_USE_BOOST_DATE | |||
#define ARMA_USE_WRAPPER | #define ARMA_USE_WRAPPER | |||
/* #undef ARMA_USE_HDF5 */ | ||||
#if !defined(ARMA_DEFAULT_OSTREAM) | #if !defined(ARMA_DEFAULT_OSTREAM) | |||
#define ARMA_DEFAULT_OSTREAM std::cout | #define ARMA_DEFAULT_OSTREAM std::cout | |||
#endif | #endif | |||
#define ARMA_PRINT_LOGIC_ERRORS | #define ARMA_PRINT_LOGIC_ERRORS | |||
#define ARMA_PRINT_RUNTIME_ERRORS | #define ARMA_PRINT_RUNTIME_ERRORS | |||
#define ARMA_HAVE_STD_ISFINITE | #define ARMA_HAVE_STD_ISFINITE | |||
#define ARMA_HAVE_STD_ISINF | #define ARMA_HAVE_STD_ISINF | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
debug.hpp | debug.hpp | |||
---|---|---|---|---|
skipping to change at line 390 | skipping to change at line 390 | |||
<< 1 << 'x' << A.n_rows << 'x' << A.n_cols | << 1 << 'x' << A.n_rows << 'x' << A.n_cols | |||
<< " is incompatible with cube dimensions: " | << " is incompatible with cube dimensions: " | |||
<< Q.n_rows << 'x' << Q.n_cols << 'x' << Q.n_slices; | << Q.n_rows << 'x' << Q.n_cols << 'x' << Q.n_slices; | |||
return tmp.str(); | return tmp.str(); | |||
} | } | |||
// | // | |||
// functions for checking whether two matrices have the same dimensions | // functions for checking whether two matrices have the same dimensions | |||
inline | arma_inline | |||
void | ||||
arma_hot | arma_hot | |||
void | ||||
arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uwo rd B_n_rows, const uword B_n_cols, const char* x) | arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uwo rd B_n_rows, const uword B_n_cols, const char* x) | |||
{ | { | |||
if( (A_n_rows != B_n_rows) || (A_n_cols != B_n_cols) ) | if( (A_n_rows != B_n_rows) || (A_n_cols != B_n_cols) ) | |||
{ | { | |||
arma_stop( arma_incompat_size_string(A_n_rows, A_n_cols, B_n_rows, B_n_ cols, x) ); | arma_stop( arma_incompat_size_string(A_n_rows, A_n_cols, B_n_rows, B_n_ cols, x) ); | |||
} | } | |||
} | } | |||
//! stop if given matrices have different sizes | //! stop if given matrices have different sizes | |||
template<typename eT1, typename eT2> | template<typename eT1, typename eT2> | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
eGlue_bones.hpp | eGlue_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
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 Proxy<T1> proxy1_type; | typedef Proxy<T1> proxy1_type; | |||
typedef Proxy<T2> proxy2_type; | typedef Proxy<T2> proxy2_type; | |||
static const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T2>::prefer_at_accessor); | static const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T2>::prefer_at_accessor); | |||
static const bool has_subview = (Proxy<T1>::has_subview || Proxy<T2>::has_subview ); | static const bool has_subview = (Proxy<T1>::has_subview || Proxy<T2>::has_subview ); | |||
static const bool is_fixed = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed ); | static const bool is_fixed = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed ); | |||
static const bool fake_mat = (Proxy<T1>::fake_mat || Proxy<T2>::fake_mat ); | ||||
static const bool is_col = (Proxy<T1>::is_col || Proxy<T2>::is_col); | static const bool is_col = (Proxy<T1>::is_col || Proxy<T2>::is_col); | |||
static const bool is_row = (Proxy<T1>::is_row || Proxy<T2>::is_row); | static const bool is_row = (Proxy<T1>::is_row || Proxy<T2>::is_row); | |||
arma_aligned const Proxy<T1> P1; | arma_aligned const Proxy<T1> P1; | |||
arma_aligned const Proxy<T2> P2; | arma_aligned const Proxy<T2> P2; | |||
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); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
eOp_bones.hpp | eOp_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
{ | { | |||
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 Proxy<T1> proxy_type; | typedef Proxy<T1> proxy_type; | |||
static const bool prefer_at_accessor = Proxy<T1>::prefer_at_accessor; | static const bool prefer_at_accessor = Proxy<T1>::prefer_at_accessor; | |||
static const bool has_subview = Proxy<T1>::has_subview; | static const bool has_subview = Proxy<T1>::has_subview; | |||
static const bool is_fixed = Proxy<T1>::is_fixed; | static const bool is_fixed = Proxy<T1>::is_fixed; | |||
static const bool fake_mat = Proxy<T1>::fake_mat; | ||||
static const bool is_row = Proxy<T1>::is_row; | static const bool is_row = Proxy<T1>::is_row; | |||
static const bool is_col = Proxy<T1>::is_col; | static const bool is_col = Proxy<T1>::is_col; | |||
arma_aligned const Proxy<T1> P; | arma_aligned const Proxy<T1> P; | |||
arma_aligned elem_type aux; //!< storage of auxiliary data , user defined format | arma_aligned elem_type aux; //!< storage of auxiliary data , user defined format | |||
arma_aligned uword aux_uword_a; //!< storage of auxiliary data , uword format | arma_aligned uword aux_uword_a; //!< storage of auxiliary data , uword format | |||
arma_aligned uword aux_uword_b; //!< storage of auxiliary data , uword format | arma_aligned uword aux_uword_b; //!< storage of auxiliary data , uword format | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
eglue_core_bones.hpp | eglue_core_bones.hpp | |||
---|---|---|---|---|
// Copyright (C) 2010 NICTA (www.nicta.com.au) | // Copyright (C) 2010-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2010 Conrad Sanderson | // Copyright (C) 2010-2012 Conrad Sanderson | |||
// | // | |||
// This file is part of the Armadillo C++ library. | // This file is part of the Armadillo C++ library. | |||
// It is provided without any warranty of fitness | // It is provided without any warranty of fitness | |||
// for any purpose. You can redistribute this file | // for any purpose. You can redistribute this file | |||
// and/or modify it under the terms of the GNU | // and/or modify it under the terms of the GNU | |||
// Lesser General Public License (LGPL) as published | // Lesser General Public License (LGPL) as published | |||
// by the Free Software Foundation, either version 3 | // by the Free Software Foundation, either version 3 | |||
// of the License or (at your option) any later version. | // of the License or (at your option) any later version. | |||
// (see http://www.opensource.org/licenses for more info) | // (see http://www.opensource.org/licenses for more info) | |||
skipping to change at line 39 | skipping to change at line 39 | |||
// cubes | // cubes | |||
template<typename T1, typename T2> arma_hot inline static void apply(Cube <typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x); | template<typename T1, typename T2> arma_hot inline static void apply(Cube <typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x); | |||
template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_plus (Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_plus (Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | |||
template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_minus(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_minus(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | |||
template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_schur(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_schur(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | |||
template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_div (Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | template<typename T1, typename T2> arma_hot inline static void apply_inpl ace_div (Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_ type>& x); | |||
}; | }; | |||
class eglue_plus; | class eglue_plus : public eglue_core<eglue_plus> | |||
class eglue_minus; | { | |||
class eglue_div; | public: | |||
class eglue_schur; | ||||
inline static const char* text() { return "addition"; } | ||||
}; | ||||
class eglue_minus : public eglue_core<eglue_minus> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "subtraction"; } | ||||
}; | ||||
class eglue_div : public eglue_core<eglue_div> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "element-wise division"; } | ||||
}; | ||||
class eglue_schur : public eglue_core<eglue_schur> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "element-wise multiplication"; | ||||
} | ||||
}; | ||||
//! @} | //! @} | |||
End of changes. 2 change blocks. | ||||
6 lines changed or deleted | 30 lines changed or added | |||
eglue_core_meat.hpp | eglue_core_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
// for any purpose. You can redistribute this file | // for any purpose. You can redistribute this file | |||
// and/or modify it under the terms of the GNU | // and/or modify it under the terms of the GNU | |||
// Lesser General Public License (LGPL) as published | // Lesser General Public License (LGPL) as published | |||
// by the Free Software Foundation, either version 3 | // by the Free Software Foundation, either version 3 | |||
// of the License or (at your option) any later version. | // of the License or (at your option) any later version. | |||
// (see http://www.opensource.org/licenses for more info) | // (see http://www.opensource.org/licenses for more info) | |||
//! \addtogroup eglue_core | //! \addtogroup eglue_core | |||
//! @{ | //! @{ | |||
class eglue_plus : public eglue_core<eglue_plus> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "addition"; } | ||||
}; | ||||
class eglue_minus : public eglue_core<eglue_minus> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "subtraction"; } | ||||
}; | ||||
class eglue_div : public eglue_core<eglue_div> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "element-wise division"; } | ||||
}; | ||||
class eglue_schur : public eglue_core<eglue_schur> | ||||
{ | ||||
public: | ||||
inline static const char* text() { return "element-wise multiplication"; | ||||
} | ||||
}; | ||||
#undef arma_applier_1 | #undef arma_applier_1 | |||
#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_1(operatorA, operatorB) \ | |||
{\ | {\ | |||
uword i,j;\ | uword i,j;\ | |||
\ | \ | |||
End of changes. 1 change blocks. | ||||
29 lines changed or deleted | 0 lines changed or added | |||
fn_strans.hpp | fn_strans.hpp | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0 | const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0 | |||
) | ) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk1); | arma_ignore(junk1); | |||
arma_ignore(junk2); | arma_ignore(junk2); | |||
return Op<T1, op_strans>(X.get_ref()); | return Op<T1, op_strans>(X.get_ref()); | |||
} | } | |||
// NOTE: deliberately returning op_htrans instead of op_strans, | ||||
// NOTE: due to currently more optimisations available when using op_htrans | ||||
, especially by glue_times | ||||
template<typename T1> | template<typename T1> | |||
arma_inline | arma_inline | |||
const Op<T1, op_htrans> | const Op<T1, op_htrans> | |||
strans | strans | |||
( | ( | |||
const Base<typename T1::elem_type,T1>& X, | const Base<typename T1::elem_type,T1>& X, | |||
const typename enable_if<is_basevec<T1>::value == false>::result* junk1 = 0, | const typename enable_if<is_basevec<T1>::value == false>::result* junk1 = 0, | |||
const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0 | const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0 | |||
) | ) | |||
{ | { | |||
skipping to change at line 67 | skipping to change at line 69 | |||
const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0 | const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0 | |||
) | ) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk1); | arma_ignore(junk1); | |||
arma_ignore(junk2); | arma_ignore(junk2); | |||
return Op<T1, op_strans>(X); | return Op<T1, op_strans>(X); | |||
} | } | |||
// NOTE: deliberately returning op_htrans instead of op_strans, | ||||
// NOTE: due to currently more optimisations available when using op_htrans | ||||
, especially by glue_times | ||||
template<typename T1> | template<typename T1> | |||
arma_inline | arma_inline | |||
const Op<T1, op_htrans> | const Op<T1, op_htrans> | |||
strans | strans | |||
( | ( | |||
const T1& X, | const T1& X, | |||
const typename enable_if<is_basevec<T1>::value == true>::result* junk1 = 0, | const typename enable_if<is_basevec<T1>::value == true>::result* junk1 = 0, | |||
const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0 | const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0 | |||
) | ) | |||
{ | { | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
forward_bones.hpp | forward_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 128 | skipping to change at line 128 | |||
template< typename T1, typename eop_type> class eOpCube; | template< typename T1, typename eop_type> class eOpCube; | |||
template<typename out_eT, typename T1, typename op_type> class mtOpCube; | template<typename out_eT, typename T1, typename op_type> class mtOpCube; | |||
template< typename T1, typename T2, typename glue_type> cl ass GlueCube; | template< typename T1, typename T2, typename glue_type> cl ass GlueCube; | |||
template< typename T1, typename T2, typename eglue_type> cl ass eGlueCube; | template< typename T1, typename T2, typename eglue_type> cl ass eGlueCube; | |||
template<typename out_eT, typename T1, typename T2, typename glue_type> cl ass mtGlueCube; | template<typename out_eT, typename T1, typename T2, typename glue_type> cl ass mtGlueCube; | |||
template<typename T1> class Proxy; | template<typename T1> class Proxy; | |||
template<typename T1> class ProxyCube; | template<typename T1> class ProxyCube; | |||
struct arma_vec_indicator {}; | struct arma_vec_indicator {}; | |||
struct arma_fixed_indicator {}; | ||||
//! \addtogroup injector | //! \addtogroup injector | |||
//! @{ | //! @{ | |||
template<typename Dummy = int> struct injector_end_of_row {}; | template<typename Dummy = int> struct injector_end_of_row {}; | |||
static const injector_end_of_row<> endr = injector_end_of_row<>(); | static const injector_end_of_row<> endr = injector_end_of_row<>(); | |||
//!< endr indicates "end of row" when using the << operator; | //!< endr indicates "end of row" when using the << operator; | |||
//!< similar conceptual meaning to std::endl | //!< similar conceptual meaning to std::endl | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
op_htrans_bones.hpp | op_htrans_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
template<typename eT> | template<typename eT> | |||
arma_hot arma_inline static void apply(Mat<eT>& out, const Mat<eT>& A, co nst typename arma_not_cx<eT>::result* junk = 0); | arma_hot arma_inline static void apply(Mat<eT>& out, const Mat<eT>& A, co nst typename arma_not_cx<eT>::result* junk = 0); | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A, const t ypename arma_cx_only<eT>::result* junk = 0); | arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A, const t ypename arma_cx_only<eT>::result* junk = 0); | |||
// | // | |||
template<typename T1> | template<typename T1> | |||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const | arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, | |||
Op<T1,op_htrans>& in); | const T1& X); | |||
// | ||||
template<typename T1> | ||||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const | ||||
Op<T1,op_htrans>& in, const typename arma_not_cx<typename T1::elem_type>:: | ||||
result* junk = 0); | ||||
template<typename T1> | ||||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const | ||||
Op<T1,op_htrans>& in, const typename arma_cx_only<typename T1::elem_type>: | ||||
:result* junk = 0); | ||||
// | ||||
template<typename T1> | template<typename T1> | |||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op< Op<T1, op_trimat>, op_htrans>& in); | arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op< Op<T1, op_trimat>, op_htrans>& in); | |||
}; | }; | |||
class op_htrans2 | class op_htrans2 | |||
{ | { | |||
public: | public: | |||
template<typename eT> | template<typename eT> | |||
arma_hot arma_inline static void apply(Mat<eT>& out, const Mat<eT>& A, co nst eT val, const typename arma_not_cx<eT>::result* junk = 0); | arma_hot inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& A, const eT val); | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A, const e | arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A, const e | |||
T val, const typename arma_cx_only<eT>::result* junk = 0); | T val); | |||
// | ||||
template<typename T1> | ||||
arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, | ||||
const T1& X, const typename T1::elem_type val); | ||||
// | ||||
template<typename T1> | ||||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const | ||||
Op<T1,op_htrans2>& in, const typename arma_not_cx<typename T1::elem_type>: | ||||
:result* junk = 0); | ||||
template<typename T1> | template<typename T1> | |||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2>& in); | arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2>& in, const typename arma_cx_only<typename T1::elem_type> ::result* junk = 0); | |||
}; | }; | |||
//! @} | //! @} | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 33 lines changed or added | |||
op_htrans_meat.hpp | op_htrans_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
op_htrans::apply_noalias(Mat<eT>& out, const Mat<eT>& A, const typename arm a_cx_only<eT>::result* junk) | op_htrans::apply_noalias(Mat<eT>& out, const Mat<eT>& A, const typename arm a_cx_only<eT>::result* junk) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | arma_ignore(junk); | |||
const uword A_n_rows = A.n_rows; | const uword A_n_rows = A.n_rows; | |||
const uword A_n_cols = A.n_cols; | const uword A_n_cols = A.n_cols; | |||
out.set_size(A_n_cols, A_n_rows); | out.set_size(A_n_cols, A_n_rows); | |||
for(uword in_row = 0; in_row < A_n_rows; ++in_row) | if( (A_n_cols == 1) || (A_n_rows == 1) ) | |||
{ | { | |||
const uword out_col = in_row; | const uword n_elem = A.n_elem; | |||
for(uword in_col = 0; in_col < A_n_cols; ++in_col) | const eT* A_mem = A.memptr(); | |||
eT* out_mem = out.memptr(); | ||||
for(uword i=0; i < n_elem; ++i) | ||||
{ | { | |||
const uword out_row = in_col; | out_mem[i] = std::conj(A_mem[i]); | |||
out.at(out_row, out_col) = std::conj( A.at(in_row, in_col) ); | ||||
} | } | |||
} | } | |||
else | ||||
{ | ||||
for(uword in_row = 0; in_row < A_n_rows; ++in_row) | ||||
{ | ||||
const uword out_col = in_row; | ||||
for(uword in_col = 0; in_col < A_n_cols; ++in_col) | ||||
{ | ||||
const uword out_row = in_col; | ||||
out.at(out_row, out_col) = std::conj( A.at(in_row, in_col) ); | ||||
} | ||||
} | ||||
} | ||||
} | } | |||
template<typename eT> | template<typename eT> | |||
arma_hot | arma_hot | |||
arma_inline | arma_inline | |||
void | void | |||
op_htrans::apply(Mat<eT>& out, const Mat<eT>& A, const typename arma_not_cx <eT>::result* junk) | op_htrans::apply(Mat<eT>& out, const Mat<eT>& A, const typename arma_not_cx <eT>::result* junk) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | arma_ignore(junk); | |||
skipping to change at line 82 | skipping to change at line 96 | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | arma_ignore(junk); | |||
if(&out != &A) | if(&out != &A) | |||
{ | { | |||
op_htrans::apply_noalias(out, A); | op_htrans::apply_noalias(out, A); | |||
} | } | |||
else | else | |||
{ | { | |||
if(out.n_rows == out.n_cols) | const uword n_rows = out.n_rows; | |||
const uword n_cols = out.n_cols; | ||||
if(n_rows == n_cols) | ||||
{ | { | |||
arma_extra_debug_print("doing in-place hermitian transpose of a squar e matrix"); | arma_extra_debug_print("doing in-place hermitian transpose of a squar e matrix"); | |||
const uword n_rows = out.n_rows; | for(uword col=0; col < n_cols; ++col) | |||
const uword n_cols = out.n_cols; | ||||
for(uword col=0; col<n_cols; ++col) | ||||
{ | { | |||
eT* coldata = out.colptr(col); | eT* coldata = out.colptr(col); | |||
out.at(col,col) = std::conj( out.at(col,col) ); | out.at(col,col) = std::conj( out.at(col,col) ); | |||
for(uword row=(col+1); row<n_rows; ++row) | for(uword row=(col+1); row < n_rows; ++row) | |||
{ | { | |||
const eT val1 = std::conj(coldata[row]); | const eT val1 = std::conj(coldata[row]); | |||
const eT val2 = std::conj(out.at(col,row)); | const eT val2 = std::conj(out.at(col,row)); | |||
out.at(col,row) = val1; | out.at(col,row) = val1; | |||
coldata[row] = val2; | coldata[row] = val2; | |||
} | } | |||
} | } | |||
} | } | |||
else | else | |||
skipping to change at line 120 | skipping to change at line 134 | |||
out.steal_mem(tmp); | out.steal_mem(tmp); | |||
} | } | |||
} | } | |||
} | } | |||
template<typename T1> | template<typename T1> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
op_htrans::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans>& in) | op_htrans::apply_proxy(Mat<typename T1::elem_type>& out, const T1& X) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
const unwrap<T1> tmp(in.m); | const Proxy<T1> P(X); | |||
const Mat<eT>& A = tmp.M; | ||||
// allow detection of in-place transpose | ||||
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) && (Proxy<T1 | ||||
>::fake_mat == false) ) | ||||
{ | ||||
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q); | ||||
op_htrans::apply(out, tmp.M); | ||||
} | ||||
else | ||||
{ | ||||
const uword n_rows = P.get_n_rows(); | ||||
const uword n_cols = P.get_n_cols(); | ||||
const bool is_alias = P.is_alias(out); | ||||
if( (resolves_to_vector<T1>::value == true) && (Proxy<T1>::prefer_at_ac | ||||
cessor == false) ) | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
eT* out_mem = out.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
for(uword i=0; i < n_elem; ++i) | ||||
{ | ||||
out_mem[i] = std::conj(Pea[i]); | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
eT* out_mem = out2.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
for(uword i=0; i < n_elem; ++i) | ||||
{ | ||||
out_mem[i] = std::conj(Pea[i]); | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
for(uword i=0; i < n_rows; ++i) | ||||
{ | ||||
out.at(k,i) = std::conj(P.at(i,k)); | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
op_htrans::apply(out, A); | for(uword k=0; k < n_cols; ++k) | |||
for(uword i=0; i < n_rows; ++i) | ||||
{ | ||||
out2.at(k,i) = std::conj(P.at(i,k)); | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
} | ||||
} | ||||
template<typename T1> | ||||
arma_hot | ||||
inline | ||||
void | ||||
op_htrans::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans>& | ||||
in, const typename arma_not_cx<typename T1::elem_type>::result* junk) | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
arma_ignore(junk); | ||||
op_strans::apply_proxy(out, in.m); | ||||
} | ||||
template<typename T1> | ||||
arma_hot | ||||
inline | ||||
void | ||||
op_htrans::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans>& | ||||
in, const typename arma_cx_only<typename T1::elem_type>::result* junk) | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
arma_ignore(junk); | ||||
op_htrans::apply_proxy(out, in.m); | ||||
} | } | |||
template<typename T1> | template<typename T1> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
op_htrans::apply(Mat<typename T1::elem_type>& out, const Op< Op<T1, op_trim at>, op_htrans>& in) | op_htrans::apply(Mat<typename T1::elem_type>& out, const Op< Op<T1, op_trim at>, op_htrans>& in) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
skipping to change at line 157 | skipping to change at line 268 | |||
op_trimat::apply_htrans(out, A, upper); | op_trimat::apply_htrans(out, A, upper); | |||
} | } | |||
// | // | |||
// op_htrans2 | // op_htrans2 | |||
template<typename eT> | template<typename eT> | |||
arma_hot | arma_hot | |||
arma_inline | arma_inline | |||
void | void | |||
op_htrans2::apply(Mat<eT>& out, const Mat<eT>& A, const eT val, const typen ame arma_not_cx<eT>::result* junk) | op_htrans2::apply_noalias(Mat<eT>& out, const Mat<eT>& A, const eT val) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | ||||
op_strans2::apply(out, A, val); | const uword A_n_rows = A.n_rows; | |||
const uword A_n_cols = A.n_cols; | ||||
out.set_size(A_n_cols, A_n_rows); | ||||
if( (A_n_cols == 1) || (A_n_rows == 1) ) | ||||
{ | ||||
const uword n_elem = A.n_elem; | ||||
const eT* A_mem = A.memptr(); | ||||
eT* out_mem = out.memptr(); | ||||
for(uword i=0; i < n_elem; ++i) | ||||
{ | ||||
out_mem[i] = val * std::conj(A_mem[i]); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
for(uword in_row = 0; in_row < A_n_rows; ++in_row) | ||||
{ | ||||
const uword out_col = in_row; | ||||
for(uword in_col = 0; in_col < A_n_cols; ++in_col) | ||||
{ | ||||
const uword out_row = in_col; | ||||
out.at(out_row, out_col) = val * std::conj( A.at(in_row, in_col) ); | ||||
} | ||||
} | ||||
} | ||||
} | } | |||
template<typename eT> | template<typename eT> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
op_htrans2::apply(Mat<eT>& out, const Mat<eT>& A, const eT val, const typen ame arma_cx_only<eT>::result* junk) | op_htrans2::apply(Mat<eT>& out, const Mat<eT>& A, const eT val) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | ||||
// TODO: replace with specialised implementation | if(&out != &A) | |||
{ | ||||
op_htrans2::apply_noalias(out, A, val); | ||||
} | ||||
else | ||||
{ | ||||
const uword n_rows = out.n_rows; | ||||
const uword n_cols = out.n_cols; | ||||
if(n_rows == n_cols) | ||||
{ | ||||
arma_extra_debug_print("doing in-place hermitian transpose of a squar | ||||
e matrix"); | ||||
// TODO: do multiplication while swapping | ||||
for(uword col=0; col < n_cols; ++col) | ||||
{ | ||||
eT* coldata = out.colptr(col); | ||||
out.at(col,col) = std::conj( out.at(col,col) ); | ||||
for(uword row=(col+1); row < n_rows; ++row) | ||||
{ | ||||
const eT val1 = std::conj(coldata[row]); | ||||
const eT val2 = std::conj(out.at(col,row)); | ||||
out.at(col,row) = val1; | ||||
coldata[row] = val2; | ||||
} | ||||
} | ||||
op_htrans::apply(out, A); | arrayops::inplace_mul( out.memptr(), val, out.n_elem ); | |||
} | ||||
else | ||||
{ | ||||
Mat<eT> tmp; | ||||
op_htrans2::apply_noalias(tmp, A, val); | ||||
arrayops::inplace_mul( out.memptr(), val, out.n_elem ); | out.steal_mem(tmp); | |||
} | ||||
} | ||||
} | } | |||
template<typename T1> | template<typename T1> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
op_htrans2::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2> & in) | op_htrans2::apply_proxy(Mat<typename T1::elem_type>& out, const T1& X, cons t typename T1::elem_type val) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
const unwrap<T1> tmp(in.m); | const Proxy<T1> P(X); | |||
if( | ||||
(is_Mat<typename Proxy<T1>::stored_type>::value || is_Mat_fixed<typenam | ||||
e Proxy<T1>::stored_type>::value) | ||||
&& | ||||
(Proxy<T1>::fake_mat == false) // can't rely on simple alias checking | ||||
for matrices constructed out of auxiliary memory | ||||
) | ||||
{ | ||||
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q); // need this u | ||||
nwrap to keep stupid compilers happy | ||||
op_htrans2::apply(out, tmp.M, val); | ||||
} | ||||
else | ||||
{ | ||||
const uword n_rows = P.get_n_rows(); | ||||
const uword n_cols = P.get_n_cols(); | ||||
const bool is_alias = P.is_alias(out); | ||||
if( (resolves_to_vector<T1>::value == true) && (Proxy<T1>::prefer_at_ac | ||||
cessor == false) ) | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
eT* out_mem = out.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
for(uword i=0; i < n_elem; ++i) | ||||
{ | ||||
out_mem[i] = val * std::conj(Pea[i]); | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
eT* out_mem = out2.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
for(uword i=0; i < n_elem; ++i) | ||||
{ | ||||
out_mem[i] = val * std::conj(Pea[i]); | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
for(uword i=0; i < n_rows; ++i) | ||||
{ | ||||
out.at(k,i) = val * std::conj(P.at(i,k)); | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
for(uword i=0; i < n_rows; ++i) | ||||
{ | ||||
out2.at(k,i) = val * std::conj(P.at(i,k)); | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
} | ||||
} | ||||
template<typename T1> | ||||
arma_hot | ||||
inline | ||||
void | ||||
op_htrans2::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2> | ||||
& in, const typename arma_not_cx<typename T1::elem_type>::result* junk) | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
arma_ignore(junk); | ||||
op_strans2::apply_proxy(out, in.m, in.aux); | ||||
} | ||||
template<typename T1> | ||||
arma_hot | ||||
inline | ||||
void | ||||
op_htrans2::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_htrans2> | ||||
& in, const typename arma_cx_only<typename T1::elem_type>::result* junk) | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
arma_ignore(junk); | ||||
op_htrans2::apply(out, tmp.M, in.aux); | op_htrans2::apply_proxy(out, in.m, in.aux); | |||
} | } | |||
//! @} | //! @} | |||
End of changes. 23 change blocks. | ||||
26 lines changed or deleted | 312 lines changed or added | |||
op_strans_bones.hpp | op_strans_bones.hpp | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply_noalias_tinysq(Mat<eT>& out, const Mat< eT>& A); | arma_hot inline static void apply_noalias_tinysq(Mat<eT>& out, const Mat< eT>& A); | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& A) ; | arma_hot inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& A) ; | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A); | arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A); | |||
template<typename T1> | template<typename T1> | |||
arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, | ||||
const T1& X); | ||||
template<typename T1> | ||||
arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_strans>& in); | arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op_strans>& in); | |||
}; | }; | |||
class op_strans2 | class op_strans2 | |||
{ | { | |||
public: | public: | |||
template<const bool do_flip, const uword row, const uword col> | template<const bool do_flip, const uword row, const uword col> | |||
struct pos | struct pos | |||
{ | { | |||
skipping to change at line 63 | skipping to change at line 66 | |||
}; | }; | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply_noalias_tinysq(Mat<eT>& out, const Mat< eT>& A, const eT val); | arma_hot inline static void apply_noalias_tinysq(Mat<eT>& out, const Mat< eT>& A, const eT val); | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& A, const eT val); | arma_hot inline static void apply_noalias(Mat<eT>& out, const Mat<eT>& A, const eT val); | |||
template<typename eT> | template<typename eT> | |||
arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A, const e T val); | arma_hot inline static void apply(Mat<eT>& out, const Mat<eT>& A, const e T val); | |||
template<typename T1> | ||||
arma_hot inline static void apply_proxy(Mat<typename T1::elem_type>& out, | ||||
const T1& X, const typename T1::elem_type val); | ||||
}; | }; | |||
//! @} | //! @} | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||
op_strans_meat.hpp | op_strans_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 195 | skipping to change at line 195 | |||
out.steal_mem(tmp); | out.steal_mem(tmp); | |||
} | } | |||
} | } | |||
} | } | |||
template<typename T1> | template<typename T1> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
op_strans::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_strans>& in) | op_strans::apply_proxy(Mat<typename T1::elem_type>& out, const T1& X) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
const unwrap<T1> tmp(in.m); | const Proxy<T1> P(X); | |||
const Mat<eT>& A = tmp.M; | ||||
if( | ||||
(is_Mat<typename Proxy<T1>::stored_type>::value || is_Mat_fixed<typenam | ||||
e Proxy<T1>::stored_type>::value) | ||||
&& | ||||
(Proxy<T1>::fake_mat == false) // can't rely on simple alias checking | ||||
for matrices constructed out of auxiliary memory | ||||
) | ||||
{ | ||||
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q); // need this u | ||||
nwrap to keep stupid compilers happy | ||||
op_strans::apply(out, tmp.M); | ||||
} | ||||
else | ||||
{ | ||||
const uword n_rows = P.get_n_rows(); | ||||
const uword n_cols = P.get_n_cols(); | ||||
const bool is_alias = P.is_alias(out); | ||||
if( (resolves_to_vector<T1>::value == true) && (Proxy<T1>::prefer_at_ac | ||||
cessor == false) ) | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
eT* out_mem = out.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
uword i,j; | ||||
for(i=0, j=1; j < n_elem; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = Pea[i]; | ||||
const eT tmp_j = Pea[j]; | ||||
out_mem[i] = tmp_i; | ||||
out_mem[j] = tmp_j; | ||||
} | ||||
if(i < n_elem) | ||||
{ | ||||
out_mem[i] = Pea[i]; | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
eT* out_mem = out2.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
uword i,j; | ||||
for(i=0, j=1; j < n_elem; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = Pea[i]; | ||||
const eT tmp_j = Pea[j]; | ||||
out_mem[i] = tmp_i; | ||||
out_mem[j] = tmp_j; | ||||
} | ||||
if(i < n_elem) | ||||
{ | ||||
out_mem[i] = Pea[i]; | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
else // general matrix transpose | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
{ | ||||
uword i, j; | ||||
for(i=0, j=1; j < n_rows; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = P.at(i,k); | ||||
const eT tmp_j = P.at(j,k); | ||||
out.at(k,i) = tmp_i; | ||||
out.at(k,j) = tmp_j; | ||||
} | ||||
if(i < n_rows) | ||||
{ | ||||
out.at(k,i) = P.at(i,k); | ||||
} | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
{ | ||||
uword i, j; | ||||
for(i=0, j=1; j < n_rows; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = P.at(i,k); | ||||
const eT tmp_j = P.at(j,k); | ||||
out2.at(k,i) = tmp_i; | ||||
out2.at(k,j) = tmp_j; | ||||
} | ||||
if(i < n_rows) | ||||
{ | ||||
out2.at(k,i) = P.at(i,k); | ||||
} | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
} | ||||
} | ||||
template<typename T1> | ||||
arma_hot | ||||
inline | ||||
void | ||||
op_strans::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_strans>& | ||||
in) | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
op_strans::apply(out, A); | op_strans::apply_proxy(out, in.m); | |||
} | } | |||
// | // | |||
// op_strans2 | // op_strans2 | |||
//! for tiny square matrices (size <= 4x4) | //! for tiny square matrices (size <= 4x4) | |||
template<typename eT> | template<typename eT> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
skipping to change at line 284 | skipping to change at line 417 | |||
outm[pos<false,3,3>::n4] = val * Am[pos<true,3,3>::n4]; | outm[pos<false,3,3>::n4] = val * Am[pos<true,3,3>::n4]; | |||
} | } | |||
break; | break; | |||
default: | default: | |||
; | ; | |||
} | } | |||
} | } | |||
//! Immediate transpose of a dense matrix | ||||
template<typename eT> | template<typename eT> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
op_strans2::apply_noalias(Mat<eT>& out, const Mat<eT>& A, const eT val) | op_strans2::apply_noalias(Mat<eT>& out, const Mat<eT>& A, const eT val) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
const uword A_n_cols = A.n_cols; | const uword A_n_cols = A.n_cols; | |||
const uword A_n_rows = A.n_rows; | const uword A_n_rows = A.n_rows; | |||
skipping to change at line 407 | skipping to change at line 539 | |||
else | else | |||
{ | { | |||
Mat<eT> tmp; | Mat<eT> tmp; | |||
op_strans2::apply_noalias(tmp, A, val); | op_strans2::apply_noalias(tmp, A, val); | |||
out.steal_mem(tmp); | out.steal_mem(tmp); | |||
} | } | |||
} | } | |||
} | } | |||
template<typename T1> | ||||
arma_hot | ||||
inline | ||||
void | ||||
op_strans2::apply_proxy(Mat<typename T1::elem_type>& out, const T1& X, cons | ||||
t typename T1::elem_type val) | ||||
{ | ||||
arma_extra_debug_sigprint(); | ||||
typedef typename T1::elem_type eT; | ||||
const Proxy<T1> P(X); | ||||
// allow detection of in-place transpose | ||||
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) && (Proxy<T1 | ||||
>::fake_mat == false) ) | ||||
{ | ||||
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q); | ||||
op_strans2::apply(out, tmp.M, val); | ||||
} | ||||
else | ||||
{ | ||||
const uword n_rows = P.get_n_rows(); | ||||
const uword n_cols = P.get_n_cols(); | ||||
const bool is_alias = P.is_alias(out); | ||||
if( (resolves_to_vector<T1>::value == true) && (Proxy<T1>::prefer_at_ac | ||||
cessor == false) ) | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
eT* out_mem = out.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
uword i,j; | ||||
for(i=0, j=1; j < n_elem; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = Pea[i]; | ||||
const eT tmp_j = Pea[j]; | ||||
out_mem[i] = val * tmp_i; | ||||
out_mem[j] = val * tmp_j; | ||||
} | ||||
if(i < n_elem) | ||||
{ | ||||
out_mem[i] = val * Pea[i]; | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
eT* out_mem = out2.memptr(); | ||||
const uword n_elem = P.get_n_elem(); | ||||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | ||||
uword i,j; | ||||
for(i=0, j=1; j < n_elem; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = Pea[i]; | ||||
const eT tmp_j = Pea[j]; | ||||
out_mem[i] = val * tmp_i; | ||||
out_mem[j] = val * tmp_j; | ||||
} | ||||
if(i < n_elem) | ||||
{ | ||||
out_mem[i] = val * Pea[i]; | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
else // general matrix transpose | ||||
{ | ||||
if(is_alias == false) | ||||
{ | ||||
out.set_size(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
{ | ||||
uword i, j; | ||||
for(i=0, j=1; j < n_rows; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = P.at(i,k); | ||||
const eT tmp_j = P.at(j,k); | ||||
out.at(k,i) = val * tmp_i; | ||||
out.at(k,j) = val * tmp_j; | ||||
} | ||||
if(i < n_rows) | ||||
{ | ||||
out.at(k,i) = val * P.at(i,k); | ||||
} | ||||
} | ||||
} | ||||
else // aliasing | ||||
{ | ||||
Mat<eT> out2(n_cols, n_rows); | ||||
for(uword k=0; k < n_cols; ++k) | ||||
{ | ||||
uword i, j; | ||||
for(i=0, j=1; j < n_rows; i+=2, j+=2) | ||||
{ | ||||
const eT tmp_i = P.at(i,k); | ||||
const eT tmp_j = P.at(j,k); | ||||
out2.at(k,i) = val * tmp_i; | ||||
out2.at(k,j) = val * tmp_j; | ||||
} | ||||
if(i < n_rows) | ||||
{ | ||||
out2.at(k,i) = val * P.at(i,k); | ||||
} | ||||
} | ||||
out.steal_mem(out2); | ||||
} | ||||
} | ||||
} | ||||
} | ||||
//! @} | //! @} | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 280 lines changed or added | |||
op_unique_meat.hpp | op_unique_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
out[0] = tmp; | out[0] = tmp; | |||
} | } | |||
else | else | |||
{ | { | |||
out.set_size(in_n_rows, in_n_cols); | out.set_size(in_n_rows, in_n_cols); | |||
} | } | |||
return; | return; | |||
} | } | |||
std::vector<eT> vec(in_n_elem); | std::vector<eT> lvec(in_n_elem); | |||
if(Proxy<T1>::prefer_at_accessor == false) | if(Proxy<T1>::prefer_at_accessor == false) | |||
{ | { | |||
typename Proxy<T1>::ea_type Pea = P.get_ea(); | typename Proxy<T1>::ea_type Pea = P.get_ea(); | |||
uword i,j; | uword i,j; | |||
for(i=0, j=1; j < in_n_elem; i+=2, j+=2) | for(i=0, j=1; j < in_n_elem; i+=2, j+=2) | |||
{ | { | |||
const eT tmp_i = Pea[i]; | const eT tmp_i = Pea[i]; | |||
const eT tmp_j = Pea[j]; | const eT tmp_j = Pea[j]; | |||
vec[i] = tmp_i; | lvec[i] = tmp_i; | |||
vec[j] = tmp_j; | lvec[j] = tmp_j; | |||
} | } | |||
if(i < in_n_elem) | if(i < in_n_elem) | |||
{ | { | |||
vec[i] = Pea[i]; | lvec[i] = Pea[i]; | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
uword i = 0; | uword i = 0; | |||
for(uword col=0; col < in_n_cols; ++col) | for(uword col=0; col < in_n_cols; ++col) | |||
for(uword row=0; row < in_n_rows; ++row, ++i) | for(uword row=0; row < in_n_rows; ++row, ++i) | |||
{ | { | |||
vec[i] = P.at(row,col); | lvec[i] = P.at(row,col); | |||
} | } | |||
} | } | |||
std::sort( vec.begin(), vec.end() ); | std::sort( lvec.begin(), lvec.end() ); | |||
uword N_unique = 1; | uword N_unique = 1; | |||
for(uword i=1; i < in_n_elem; ++i) | for(uword i=1; i < in_n_elem; ++i) | |||
{ | { | |||
const eT a = vec[i-1]; | const eT a = lvec[i-1]; | |||
const eT b = vec[i ]; | const eT b = lvec[i ]; | |||
const eT diff = a - b; | const eT diff = a - b; | |||
if(diff != eT(0)) { ++N_unique; } | if(diff != eT(0)) { ++N_unique; } | |||
} | } | |||
uword out_n_rows; | uword out_n_rows; | |||
uword out_n_cols; | uword out_n_cols; | |||
if( (in_n_rows == 1) || (in_n_cols == 1) ) | if( (in_n_rows == 1) || (in_n_cols == 1) ) | |||
skipping to change at line 120 | skipping to change at line 120 | |||
out_n_rows = N_unique; | out_n_rows = N_unique; | |||
out_n_cols = 1; | out_n_cols = 1; | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
out_n_rows = N_unique; | out_n_rows = N_unique; | |||
out_n_cols = 1; | out_n_cols = 1; | |||
} | } | |||
// we don't need to worry about aliasing at this stage, as all the data i s stored in vec | // we don't need to worry about aliasing at this stage, as all the data i s stored in lvec | |||
out.set_size(out_n_rows, out_n_cols); | out.set_size(out_n_rows, out_n_cols); | |||
eT* out_mem = out.memptr(); | eT* out_mem = out.memptr(); | |||
if(in_n_elem > 0) { out_mem[0] = vec[0]; } | if(in_n_elem > 0) { out_mem[0] = lvec[0]; } | |||
N_unique = 1; | N_unique = 1; | |||
for(uword i=1; i < in_n_elem; ++i) | for(uword i=1; i < in_n_elem; ++i) | |||
{ | { | |||
const eT a = vec[i-1]; | const eT a = lvec[i-1]; | |||
const eT b = vec[i ]; | const eT b = lvec[i ]; | |||
const eT diff = a - b; | const eT diff = a - b; | |||
if(diff != eT(0)) | if(diff != eT(0)) | |||
{ | { | |||
out_mem[N_unique] = b; | out_mem[N_unique] = b; | |||
++N_unique; | ++N_unique; | |||
} | } | |||
} | } | |||
End of changes. 9 change blocks. | ||||
12 lines changed or deleted | 12 lines changed or added | |||
podarray_meat.hpp | podarray_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
if(n_elem > sizeof(mem_local)/sizeof(eT) ) | if(n_elem > sizeof(mem_local)/sizeof(eT) ) | |||
{ | { | |||
memory::release( access::rw(mem) ); | memory::release( access::rw(mem) ); | |||
} | } | |||
if(arma_config::debug == true) | if(arma_config::debug == true) | |||
{ | { | |||
access::rw(n_elem) = 0; | access::rw(mem) = 0; | |||
access::rw(mem) = 0; | ||||
} | } | |||
} | } | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
podarray<eT>::podarray() | podarray<eT>::podarray() | |||
: n_elem(0) | : n_elem(0) | |||
, mem (0) | , mem (0) | |||
{ | { | |||
arma_extra_debug_sigprint_this(this); | arma_extra_debug_sigprint_this(this); | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||