Base_bones.hpp   Base_bones.hpp 
// Copyright (C) 2008-2013 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup Base //! \addtogroup Base
//! @{ //! @{
template<typename derived> template<typename derived>
struct Base_blas_elem_type struct Base_inv_yes
{ {
arma_inline const Op<derived,op_inv> i(const bool slow = false) const; //!< matrix inverse arma_inline const Op<derived,op_inv> i(const bool slow = false) const; //!< matrix inverse
arma_inline const Op<derived,op_inv> i(const char* method ) const; //!< matrix inverse arma_inline const Op<derived,op_inv> i(const char* method ) const; //!< matrix inverse
}; };
template<typename derived> template<typename derived>
struct Base_other_elem_type struct Base_inv_no
{ {
}; };
template<typename derived, bool condition> template<typename derived, bool condition>
struct Base_extra {}; struct Base_inv {};
template<typename derived> template<typename derived>
struct Base_extra<derived, true> { typedef Base_blas_elem_type<derived> r esult; }; struct Base_inv<derived, true> { typedef Base_inv_yes<derived> result; };
template<typename derived> template<typename derived>
struct Base_extra<derived, false> { typedef Base_other_elem_type<derived> r esult; }; struct Base_inv<derived, false> { typedef Base_inv_no<derived> result; };
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
struct Base_eval_Mat struct Base_eval_Mat
{ {
arma_inline const derived& eval() const; arma_inline const derived& eval() const;
}; };
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
struct Base_eval_expr struct Base_eval_expr
{ {
skipping to change at line 53 skipping to change at line 53
template<typename elem_type, typename derived, bool condition> template<typename elem_type, typename derived, bool condition>
struct Base_eval {}; struct Base_eval {};
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
struct Base_eval<elem_type, derived, true> { typedef Base_eval_Mat<elem_ty pe, derived> result; }; struct Base_eval<elem_type, derived, true> { typedef Base_eval_Mat<elem_ty pe, derived> result; };
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
struct Base_eval<elem_type, derived, false> { typedef Base_eval_expr<elem_t ype, derived> result; }; struct Base_eval<elem_type, derived, false> { typedef Base_eval_expr<elem_t ype, derived> result; };
template<typename derived>
struct Base_trans_cx
{
arma_inline const Op<derived,op_htrans> t() const;
arma_inline const Op<derived,op_htrans> ht() const;
arma_inline const Op<derived,op_strans> st() const; // simple transpose:
no complex conjugates
};
template<typename derived>
struct Base_trans_default
{
arma_inline const Op<derived,op_htrans> t() const;
arma_inline const Op<derived,op_htrans> ht() const;
arma_inline const Op<derived,op_htrans> st() const; // return op_htrans
instead of op_strans, as it's handled better by matrix multiplication code
};
template<typename derived, bool condition>
struct Base_trans {};
template<typename derived>
struct Base_trans<derived, true> { typedef Base_trans_cx<derived> res
ult; };
template<typename derived>
struct Base_trans<derived, false> { typedef Base_trans_default<derived> res
ult; };
//! 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 struct Base
: public Base_extra<derived, is_supported_blas_type<elem_type>::value>::r esult : public Base_inv<derived, is_supported_blas_type<elem_type>::value>::res ult
, public Base_eval<elem_type, derived, is_Mat<derived>::value>::result , public Base_eval<elem_type, derived, is_Mat<derived>::value>::result
, public Base_trans<derived, is_cx<elem_type>::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> ht() const; //!< Hermitian trans
pose
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;
inline void raw_print(const std::string extra_text = "") const; inline void raw_print(const std::string extra_text = "") const;
inline void raw_print(std::ostream& user_stream, const std::string extra_ text = "") const; inline void raw_print(std::ostream& user_stream, const std::string extra_ text = "") const;
}; };
//! @} //! @}
 End of changes. 10 change blocks. 
15 lines changed or deleted 38 lines changed or added


 Base_meat.hpp   Base_meat.hpp 
// Copyright (C) 2008-2013 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup Base //! \addtogroup Base
//! @{ //! @{
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
arma_inline arma_inline
const derived& const derived&
Base<elem_type,derived>::get_ref() const Base<elem_type,derived>::get_ref() const
{ {
return static_cast<const derived&>(*this); return static_cast<const derived&>(*this);
} }
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
arma_inline
const Op<derived,op_htrans>
Base<elem_type,derived>::t() const
{
return Op<derived,op_htrans>( (*this).get_ref() );
}
template<typename elem_type, typename derived>
arma_inline
const Op<derived,op_htrans>
Base<elem_type,derived>::ht() const
{
return Op<derived,op_htrans>( (*this).get_ref() );
}
template<typename elem_type, typename derived>
arma_inline
const Op<derived,op_strans>
Base<elem_type,derived>::st() const
{
return Op<derived,op_strans>( (*this).get_ref() );
}
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 Proxy<derived> P( (*this).get_ref() ); const Proxy<derived> P( (*this).get_ref() );
const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q); const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q);
tmp.M.impl_print(extra_text); tmp.M.impl_print(extra_text);
} }
skipping to change at line 92 skipping to change at line 68
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 Proxy<derived> P( (*this).get_ref() ); const Proxy<derived> P( (*this).get_ref() );
const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q); 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_inv_yes
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_inv_yes<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 );
} }
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 char* method) const Base_inv_yes<derived>::i(const char* method) const
{ {
const char sig = (method != NULL) ? method[0] : char(0); const char sig = (method != NULL) ? method[0] : char(0);
arma_debug_check( ((sig != 's') && (sig != 'f')), "Base::i(): unknown met hod specified" ); arma_debug_check( ((sig != 's') && (sig != 'f')), "Base::i(): unknown met hod specified" );
return Op<derived,op_inv>( static_cast<const derived&>(*this), ((sig == ' f') ? 0 : 1), 0 ); return Op<derived,op_inv>( static_cast<const derived&>(*this), ((sig == ' f') ? 0 : 1), 0 );
} }
// //
// extra functions defined in Base_eval_Mat // extra functions defined in Base_eval_Mat
skipping to change at line 140 skipping to change at line 116
template<typename elem_type, typename derived> template<typename elem_type, typename derived>
arma_inline arma_inline
Mat<elem_type> Mat<elem_type>
Base_eval_expr<elem_type, derived>::eval() const Base_eval_expr<elem_type, derived>::eval() const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return Mat<elem_type>( static_cast<const derived&>(*this) ); return Mat<elem_type>( static_cast<const derived&>(*this) );
} }
//
// extra functions defined in Base_trans_cx
template<typename derived>
arma_inline
const Op<derived,op_htrans>
Base_trans_cx<derived>::t() const
{
return Op<derived,op_htrans>( static_cast<const derived&>(*this) );
}
template<typename derived>
arma_inline
const Op<derived,op_htrans>
Base_trans_cx<derived>::ht() const
{
return Op<derived,op_htrans>( static_cast<const derived&>(*this) );
}
template<typename derived>
arma_inline
const Op<derived,op_strans>
Base_trans_cx<derived>::st() const
{
return Op<derived,op_strans>( static_cast<const derived&>(*this) );
}
//
// extra functions defined in Base_trans_default
template<typename derived>
arma_inline
const Op<derived,op_htrans>
Base_trans_default<derived>::t() const
{
return Op<derived,op_htrans>( static_cast<const derived&>(*this) );
}
template<typename derived>
arma_inline
const Op<derived,op_htrans>
Base_trans_default<derived>::ht() const
{
return Op<derived,op_htrans>( static_cast<const derived&>(*this) );
}
template<typename derived>
arma_inline
const Op<derived,op_htrans>
Base_trans_default<derived>::st() const
{
return Op<derived,op_htrans>( static_cast<const derived&>(*this) );
}
//! @} //! @}
 End of changes. 6 change blocks. 
29 lines changed or deleted 59 lines changed or added


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


 diagmat_proxy.hpp   diagmat_proxy.hpp 
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup diagmat_proxy //! \addtogroup diagmat_proxy
//! @{ //! @{
template<typename T1> template<typename T1>
class diagmat_proxy_default class diagmat_proxy_default
skipping to change at line 84 skipping to change at line 84
return P.at(row,row); return P.at(row,row);
} }
} }
} }
else else
{ {
return elem_type(0); return elem_type(0);
} }
} }
arma_inline bool is_alias(const Mat<elem_type>&) const { return false; }
const Proxy<T1> P; const Proxy<T1> P;
const bool P_is_vec; const bool P_is_vec;
const bool P_is_col; const bool P_is_col;
const uword n_elem; const uword n_elem;
}; };
template<typename T1> template<typename T1>
class diagmat_proxy_fixed class diagmat_proxy_fixed
{ {
public: public:
skipping to change at line 132 skipping to change at line 134
if(row == col) if(row == col)
{ {
return (P_is_vec) ? P[row] : P.at(row,row); return (P_is_vec) ? P[row] : P.at(row,row);
} }
else else
{ {
return elem_type(0); return elem_type(0);
} }
} }
arma_inline bool is_alias(const Mat<elem_type>& X) const { return (void_p
tr(&X) == void_ptr(&P)); }
const T1& P; const T1& P;
static const bool P_is_vec = (T1::n_rows == 1) || (T1::n_cols == 1); static const bool P_is_vec = (T1::n_rows == 1) || (T1::n_cols == 1);
static const uword n_elem = P_is_vec ? T1::n_elem : ( (T1::n_elem < T1: :n_rows) ? T1::n_elem : T1::n_rows ); static const uword n_elem = P_is_vec ? T1::n_elem : ( (T1::n_elem < T1: :n_rows) ? T1::n_elem : T1::n_rows );
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct diagmat_proxy_redirect {}; struct diagmat_proxy_redirect {};
template<typename T1> template<typename T1>
skipping to change at line 183 skipping to change at line 187
arma_debug_check arma_debug_check
( (
(P_is_vec == false) && (P.n_rows != P.n_cols), (P_is_vec == false) && (P.n_rows != P.n_cols),
"diagmat(): only vectors and square matrices are accepted" "diagmat(): only vectors and square matrices are accepted"
); );
} }
arma_inline elem_type operator[] (const uword i) const { return P_is_vec ? P[i] : P.at(i,i); } arma_inline elem_type operator[] (const uword i) const { return P_is_vec ? P[i] : P.at(i,i); }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? ( P_is_vec ? P[row] : P.at(row,row) ) : elem_type( 0); } arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? ( P_is_vec ? P[row] : P.at(row,row) ) : elem_type( 0); }
arma_inline bool is_alias(const Mat<eT>& X) const { return (void_ptr(&X)
== void_ptr(&P)); }
const Mat<eT>& P; const Mat<eT>& P;
const bool P_is_vec; const bool P_is_vec;
const uword n_elem; const uword n_elem;
}; };
template<typename eT> template<typename eT>
class diagmat_proxy< Row<eT> > class diagmat_proxy< Row<eT> >
{ {
public: public:
skipping to change at line 204 skipping to change at line 210
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
inline inline
diagmat_proxy(const Row<eT>& X) diagmat_proxy(const Row<eT>& X)
: P(X) : P(X)
, n_elem(X.n_elem) , n_elem(X.n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline elem_type operator[] (const uword i) const { return P[i]; } arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); } arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
arma_inline bool is_alias(const Mat<eT>& X) const { return (void_ptr(&X)
== void_ptr(&P)); }
static const bool P_is_vec = true; static const bool P_is_vec = true;
const Row<eT>& P; const Row<eT>& P;
const uword n_elem; const uword n_elem;
}; };
template<typename eT> template<typename eT>
class diagmat_proxy< Col<eT> > class diagmat_proxy< Col<eT> >
{ {
public: public:
skipping to change at line 232 skipping to change at line 240
diagmat_proxy(const Col<eT>& X) diagmat_proxy(const Col<eT>& X)
: P(X) : P(X)
, n_elem(X.n_elem) , n_elem(X.n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline elem_type operator[] (const uword i) const { return P[i]; } arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); } arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
arma_inline bool is_alias(const Mat<eT>& X) const { return (void_ptr(&X)
== void_ptr(&P)); }
static const bool P_is_vec = true; static const bool P_is_vec = true;
const Col<eT>& P; const Col<eT>& P;
const uword n_elem; const uword n_elem;
}; };
template<typename eT> template<typename eT>
class diagmat_proxy< subview_row<eT> > class diagmat_proxy< subview_row<eT> >
{ {
public: public:
skipping to change at line 257 skipping to change at line 267
diagmat_proxy(const subview_row<eT>& X) diagmat_proxy(const subview_row<eT>& X)
: P(X) : P(X)
, n_elem(X.n_elem) , n_elem(X.n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline elem_type operator[] (const uword i) const { return P[i]; } arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); } arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
arma_inline bool is_alias(const Mat<eT>& X) const { return (void_ptr(&X)
== void_ptr(&(P.m))); }
static const bool P_is_vec = true; static const bool P_is_vec = true;
const subview_row<eT>& P; const subview_row<eT>& P;
const uword n_elem; const uword n_elem;
}; };
template<typename eT> template<typename eT>
class diagmat_proxy< subview_col<eT> > class diagmat_proxy< subview_col<eT> >
{ {
public: public:
skipping to change at line 282 skipping to change at line 294
diagmat_proxy(const subview_col<eT>& X) diagmat_proxy(const subview_col<eT>& X)
: P(X) : P(X)
, n_elem(X.n_elem) , n_elem(X.n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline elem_type operator[] (const uword i) const { return P[i]; } arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); } arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
arma_inline bool is_alias(const Mat<eT>& X) const { return (void_ptr(&X)
== void_ptr(&(P.m))); }
static const bool P_is_vec = true; static const bool P_is_vec = true;
const subview_col<eT>& P; const subview_col<eT>& P;
const uword n_elem; const uword n_elem;
}; };
// //
// //
// //
skipping to change at line 512 skipping to change at line 526
{ {
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;
inline inline
diagmat_proxy_check(const subview_col<eT>& X, const Mat<eT>& out) diagmat_proxy_check(const subview_col<eT>& X, const Mat<eT>& out)
: P ( const_cast<eT*>(X.colptr(0)), X.n_rows, (&(X.m) == &out), fal se ) : P ( const_cast<eT*>(X.colptr(0)), X.n_rows, (&(X.m) == &out), fal se )
, n_elem( X.n_elem ) , n_elem( X.n_elem )
//, X_ref ( X )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline elem_type operator[] (const uword i) const { return P[i]; } arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); } arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
static const bool P_is_vec = true; static const bool P_is_vec = true;
const Col<eT> P; const Col<eT> P;
const uword n_elem; const uword n_elem;
//const subview_col<eT>& X_ref; // prevents the compiler from potential
ly deleting X before we're done with it
}; };
//! @} //! @}
 End of changes. 11 change blocks. 
7 lines changed or deleted 23 lines changed or added


 forward_bones.hpp   forward_bones.hpp 
skipping to change at line 80 skipping to change at line 80
class glue_times; class glue_times;
class glue_times_diag; class glue_times_diag;
class glue_rel_lt; class glue_rel_lt;
class glue_rel_gt; class glue_rel_gt;
class glue_rel_lteq; class glue_rel_lteq;
class glue_rel_gteq; class glue_rel_gteq;
class glue_rel_eq; class glue_rel_eq;
class glue_rel_noteq; class glue_rel_noteq;
class glue_rel_and;
class glue_rel_or;
class op_rel_lt_pre; class op_rel_lt_pre;
class op_rel_lt_post; class op_rel_lt_post;
class op_rel_gt_pre; class op_rel_gt_pre;
class op_rel_gt_post; class op_rel_gt_post;
class op_rel_lteq_pre; class op_rel_lteq_pre;
class op_rel_lteq_post; class op_rel_lteq_post;
class op_rel_gteq_pre; class op_rel_gteq_pre;
class op_rel_gteq_post; class op_rel_gteq_post;
class op_rel_eq; class op_rel_eq;
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 glue_relational_bones.hpp   glue_relational_bones.hpp 
// Copyright (C) 2009-2010 Conrad Sanderson // Copyright (C) 2009-2014 Conrad Sanderson
// Copyright (C) 2009-2010 NICTA (www.nicta.com.au) // Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup glue_relational //! \addtogroup glue_relational
//! @{ //! @{
class glue_rel_lt class glue_rel_lt
{ {
skipping to change at line 77 skipping to change at line 77
{ {
public: public:
template<typename T1, typename T2> template<typename T1, typename T2>
inline static void apply(Mat <uword>& out, const mtGlue<uword, T1, T2, gl ue_rel_noteq>& X); inline static void apply(Mat <uword>& out, const mtGlue<uword, T1, T2, gl ue_rel_noteq>& X);
template<typename T1, typename T2> template<typename T1, typename T2>
inline static void apply(Cube <uword>& out, const mtGlueCube<uword, T1, T 2, glue_rel_noteq>& X); inline static void apply(Cube <uword>& out, const mtGlueCube<uword, T1, T 2, glue_rel_noteq>& X);
}; };
class glue_rel_and
{
public:
template<typename T1, typename T2>
inline static void apply(Mat <uword>& out, const mtGlue<uword, T1, T2, gl
ue_rel_and>& X);
template<typename T1, typename T2>
inline static void apply(Cube <uword>& out, const mtGlueCube<uword, T1, T
2, glue_rel_and>& X);
};
class glue_rel_or
{
public:
template<typename T1, typename T2>
inline static void apply(Mat <uword>& out, const mtGlue<uword, T1, T2, gl
ue_rel_or>& X);
template<typename T1, typename T2>
inline static void apply(Cube <uword>& out, const mtGlueCube<uword, T1, T
2, glue_rel_or>& X);
};
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 28 lines changed or added


 glue_relational_meat.hpp   glue_relational_meat.hpp 
// Copyright (C) 2009-2012 Conrad Sanderson // Copyright (C) 2009-2014 Conrad Sanderson
// Copyright (C) 2009-2012 NICTA (www.nicta.com.au) // Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup glue_relational //! \addtogroup glue_relational
//! @{ //! @{
#undef operator_rel #undef operator_rel
#undef operator_str #undef operator_str
skipping to change at line 217 skipping to change at line 217
( (
Mat <uword>& out, Mat <uword>& out,
const mtGlue<uword, T1, T2, glue_rel_noteq>& X const mtGlue<uword, T1, T2, glue_rel_noteq>& X
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_applier_mat(!=, "operator!="); arma_applier_mat(!=, "operator!=");
} }
template<typename T1, typename T2>
inline
void
glue_rel_and::apply
(
Mat <uword>& out,
const mtGlue<uword, T1, T2, glue_rel_and>& X
)
{
arma_extra_debug_sigprint();
arma_applier_mat(&&, "operator&&");
}
template<typename T1, typename T2>
inline
void
glue_rel_or::apply
(
Mat <uword>& out,
const mtGlue<uword, T1, T2, glue_rel_or>& X
)
{
arma_extra_debug_sigprint();
arma_applier_mat(||, "operator||");
}
// //
// //
// //
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
void void
glue_rel_lt::apply glue_rel_lt::apply
( (
Cube <uword>& out, Cube <uword>& out,
skipping to change at line 305 skipping to change at line 333
( (
Cube <uword>& out, Cube <uword>& out,
const mtGlueCube<uword, T1, T2, glue_rel_noteq>& X const mtGlueCube<uword, T1, T2, glue_rel_noteq>& X
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_applier_cube(!=, "operator!="); arma_applier_cube(!=, "operator!=");
} }
template<typename T1, typename T2>
inline
void
glue_rel_and::apply
(
Cube <uword>& out,
const mtGlueCube<uword, T1, T2, glue_rel_and>& X
)
{
arma_extra_debug_sigprint();
arma_applier_cube(&&, "operator&&");
}
template<typename T1, typename T2>
inline
void
glue_rel_or::apply
(
Cube <uword>& out,
const mtGlueCube<uword, T1, T2, glue_rel_or>& X
)
{
arma_extra_debug_sigprint();
arma_applier_cube(||, "operator||");
}
#undef arma_applier_mat #undef arma_applier_mat
#undef arma_applier_cube #undef arma_applier_cube
//! @} //! @}
 End of changes. 3 change blocks. 
2 lines changed or deleted 58 lines changed or added


 glue_times_meat.hpp   glue_times_meat.hpp 
// Copyright (C) 2008-2013 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup glue_times //! \addtogroup glue_times
//! @{ //! @{
template<bool is_eT_blas_type> template<bool is_eT_blas_type>
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
void void
glue_times_redirect2_helper<is_eT_blas_type>::apply(Mat<typename T1::elem_t ype>& out, const Glue<T1,T2,glue_times>& X) glue_times_redirect2_helper<is_eT_blas_type>::apply(Mat<typename T1::elem_t ype>& out, const Glue<T1,T2,glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const partial_unwrap_check<T1> tmp1(X.A, out); const partial_unwrap<T1> tmp1(X.A);
const partial_unwrap_check<T2> tmp2(X.B, out); const partial_unwrap<T2> tmp2(X.B);
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M; const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
const typename partial_unwrap_check<T2>::stored_type& B = tmp2.M; const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwr ap_check<T2>::do_times; const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2> ::do_times;
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT (0); const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT (0);
glue_times::apply const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out);
<
eT, if(alias == false)
partial_unwrap_check<T1>::do_trans, {
partial_unwrap_check<T2>::do_trans, glue_times::apply
(partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::do_tim <
es) eT,
> partial_unwrap<T1>::do_trans,
(out, A, B, alpha); partial_unwrap<T2>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times)
>
(out, A, B, alpha);
}
else
{
Mat<eT> tmp;
glue_times::apply
<
eT,
partial_unwrap<T1>::do_trans,
partial_unwrap<T2>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times)
>
(tmp, A, B, alpha);
out.steal_mem(tmp);
}
} }
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
void void
glue_times_redirect2_helper<true>::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_times>& X) glue_times_redirect2_helper<true>::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
if(strip_inv<T1>::do_inv == false) if(strip_inv<T1>::do_inv == false)
{ {
const partial_unwrap_check<T1> tmp1(X.A, out); const partial_unwrap<T1> tmp1(X.A);
const partial_unwrap_check<T2> tmp2(X.B, out); const partial_unwrap<T2> tmp2(X.B);
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M; const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
const typename partial_unwrap_check<T2>::stored_type& B = tmp2.M; const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_un wrap_check<T2>::do_times; const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T 2>::do_times;
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0); const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT(0);
glue_times::apply const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out);
<
eT, if(alias == false)
partial_unwrap_check<T1>::do_trans, {
partial_unwrap_check<T2>::do_trans, glue_times::apply
(partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::do_t <
imes) eT,
> partial_unwrap<T1>::do_trans,
(out, A, B, alpha); partial_unwrap<T2>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times)
>
(out, A, B, alpha);
}
else
{
Mat<eT> tmp;
glue_times::apply
<
eT,
partial_unwrap<T1>::do_trans,
partial_unwrap<T2>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times)
>
(tmp, A, B, alpha);
out.steal_mem(tmp);
}
} }
else else
{ {
arma_extra_debug_print("glue_times_redirect<2>::apply(): detected inv(A )*B"); arma_extra_debug_print("glue_times_redirect<2>::apply(): detected inv(A )*B");
const strip_inv<T1> A_strip(X.A); const strip_inv<T1> A_strip(X.A);
Mat<eT> A = A_strip.M; Mat<eT> A = A_strip.M;
arma_debug_check( (A.is_square() == false), "inv(): given matrix is not square" ); arma_debug_check( (A.is_square() == false), "inv(): given matrix is not square" );
skipping to change at line 102 skipping to change at line 142
void void
glue_times_redirect3_helper<is_eT_blas_type>::apply(Mat<typename T1::elem_t ype>& out, const Glue< Glue<T1,T2,glue_times>, T3, glue_times>& X) glue_times_redirect3_helper<is_eT_blas_type>::apply(Mat<typename T1::elem_t ype>& out, const Glue< Glue<T1,T2,glue_times>, T3, glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
// we have exactly 3 objects // we have exactly 3 objects
// hence we can safely expand X as X.A.A, X.A.B and X.B // hence we can safely expand X as X.A.A, X.A.B and X.B
const partial_unwrap_check<T1> tmp1(X.A.A, out); const partial_unwrap<T1> tmp1(X.A.A);
const partial_unwrap_check<T2> tmp2(X.A.B, out); const partial_unwrap<T2> tmp2(X.A.B);
const partial_unwrap_check<T3> tmp3(X.B, out); const partial_unwrap<T3> tmp3(X.B );
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M; const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
const typename partial_unwrap_check<T2>::stored_type& B = tmp2.M; const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
const typename partial_unwrap_check<T3>::stored_type& C = tmp3.M; const typename partial_unwrap<T3>::stored_type& C = tmp3.M;
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwr ap_check<T2>::do_times || partial_unwrap_check<T3>::do_times; const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2> ::do_times || partial_unwrap<T3>::do_times;
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp 3.get_val()) : eT(0); const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp 3.get_val()) : eT(0);
glue_times::apply const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_al
< ias(out);
eT,
partial_unwrap_check<T1>::do_trans, if(alias == false)
partial_unwrap_check<T2>::do_trans, {
partial_unwrap_check<T3>::do_trans, glue_times::apply
(partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::do_tim <
es || partial_unwrap_check<T3>::do_times) eT,
> partial_unwrap<T1>::do_trans,
(out, A, B, C, alpha); partial_unwrap<T2>::do_trans,
partial_unwrap<T3>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || part
ial_unwrap<T3>::do_times)
>
(out, A, B, C, alpha);
}
else
{
Mat<eT> tmp;
glue_times::apply
<
eT,
partial_unwrap<T1>::do_trans,
partial_unwrap<T2>::do_trans,
partial_unwrap<T3>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || part
ial_unwrap<T3>::do_times)
>
(tmp, A, B, C, alpha);
out.steal_mem(tmp);
}
} }
template<typename T1, typename T2, typename T3> template<typename T1, typename T2, typename T3>
arma_hot arma_hot
inline inline
void void
glue_times_redirect3_helper<true>::apply(Mat<typename T1::elem_type>& out, const Glue< Glue<T1,T2,glue_times>, T3, glue_times>& X) glue_times_redirect3_helper<true>::apply(Mat<typename T1::elem_type>& out, const Glue< Glue<T1,T2,glue_times>, T3, glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// TODO: investigate detecting inv(A)*B*C and replacing with solve(A,B)*C // TODO: investigate detecting inv(A)*B*C and replacing with solve(A,B)*C
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
if(strip_inv<T2>::do_inv == false) if(strip_inv<T2>::do_inv == false)
{ {
// we have exactly 3 objects // we have exactly 3 objects
// hence we can safely expand X as X.A.A, X.A.B and X.B // hence we can safely expand X as X.A.A, X.A.B and X.B
const partial_unwrap_check<T1> tmp1(X.A.A, out); const partial_unwrap<T1> tmp1(X.A.A);
const partial_unwrap_check<T2> tmp2(X.A.B, out); const partial_unwrap<T2> tmp2(X.A.B);
const partial_unwrap_check<T3> tmp3(X.B, out); const partial_unwrap<T3> tmp3(X.B );
const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
const typename partial_unwrap<T3>::stored_type& C = tmp3.M;
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M; const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T
const typename partial_unwrap_check<T2>::stored_type& B = tmp2.M; 2>::do_times || partial_unwrap<T3>::do_times;
const typename partial_unwrap_check<T3>::stored_type& C = tmp3.M;
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_un
wrap_check<T2>::do_times || partial_unwrap_check<T3>::do_times;
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * t mp3.get_val()) : eT(0); const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * t mp3.get_val()) : eT(0);
glue_times::apply const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_
< alias(out);
eT,
partial_unwrap_check<T1>::do_trans, if(alias == false)
partial_unwrap_check<T2>::do_trans, {
partial_unwrap_check<T3>::do_trans, glue_times::apply
(partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::do_t <
imes || partial_unwrap_check<T3>::do_times) eT,
> partial_unwrap<T1>::do_trans,
(out, A, B, C, alpha); partial_unwrap<T2>::do_trans,
partial_unwrap<T3>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || pa
rtial_unwrap<T3>::do_times)
>
(out, A, B, C, alpha);
}
else
{
Mat<eT> tmp;
glue_times::apply
<
eT,
partial_unwrap<T1>::do_trans,
partial_unwrap<T2>::do_trans,
partial_unwrap<T3>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || pa
rtial_unwrap<T3>::do_times)
>
(tmp, A, B, C, alpha);
out.steal_mem(tmp);
}
} }
else else
{ {
// replace A*inv(B)*C with A*solve(B,C) // replace A*inv(B)*C with A*solve(B,C)
arma_extra_debug_print("glue_times_redirect<3>::apply(): detected A*inv (B)*C"); arma_extra_debug_print("glue_times_redirect<3>::apply(): detected A*inv (B)*C");
const strip_inv<T2> B_strip(X.A.B); const strip_inv<T2> B_strip(X.A.B);
Mat<eT> B = B_strip.M; Mat<eT> B = B_strip.M;
skipping to change at line 210 skipping to change at line 292
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
void void
glue_times_redirect<N>::apply(Mat<typename T1::elem_type>& out, const Glue< T1,T2,glue_times>& X) glue_times_redirect<N>::apply(Mat<typename T1::elem_type>& out, const Glue< T1,T2,glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const partial_unwrap_check<T1> tmp1(X.A, out); const partial_unwrap<T1> tmp1(X.A);
const partial_unwrap_check<T2> tmp2(X.B, out); const partial_unwrap<T2> tmp2(X.B);
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M; const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
const typename partial_unwrap_check<T2>::stored_type& B = tmp2.M; const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwr ap_check<T2>::do_times; const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2> ::do_times;
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT (0); const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val()) : eT (0);
glue_times::apply const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out);
<
eT, if(alias == false)
partial_unwrap_check<T1>::do_trans, {
partial_unwrap_check<T2>::do_trans, glue_times::apply
(partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::do_tim <
es) eT,
> partial_unwrap<T1>::do_trans,
(out, A, B, alpha); partial_unwrap<T2>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times)
>
(out, A, B, alpha);
}
else
{
Mat<eT> tmp;
glue_times::apply
<
eT,
partial_unwrap<T1>::do_trans,
partial_unwrap<T2>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times)
>
(tmp, A, B, alpha);
out.steal_mem(tmp);
}
} }
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
void void
glue_times_redirect<2>::apply(Mat<typename T1::elem_type>& out, const Glue< T1,T2,glue_times>& X) glue_times_redirect<2>::apply(Mat<typename T1::elem_type>& out, const Glue< T1,T2,glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 268 skipping to change at line 370
void void
glue_times_redirect<4>::apply(Mat<typename T1::elem_type>& out, const Glue< Glue< Glue<T1,T2,glue_times>, T3, glue_times>, T4, glue_times>& X) glue_times_redirect<4>::apply(Mat<typename T1::elem_type>& out, const Glue< Glue< Glue<T1,T2,glue_times>, T3, glue_times>, T4, glue_times>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
// there is exactly 4 objects // there is exactly 4 objects
// hence we can safely expand X as X.A.A.A, X.A.A.B, X.A.B and X.B // hence we can safely expand X as X.A.A.A, X.A.A.B, X.A.B and X.B
const partial_unwrap_check<T1> tmp1(X.A.A.A, out); const partial_unwrap<T1> tmp1(X.A.A.A);
const partial_unwrap_check<T2> tmp2(X.A.A.B, out); const partial_unwrap<T2> tmp2(X.A.A.B);
const partial_unwrap_check<T3> tmp3(X.A.B, out); const partial_unwrap<T3> tmp3(X.A.B );
const partial_unwrap_check<T4> tmp4(X.B, out); const partial_unwrap<T4> tmp4(X.B );
const typename partial_unwrap_check<T1>::stored_type& A = tmp1.M; const typename partial_unwrap<T1>::stored_type& A = tmp1.M;
const typename partial_unwrap_check<T2>::stored_type& B = tmp2.M; const typename partial_unwrap<T2>::stored_type& B = tmp2.M;
const typename partial_unwrap_check<T3>::stored_type& C = tmp3.M; const typename partial_unwrap<T3>::stored_type& C = tmp3.M;
const typename partial_unwrap_check<T4>::stored_type& D = tmp4.M; const typename partial_unwrap<T4>::stored_type& D = tmp4.M;
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwr ap_check<T2>::do_times || partial_unwrap_check<T3>::do_times || partial_unw rap_check<T4>::do_times; const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2> ::do_times || partial_unwrap<T3>::do_times || partial_unwrap<T4>::do_times;
const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp 3.get_val() * tmp4.get_val()) : eT(0); const eT alpha = use_alpha ? (tmp1.get_val() * tmp2.get_val() * tmp 3.get_val() * tmp4.get_val()) : eT(0);
glue_times::apply const bool alias = tmp1.is_alias(out) || tmp2.is_alias(out) || tmp3.is_al
< ias(out) || tmp4.is_alias(out);
eT,
partial_unwrap_check<T1>::do_trans, if(alias == false)
partial_unwrap_check<T2>::do_trans, {
partial_unwrap_check<T3>::do_trans, glue_times::apply
partial_unwrap_check<T4>::do_trans, <
(partial_unwrap_check<T1>::do_times || partial_unwrap_check<T2>::do_tim eT,
es || partial_unwrap_check<T3>::do_times || partial_unwrap_check<T4>::do_ti partial_unwrap<T1>::do_trans,
mes) partial_unwrap<T2>::do_trans,
> partial_unwrap<T3>::do_trans,
(out, A, B, C, D, alpha); partial_unwrap<T4>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || part
ial_unwrap<T3>::do_times || partial_unwrap<T4>::do_times)
>
(out, A, B, C, D, alpha);
}
else
{
Mat<eT> tmp;
glue_times::apply
<
eT,
partial_unwrap<T1>::do_trans,
partial_unwrap<T2>::do_trans,
partial_unwrap<T3>::do_trans,
partial_unwrap<T4>::do_trans,
(partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times || part
ial_unwrap<T3>::do_times || partial_unwrap<T4>::do_times)
>
(tmp, A, B, C, D, alpha);
out.steal_mem(tmp);
}
} }
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
void void
glue_times::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_t imes>& X) glue_times::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_t imes>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 386 skipping to change at line 510
const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwr ap_check<T2>::do_times || (sign < sword(0)); const bool use_alpha = partial_unwrap_check<T1>::do_times || partial_unwr ap_check<T2>::do_times || (sign < sword(0));
const eT alpha = use_alpha ? ( tmp1.get_val() * tmp2.get_val() * ( (sign > sword(0)) ? eT(1) : eT(-1) ) ) : eT(0); const eT alpha = use_alpha ? ( tmp1.get_val() * tmp2.get_val() * ( (sign > sword(0)) ? eT(1) : eT(-1) ) ) : eT(0);
arma_debug_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multipli cation"); arma_debug_assert_mul_size(A, B, do_trans_A, do_trans_B, "matrix multipli cation");
const uword result_n_rows = (do_trans_A == false) ? (TA::is_row ? 1 : A.n _rows) : (TA::is_col ? 1 : A.n_cols); const uword result_n_rows = (do_trans_A == false) ? (TA::is_row ? 1 : A.n _rows) : (TA::is_col ? 1 : A.n_cols);
const uword result_n_cols = (do_trans_B == false) ? (TB::is_col ? 1 : B.n _cols) : (TB::is_row ? 1 : B.n_rows); const uword result_n_cols = (do_trans_B == false) ? (TB::is_col ? 1 : B.n _cols) : (TB::is_row ? 1 : B.n_rows);
arma_debug_assert_same_size(out.n_rows, out.n_cols, result_n_rows, result _n_cols, "addition"); arma_debug_assert_same_size(out.n_rows, out.n_cols, result_n_rows, result _n_cols, ( (sign > sword(0)) ? "addition" : "subtraction" ) );
if(out.n_elem == 0) if(out.n_elem == 0)
{ {
return; return;
} }
if( (do_trans_A == false) && (do_trans_B == false) && (use_alpha == false ) ) if( (do_trans_A == false) && (do_trans_B == false) && (use_alpha == false ) )
{ {
if( ((A.n_rows == 1) || (TA::is_row)) && (is_cx<eT>::no) ) { gemv <true, false, true>::apply(out.memptr(), B, A.memptr(), alpha, eT(1 )); } if( ((A.n_rows == 1) || (TA::is_row)) && (is_cx<eT>::no) ) { gemv <true, false, true>::apply(out.memptr(), B, A.memptr(), alpha, eT(1 )); }
else if( (B.n_cols == 1) || (TB::is_col) ) { gemv <false, false, true>::apply(out.memptr(), A, B.memptr(), alpha, eT(1 )); } else if( (B.n_cols == 1) || (TB::is_col) ) { gemv <false, false, true>::apply(out.memptr(), A, B.memptr(), alpha, eT(1 )); }
 End of changes. 23 change blocks. 
104 lines changed or deleted 230 lines changed or added


 memory.hpp   memory.hpp 
skipping to change at line 48 skipping to change at line 48
} }
template<typename eT> template<typename eT>
inline inline
arma_malloc arma_malloc
eT* eT*
memory::acquire(const uword n_elem) memory::acquire(const uword n_elem)
{ {
arma_debug_check arma_debug_check
( (
( n_elem > (std::numeric_limits<size_t>::max() / sizeof(eT)) ), ( size_t(n_elem) > (std::numeric_limits<size_t>::max() / sizeof(eT)) ),
"arma::memory::acquire(): requested size is too large" "arma::memory::acquire(): requested size is too large"
); );
eT* out_memptr; eT* out_memptr;
#if defined(ARMA_USE_TBB_ALLOC) #if defined(ARMA_USE_TBB_ALLOC)
{ {
out_memptr = (eT *) scalable_malloc(sizeof(eT)*n_elem); out_memptr = (eT *) scalable_malloc(sizeof(eT)*n_elem);
} }
#elif defined(ARMA_USE_MKL_ALLOC) #elif defined(ARMA_USE_MKL_ALLOC)
skipping to change at line 143 skipping to change at line 143
// TODO: for mingw, use __mingw_aligned_free // TODO: for mingw, use __mingw_aligned_free
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
bool bool
memory::is_aligned(const eT* mem) memory::is_aligned(const eT* mem)
{ {
#if (defined(ARMA_HAVE_ICC_ASSUME_ALIGNED) || defined(ARMA_HAVE_GCC_ASSUM E_ALIGNED)) && !defined(ARMA_DONT_CHECK_ALIGNMENT) #if (defined(ARMA_HAVE_ICC_ASSUME_ALIGNED) || defined(ARMA_HAVE_GCC_ASSUM E_ALIGNED)) && !defined(ARMA_DONT_CHECK_ALIGNMENT)
{ {
return ((std::ptrdiff_t(mem) & 0x0F) == 0); return (sizeof(std::size_t) >= sizeof(eT*)) ? ((std::size_t(mem) & 0x0F ) == 0) : false;
} }
#else #else
{ {
arma_ignore(mem); arma_ignore(mem);
return false; return false;
} }
#endif #endif
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 op_all_meat.hpp   op_all_meat.hpp 
// Copyright (C) 2013 Conrad Sanderson // Copyright (C) 2013-2014 Conrad Sanderson
// Copyright (C) 2013 NICTA (www.nicta.com.au) // Copyright (C) 2013-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup op_all //! \addtogroup op_all
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
skipping to change at line 170 skipping to change at line 170
{ {
const eT1 tmp1 = PA[i]; const eT1 tmp1 = PA[i];
const eT2 tmp2 = PB[i]; const eT2 tmp2 = PB[i];
if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { ++count; } } if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_and >::yes) { if(tmp1 &&
tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_or >::yes) { if(tmp1 ||
tmp2) { ++count; } }
} }
} }
else else
{ {
const uword n_rows = A.get_n_rows(); const uword n_rows = A.get_n_rows();
const uword n_cols = A.get_n_cols(); const uword n_cols = A.get_n_cols();
for(uword col=0; col < n_cols; ++col) for(uword col=0; col < n_cols; ++col)
for(uword row=0; row < n_rows; ++row) for(uword row=0; row < n_rows; ++row)
{ {
const eT1 tmp1 = A.at(row,col); const eT1 tmp1 = A.at(row,col);
const eT2 tmp2 = B.at(row,col); const eT2 tmp2 = B.at(row,col);
if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { ++count; } } if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { ++count; } } else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_and >::yes) { if(tmp1 &&
tmp2) { ++count; } }
else if(is_same_type<glue_type, glue_rel_or >::yes) { if(tmp1 ||
tmp2) { ++count; } }
} }
} }
return (n_elem == count); return (n_elem == count);
} }
template<typename T1> template<typename T1>
inline inline
bool bool
op_all::all_vec(T1& X) op_all::all_vec(T1& X)
 End of changes. 3 change blocks. 
2 lines changed or deleted 10 lines changed or added


 op_any_meat.hpp   op_any_meat.hpp 
skipping to change at line 163 skipping to change at line 163
{ {
const eT1 tmp1 = PA[i]; const eT1 tmp1 = PA[i];
const eT2 tmp2 = PB[i]; const eT2 tmp2 = PB[i];
if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { return true; } } if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_and >::yes) { if(tmp1 &&
tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_or >::yes) { if(tmp1 ||
tmp2) { return true; } }
} }
} }
else else
{ {
const uword n_rows = A.get_n_rows(); const uword n_rows = A.get_n_rows();
const uword n_cols = A.get_n_cols(); const uword n_cols = A.get_n_cols();
for(uword col=0; col < n_cols; ++col) for(uword col=0; col < n_cols; ++col)
for(uword row=0; row < n_rows; ++row) for(uword row=0; row < n_rows; ++row)
{ {
const eT1 tmp1 = A.at(row,col); const eT1 tmp1 = A.at(row,col);
const eT2 tmp2 = B.at(row,col); const eT2 tmp2 = B.at(row,col);
if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { return true; } } if(is_same_type<glue_type, glue_rel_lt >::yes) { if(tmp1 < tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_gt >::yes) { if(tmp1 > tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_lteq >::yes) { if(tmp1 <= tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_gteq >::yes) { if(tmp1 >= tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_eq >::yes) { if(tmp1 == tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { return true; } } else if(is_same_type<glue_type, glue_rel_noteq >::yes) { if(tmp1 != tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_and >::yes) { if(tmp1 &&
tmp2) { return true; } }
else if(is_same_type<glue_type, glue_rel_or >::yes) { if(tmp1 ||
tmp2) { return true; } }
} }
} }
return false; return false;
} }
template<typename T1> template<typename T1>
inline inline
bool bool
op_any::any_vec(T1& X) op_any::any_vec(T1& X)
 End of changes. 2 change blocks. 
0 lines changed or deleted 8 lines changed or added


 op_find_meat.hpp   op_find_meat.hpp 
// Copyright (C) 2010-2013 Conrad Sanderson // Copyright (C) 2010-2014 Conrad Sanderson
// Copyright (C) 2010-2013 NICTA (www.nicta.com.au) // Copyright (C) 2010-2014 NICTA (www.nicta.com.au)
// Copyright (C) 2010 Dimitrios Bouzas // Copyright (C) 2010 Dimitrios Bouzas
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup op_find //! \addtogroup op_find
//! @{ //! @{
template<typename T1> template<typename T1>
skipping to change at line 284 skipping to change at line 284
const eT2 tmp2 = PB[i]; const eT2 tmp2 = PB[i];
bool not_zero; bool not_zero;
if(is_same_type<glue_type, glue_rel_lt >::yes) { not_zero = (t mp1 < tmp2); } if(is_same_type<glue_type, glue_rel_lt >::yes) { not_zero = (t mp1 < tmp2); }
else if(is_same_type<glue_type, glue_rel_gt >::yes) { not_zero = (t mp1 > tmp2); } else if(is_same_type<glue_type, glue_rel_gt >::yes) { not_zero = (t mp1 > tmp2); }
else if(is_same_type<glue_type, glue_rel_lteq >::yes) { not_zero = (t mp1 <= tmp2); } else if(is_same_type<glue_type, glue_rel_lteq >::yes) { not_zero = (t mp1 <= tmp2); }
else if(is_same_type<glue_type, glue_rel_gteq >::yes) { not_zero = (t mp1 >= tmp2); } else if(is_same_type<glue_type, glue_rel_gteq >::yes) { not_zero = (t mp1 >= tmp2); }
else if(is_same_type<glue_type, glue_rel_eq >::yes) { not_zero = (t mp1 == tmp2); } else if(is_same_type<glue_type, glue_rel_eq >::yes) { not_zero = (t mp1 == tmp2); }
else if(is_same_type<glue_type, glue_rel_noteq >::yes) { not_zero = (t mp1 != tmp2); } else if(is_same_type<glue_type, glue_rel_noteq >::yes) { not_zero = (t mp1 != tmp2); }
else if(is_same_type<glue_type, glue_rel_and >::yes) { not_zero = (t
mp1 && tmp2); }
else if(is_same_type<glue_type, glue_rel_or >::yes) { not_zero = (t
mp1 || tmp2); }
else not_zero = false; else not_zero = false;
if(not_zero == true) { indices_mem[n_nz] = i; ++n_nz; } if(not_zero == true) { indices_mem[n_nz] = i; ++n_nz; }
} }
return n_nz; return n_nz;
} }
template<typename T1, typename T2, typename glue_type> template<typename T1, typename T2, typename glue_type>
inline inline
 End of changes. 2 change blocks. 
2 lines changed or deleted 6 lines changed or added


 op_inv_bones.hpp   op_inv_bones.hpp 
// Copyright (C) 2008-2011 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2011 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup op_inv //! \addtogroup op_inv
//! @{ //! @{
//! 'invert matrix' operation (general matrices) //! 'invert matrix' operation (general matrices)
class op_inv class op_inv
{ {
public: public:
template<typename eT> template<typename eT>
inline static void apply(Mat<eT>& out, const Mat<eT>& A, const bool slow = false); inline static void apply(Mat<eT>& out, const Mat<eT>& A, const bool slow = false);
template<typename T1> template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _inv>& in); inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _inv>& in);
template<typename T1> template<typename T1>
inline static void apply_diag(Mat<typename T1::elem_type>& out, const Bas e<typename T1::elem_type, T1>& X); inline static bool apply_diagmat(Mat<typename T1::elem_type>& out, const T1& X);
}; };
//! 'invert matrix' operation (triangular matrices) //! 'invert matrix' operation (triangular matrices)
class op_inv_tr class op_inv_tr
{ {
public: public:
template<typename T1> template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _inv_tr>& in); inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _inv_tr>& in);
}; };
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added


 op_inv_meat.hpp   op_inv_meat.hpp 
// Copyright (C) 2008-2011 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2011 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup op_inv //! \addtogroup op_inv
//! @{ //! @{
//! immediate inverse of a matrix, storing the result in a dense matrix //! immediate inverse of a matrix, storing the result in a dense matrix
template<typename eT> template<typename eT>
skipping to change at line 42 skipping to change at line 42
//! immediate inverse of T1, storing the result in a dense matrix //! immediate inverse of T1, storing the result in a dense matrix
template<typename T1> template<typename T1>
inline inline
void void
op_inv::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv>& X) op_inv::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const strip_diagmat<T1> strip(X.m); const strip_diagmat<T1> strip(X.m);
bool status;
if(strip.do_diagmat == true) if(strip.do_diagmat == true)
{ {
op_inv::apply_diag(out, strip.M); status = op_inv::apply_diagmat(out, strip.M);
} }
else else
{ {
const uword mode = X.aux_uword_a; const uword mode = X.aux_uword_a;
const bool status = (mode == 0) ? auxlib::inv(out, X.m) : auxlib::inv(o status = (mode == 0) ? auxlib::inv(out, X.m) : auxlib::inv(out, X.m, tr
ut, X.m, true); ue);
}
if(status == false) if(status == false)
{ {
out.reset(); out.reset();
arma_bad("inv(): matrix appears to be singular"); arma_bad("inv(): matrix appears to be singular");
}
} }
} }
template<typename T1> template<typename T1>
inline inline
void bool
op_inv::apply_diag(Mat<typename T1::elem_type>& out, const Base<typename T1 op_inv::apply_diagmat(Mat<typename T1::elem_type>& out, const T1& X)
::elem_type, T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const diagmat_proxy_check<T1> A(X.get_ref(), out); const diagmat_proxy<T1> A(X);
const uword N = A.n_elem; const uword N = A.n_elem;
out.set_size(N,N); bool status = true;
for(uword col=0; col<N; ++col) if(A.is_alias(out) == false)
{ {
for(uword row=0; row<col; ++row) { out.at(row,col) = eT(0); } out.zeros(N,N);
for(uword i=0; i<N; ++i)
{
const eT val = A[i];
out.at(col,col) = eT(1) / A[col]; out.at(i,i) = eT(1) / val;
if(val == eT(0)) { status = false; }
}
}
else
{
Mat<eT> tmp(N, N, fill::zeros);
for(uword i=0; i<N; ++i)
{
const eT val = A[i];
tmp.at(i,i) = eT(1) / val;
if(val == eT(0)) { status = false; }
}
for(uword row=col+1; row<N; ++row) { out.at(row,col) = eT(0); } out.steal_mem(tmp);
} }
return status;
} }
//! inverse of T1 (triangular matrices) //! inverse of T1 (triangular matrices)
template<typename T1> template<typename T1>
inline inline
void void
op_inv_tr::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv_tr>& X) op_inv_tr::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv_tr>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
 End of changes. 13 change blocks. 
19 lines changed or deleted 41 lines changed or added


 operator_cube_relational.hpp   operator_cube_relational.hpp 
// Copyright (C) 2009-2010 Conrad Sanderson // Copyright (C) 2009-2014 Conrad Sanderson
// Copyright (C) 2009-2010 NICTA (www.nicta.com.au) // Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup operator_cube_relational //! \addtogroup operator_cube_relational
//! @{ //! @{
// < : lt // < : lt
// > : gt // > : gt
// <= : lteq // <= : lteq
// >= : gteq // >= : gteq
// == : eq // == : eq
// != : noteq // != : noteq
// && : and
// || : or
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
const mtGlueCube<uword, T1, T2, glue_rel_lt> const mtGlueCube<uword, T1, T2, glue_rel_lt>
operator< operator<
(const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T1>& X , const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T2>& Y) (const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T1>& X , const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T2>& Y)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return mtGlueCube<uword, T1, T2, glue_rel_lt>( X.get_ref(), Y.get_ref() ) ; return mtGlueCube<uword, T1, T2, glue_rel_lt>( X.get_ref(), Y.get_ref() ) ;
skipping to change at line 84 skipping to change at line 86
inline inline
const mtGlueCube<uword, T1, T2, glue_rel_noteq> const mtGlueCube<uword, T1, T2, glue_rel_noteq>
operator!= operator!=
(const BaseCube<typename T1::elem_type,T1>& X, const BaseCube<typename T1:: elem_type,T2>& Y) (const BaseCube<typename T1::elem_type,T1>& X, const BaseCube<typename T1:: elem_type,T2>& Y)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return mtGlueCube<uword, T1, T2, glue_rel_noteq>( X.get_ref(), Y.get_ref( ) ); return mtGlueCube<uword, T1, T2, glue_rel_noteq>( X.get_ref(), Y.get_ref( ) );
} }
template<typename T1, typename T2>
inline
const mtGlueCube<uword, T1, T2, glue_rel_and>
operator&&
(const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T1>& X
, const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T2>&
Y)
{
arma_extra_debug_sigprint();
return mtGlueCube<uword, T1, T2, glue_rel_and>( X.get_ref(), Y.get_ref()
);
}
template<typename T1, typename T2>
inline
const mtGlueCube<uword, T1, T2, glue_rel_or>
operator||
(const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T1>& X
, const BaseCube<typename arma_not_cx<typename T1::elem_type>::result,T2>&
Y)
{
arma_extra_debug_sigprint();
return mtGlueCube<uword, T1, T2, glue_rel_or>( X.get_ref(), Y.get_ref() )
;
}
// //
// //
// //
template<typename T1> template<typename T1>
inline inline
const mtOpCube<uword, T1, op_rel_lt_pre> const mtOpCube<uword, T1, op_rel_lt_pre>
operator< operator<
(const typename arma_not_cx<typename T1::elem_type>::result val, const Base Cube<typename arma_not_cx<typename T1::elem_type>::result,T1>& X) (const typename arma_not_cx<typename T1::elem_type>::result val, const Base Cube<typename arma_not_cx<typename T1::elem_type>::result,T1>& X)
{ {
 End of changes. 3 change blocks. 
2 lines changed or deleted 32 lines changed or added


 operator_relational.hpp   operator_relational.hpp 
// Copyright (C) 2009-2012 Conrad Sanderson // Copyright (C) 2009-2014 Conrad Sanderson
// Copyright (C) 2009-2012 NICTA (www.nicta.com.au) // Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup operator_relational //! \addtogroup operator_relational
//! @{ //! @{
// < : lt // < : lt
// > : gt // > : gt
// <= : lteq // <= : lteq
// >= : gteq // >= : gteq
// == : eq // == : eq
// != : noteq // != : noteq
// && : and
// || : or
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
typename typename
enable_if2 enable_if2
< <
(is_arma_type<T1>::value && is_arma_type<T2>::value && (is_cx<typename T1 ::elem_type>::no) && (is_cx<typename T2::elem_type>::no)), (is_arma_type<T1>::value && is_arma_type<T2>::value && (is_cx<typename T1 ::elem_type>::no) && (is_cx<typename T2::elem_type>::no)),
const mtGlue<uword, T1, T2, glue_rel_lt> const mtGlue<uword, T1, T2, glue_rel_lt>
>::result >::result
operator< operator<
skipping to change at line 114 skipping to change at line 116
const mtGlue<uword, T1, T2, glue_rel_noteq> const mtGlue<uword, T1, T2, glue_rel_noteq>
>::result >::result
operator!= operator!=
(const T1& X, const T2& Y) (const T1& X, const T2& Y)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return mtGlue<uword, T1, T2, glue_rel_noteq>( X, Y ); return mtGlue<uword, T1, T2, glue_rel_noteq>( X, Y );
} }
template<typename T1, typename T2>
inline
typename
enable_if2
<
(is_arma_type<T1>::value && is_arma_type<T2>::value && (is_cx<typename T1
::elem_type>::no) && (is_cx<typename T2::elem_type>::no)),
const mtGlue<uword, T1, T2, glue_rel_and>
>::result
operator&&
(const T1& X, const T2& Y)
{
arma_extra_debug_sigprint();
return mtGlue<uword, T1, T2, glue_rel_and>( X, Y );
}
template<typename T1, typename T2>
inline
typename
enable_if2
<
(is_arma_type<T1>::value && is_arma_type<T2>::value && (is_cx<typename T1
::elem_type>::no) && (is_cx<typename T2::elem_type>::no)),
const mtGlue<uword, T1, T2, glue_rel_or>
>::result
operator||
(const T1& X, const T2& Y)
{
arma_extra_debug_sigprint();
return mtGlue<uword, T1, T2, glue_rel_or>( X, Y );
}
// //
// //
// //
template<typename T1> template<typename T1>
inline inline
typename typename
enable_if2 enable_if2
< <
(is_arma_type<T1>::value && (is_cx<typename T1::elem_type>::no)), (is_arma_type<T1>::value && (is_cx<typename T1::elem_type>::no)),
 End of changes. 3 change blocks. 
2 lines changed or deleted 38 lines changed or added


 restrictors.hpp   restrictors.hpp 
skipping to change at line 162 skipping to change at line 162
template<> struct arma_not_op_rel< op_rel_noteq > { }; template<> struct arma_not_op_rel< op_rel_noteq > { };
template<typename T> struct arma_glue_rel_only { }; template<typename T> struct arma_glue_rel_only { };
template<> struct arma_glue_rel_only< glue_rel_lt > { typedef int result ; }; template<> struct arma_glue_rel_only< glue_rel_lt > { typedef int result ; };
template<> struct arma_glue_rel_only< glue_rel_gt > { typedef int result ; }; template<> struct arma_glue_rel_only< glue_rel_gt > { typedef int result ; };
template<> struct arma_glue_rel_only< glue_rel_lteq > { typedef int result ; }; template<> struct arma_glue_rel_only< glue_rel_lteq > { typedef int result ; };
template<> struct arma_glue_rel_only< glue_rel_gteq > { typedef int result ; }; template<> struct arma_glue_rel_only< glue_rel_gteq > { typedef int result ; };
template<> struct arma_glue_rel_only< glue_rel_eq > { typedef int result ; }; template<> struct arma_glue_rel_only< glue_rel_eq > { typedef int result ; };
template<> struct arma_glue_rel_only< glue_rel_noteq > { typedef int result ; }; template<> struct arma_glue_rel_only< glue_rel_noteq > { typedef int result ; };
template<> struct arma_glue_rel_only< glue_rel_and > { typedef int result
; };
template<> struct arma_glue_rel_only< glue_rel_or > { typedef int result
; };
template<typename T> struct arma_Mat_Col_Row_only { }; template<typename T> struct arma_Mat_Col_Row_only { };
template<typename eT> struct arma_Mat_Col_Row_only< Mat<eT> > { typedef Mat <eT> result; }; template<typename eT> struct arma_Mat_Col_Row_only< Mat<eT> > { typedef Mat <eT> result; };
template<typename eT> struct arma_Mat_Col_Row_only< Col<eT> > { typedef Col <eT> result; }; template<typename eT> struct arma_Mat_Col_Row_only< Col<eT> > { typedef Col <eT> result; };
template<typename eT> struct arma_Mat_Col_Row_only< Row<eT> > { typedef Row <eT> result; }; template<typename eT> struct arma_Mat_Col_Row_only< Row<eT> > { typedef Row <eT> result; };
template<typename T> struct arma_Cube_only { }; template<typename T> struct arma_Cube_only { };
template<typename eT> struct arma_Cube_only< Cube<eT> > { typedef Cube<eT> result; }; template<typename eT> struct arma_Cube_only< Cube<eT> > { typedef Cube<eT> result; };
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 spop_htrans_bones.hpp   spop_htrans_bones.hpp 
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_htrans //! \addtogroup spop_htrans
//! @{ //! @{
//! 'hermitian transpose' operation //! hermitian transpose operation for sparse matrices
class spop_htrans class spop_htrans
{ {
public: public:
// handling of sparse matrices
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_htrans>& in, const typename arma_not_cx<typename T1::elem_t ype>::result* junk = 0); arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_htrans>& in, const typename arma_not_cx<typename T1::elem_t ype>::result* junk = 0);
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_htrans>& in, const typename arma_cx_only<typename T1::elem_ type>::result* junk = 0); arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_htrans>& in, const typename arma_cx_only<typename T1::elem_ type>::result* junk = 0);
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added


 spop_htrans_meat.hpp   spop_htrans_meat.hpp 
// Copyright (C) 2012 Ryan Curtin // Copyright (C) 2012-2014 Ryan Curtin
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012-2014 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_htrans //! \addtogroup spop_htrans
//! @{ //! @{
template<typename T1> template<typename T1>
arma_hot arma_hot
inline inline
void void
spop_htrans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_h trans>& in, const typename arma_not_cx<typename T1::elem_type>::result* jun k) spop_htrans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_h trans>& in, const typename arma_not_cx<typename T1::elem_type>::result* jun k)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
spop_strans::apply_proxy(out, in.m); spop_strans::apply(out, in);
} }
template<typename T1> template<typename T1>
arma_hot arma_hot
inline inline
void void
spop_htrans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_h trans>& in, const typename arma_cx_only<typename T1::elem_type>::result* ju nk) spop_htrans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_h trans>& in, const typename arma_cx_only<typename T1::elem_type>::result* ju nk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
typedef typename T1::elem_type eT;
typedef typename umat::elem_type ueT;
const SpProxy<T1> p(in.m); const SpProxy<T1> p(in.m);
if(p.is_alias(out) == false) const uword N = p.get_n_nonzero();
{
out.set_size( p.get_n_cols(), p.get_n_rows() );
out.mem_resize(p.get_n_nonzero()); if(N == uword(0))
{
out.set_size(p.get_n_cols(), p.get_n_rows());
return;
}
typename SpProxy<T1>::const_row_iterator_type it = p.begin_row(); umat locs(2, N);
while(it.pos() < p.get_n_nonzero()) Col<eT> vals(N);
{
access::rw(out.values[it.pos()]) = std::conj(*it);
access::rw(out.row_indices[it.pos()]) = it.col(); // transpose
++access::rw(out.col_ptrs[it.row() + 1]);
++it; eT* vals_ptr = vals.memptr();
}
// Fix column pointers. typename SpProxy<T1>::const_iterator_type it = p.begin();
const uword out_n_cols = out.n_cols;
for(uword c = 1; c <= out_n_cols; ++c) for(uword count = 0; count < N; ++count)
{
access::rw(out.col_ptrs[c]) += out.col_ptrs[c - 1];
}
}
else
{ {
SpMat<typename T1::elem_type> result( p.get_n_cols(), p.get_n_rows() ); ueT* locs_ptr = locs.colptr(count);
result.mem_resize(p.get_n_nonzero()); locs_ptr[0] = it.col();
locs_ptr[1] = it.row();
typename SpProxy<T1>::const_row_iterator_type it = p.begin_row(); vals_ptr[count] = std::conj(*it);
while(it.pos() < p.get_n_nonzero()) ++it;
{ }
access::rw(result.values[it.pos()]) = std::conj(*it);
access::rw(result.row_indices[it.pos()]) = it.col(); // transpose
++access::rw(result.col_ptrs[it.row() + 1]);
++it;
}
// Fix column pointers.
const uword result_n_cols = result.n_cols;
for(uword c = 1; c <= result_n_cols; ++c) SpMat<eT> tmp(locs, vals, p.get_n_cols(), p.get_n_rows());
{
access::rw(result.col_ptrs[c]) += result.col_ptrs[c - 1];
}
out.steal_mem(result); out.steal_mem(tmp);
}
} }
//! @} //! @}
 End of changes. 16 change blocks. 
43 lines changed or deleted 25 lines changed or added


 spop_strans_bones.hpp   spop_strans_bones.hpp 
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012-2014 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_strans //! \addtogroup spop_strans
//! @{ //! @{
//! 'matrix transpose' operation //! simple transpose operation (no complex conjugates) for sparse matrices
class spop_strans class spop_strans
{ {
public: public:
template<typename eT>
arma_hot inline static void apply_spmat(SpMat<eT>& out, const SpMat<eT>&
X);
template<typename T1>
arma_hot inline static void apply_proxy(SpMat<typename T1::elem_type>& ou
t, const T1& X);
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_strans>& in); arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_strans>& in);
template<typename T1> template<typename T1>
arma_hot inline static void apply_proxy(SpMat<typename T1::elem_type>& ou t, const T1& X); arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1,spop_htrans>& in);
}; };
//! @} //! @}
 End of changes. 4 change blocks. 
3 lines changed or deleted 11 lines changed or added


 spop_strans_meat.hpp   spop_strans_meat.hpp 
// Copyright (C) 2012 Ryan Curtin // Copyright (C) 2012-2014 Ryan Curtin
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012-2014 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_strans //! \addtogroup spop_strans
//! @{ //! @{
template<typename eT>
arma_hot
inline
void
spop_strans::apply_spmat(SpMat<eT>& out, const SpMat<eT>& X)
{
arma_extra_debug_sigprint();
typedef typename umat::elem_type ueT;
const uword N = X.n_nonzero;
if(N == uword(0))
{
out.set_size(X.n_cols, X.n_rows);
return;
}
umat locs(2, N);
typename SpMat<eT>::const_iterator it = X.begin();
for(uword count = 0; count < N; ++count)
{
ueT* locs_ptr = locs.colptr(count);
locs_ptr[0] = it.col();
locs_ptr[1] = it.row();
++it;
}
const Col<eT> vals(const_cast<eT*>(X.values), N, false);
SpMat<eT> tmp(locs, vals, X.n_cols, X.n_rows);
out.steal_mem(tmp);
}
template<typename T1> template<typename T1>
arma_hot arma_hot
inline inline
void void
spop_strans::apply_proxy(SpMat<typename T1::elem_type>& out, const T1& X) spop_strans::apply_proxy(SpMat<typename T1::elem_type>& out, const T1& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
typedef typename umat::elem_type ueT;
const SpProxy<T1> p(X); const SpProxy<T1> p(X);
if(p.is_alias(out) == false) const uword N = p.get_n_nonzero();
{
out.set_size( p.get_n_cols(), p.get_n_rows() );
out.mem_resize(p.get_n_nonzero()); if(N == uword(0))
{
out.set_size(p.get_n_cols(), p.get_n_rows());
return;
}
typename SpProxy<T1>::const_row_iterator_type it = p.begin_row(); umat locs(2, N);
while(it.pos() < p.get_n_nonzero()) Col<eT> vals(N);
{
access::rw(out.values[it.pos()]) = (*it);
access::rw(out.row_indices[it.pos()]) = it.col(); // transpose
++access::rw(out.col_ptrs[it.row() + 1]);
++it; eT* vals_ptr = vals.memptr();
}
// Fix column pointers. typename SpProxy<T1>::const_iterator_type it = p.begin();
const uword out_n_cols = out.n_cols;
for(uword c = 1; c <= out_n_cols; ++c) for(uword count = 0; count < N; ++count)
{
access::rw(out.col_ptrs[c]) += out.col_ptrs[c - 1];
}
}
else
{ {
SpMat<typename T1::elem_type> result( p.get_n_cols(), p.get_n_rows() ); ueT* locs_ptr = locs.colptr(count);
result.mem_resize(p.get_n_nonzero()); locs_ptr[0] = it.col();
locs_ptr[1] = it.row();
typename SpProxy<T1>::const_row_iterator_type it = p.begin_row(); vals_ptr[count] = (*it);
while(it.pos() < p.get_n_nonzero()) ++it;
{ }
access::rw(result.values[it.pos()]) = (*it);
access::rw(result.row_indices[it.pos()]) = it.col(); // transpose SpMat<eT> tmp(locs, vals, p.get_n_cols(), p.get_n_rows());
++access::rw(result.col_ptrs[it.row() + 1]);
++it; out.steal_mem(tmp);
} }
// Fix column pointers. template<typename T1>
const uword result_n_cols = result.n_cols; arma_hot
inline
void
spop_strans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_s
trans>& in)
{
arma_extra_debug_sigprint();
for(uword c = 1; c <= result_n_cols; ++c) if(is_SpMat<T1>::value == true)
{ {
access::rw(result.col_ptrs[c]) += result.col_ptrs[c - 1]; const unwrap_spmat<T1> tmp(in.m);
}
out.steal_mem(result); spop_strans::apply_spmat(out, tmp.M);
}
else
{
spop_strans::apply_proxy(out, in.m);
} }
} }
//! for transpose of non-complex matrices, redirected from spop_htrans::app ly()
template<typename T1> template<typename T1>
arma_hot arma_hot
inline inline
void void
spop_strans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_s trans>& in) spop_strans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_h trans>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
spop_strans::apply_proxy(out, in.m); if(is_SpMat<T1>::value == true)
{
const unwrap_spmat<T1> tmp(in.m);
spop_strans::apply_spmat(out, tmp.M);
}
else
{
spop_strans::apply_proxy(out, in.m);
}
} }
//! @} //! @}
 End of changes. 21 change blocks. 
41 lines changed or deleted 93 lines changed or added


 traits.hpp   traits.hpp 
skipping to change at line 1081 skipping to change at line 1081
template<> struct is_glue_mixed_elem<glue_mixed_minus> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_minus> { static const bool value = true; };
template<> struct is_glue_mixed_elem<glue_mixed_div> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_div> { static const bool value = true; };
template<> struct is_glue_mixed_elem<glue_mixed_schur> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_schur> { static const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_lt> { st atic const bool value = true; }; template<> struct is_glue_mixed_elem<glue_rel_lt> { st atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_gt> { st atic const bool value = true; }; template<> struct is_glue_mixed_elem<glue_rel_gt> { st atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_lteq> { st atic const bool value = true; }; template<> struct is_glue_mixed_elem<glue_rel_lteq> { st atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_gteq> { st atic const bool value = true; }; template<> struct is_glue_mixed_elem<glue_rel_gteq> { st atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_eq> { st atic const bool value = true; }; template<> struct is_glue_mixed_elem<glue_rel_eq> { st atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_noteq> { st atic const bool value = true; }; template<> struct is_glue_mixed_elem<glue_rel_noteq> { st atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_and> { st
atic const bool value = true; };
template<> struct is_glue_mixed_elem<glue_rel_or> { st
atic const bool value = true; };
template<typename op_type> struct is_op_mixed_elem { static const bool valu e = false; }; template<typename op_type> struct is_op_mixed_elem { static const bool valu e = false; };
template<> struct is_op_mixed_elem<op_cx_scalar_times> { static const bool value = true; }; template<> struct is_op_mixed_elem<op_cx_scalar_times> { static const bool value = true; };
template<> struct is_op_mixed_elem<op_cx_scalar_plus> { static const bool value = true; }; template<> struct is_op_mixed_elem<op_cx_scalar_plus> { static const bool value = true; };
template<> struct is_op_mixed_elem<op_cx_scalar_minus_pre> { static const bool value = true; }; template<> struct is_op_mixed_elem<op_cx_scalar_minus_pre> { static const bool value = true; };
template<> struct is_op_mixed_elem<op_cx_scalar_minus_post> { static const bool value = true; }; template<> struct is_op_mixed_elem<op_cx_scalar_minus_post> { static const bool value = true; };
template<> struct is_op_mixed_elem<op_cx_scalar_div_pre> { static const bool value = true; }; template<> struct is_op_mixed_elem<op_cx_scalar_div_pre> { static const bool value = true; };
template<> struct is_op_mixed_elem<op_cx_scalar_div_post> { static const bool value = true; }; template<> struct is_op_mixed_elem<op_cx_scalar_div_post> { static const bool value = true; };
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 typedef_elem_check.hpp   typedef_elem_check.hpp 
// Copyright (C) 2008-2013 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup typedef_elem //! \addtogroup typedef_elem
//! @{ //! @{
namespace junk namespace junk
{ {
struct arma_elem_size_test struct arma_elem_size_test
{ {
arma_static_check( (sizeof(size_t) < sizeof(uword)), ERROR___TYPE_SIZE
_T_IS_SMALLER_THAN_UWORD );
arma_static_check( (sizeof(u8) != 1), ERROR___TYPE_U8_HAS_UNSUPPORTED_S IZE ); arma_static_check( (sizeof(u8) != 1), ERROR___TYPE_U8_HAS_UNSUPPORTED_S IZE );
arma_static_check( (sizeof(s8) != 1), ERROR___TYPE_S8_HAS_UNSUPPORTED_S IZE ); arma_static_check( (sizeof(s8) != 1), ERROR___TYPE_S8_HAS_UNSUPPORTED_S IZE );
arma_static_check( (sizeof(u16) != 2), ERROR___TYPE_U16_HAS_UNSUPPORTED _SIZE ); arma_static_check( (sizeof(u16) != 2), ERROR___TYPE_U16_HAS_UNSUPPORTED _SIZE );
arma_static_check( (sizeof(s16) != 2), ERROR___TYPE_S16_HAS_UNSUPPORTED _SIZE ); arma_static_check( (sizeof(s16) != 2), ERROR___TYPE_S16_HAS_UNSUPPORTED _SIZE );
arma_static_check( (sizeof(u32) != 4), ERROR___TYPE_U32_HAS_UNSUPPORTED _SIZE ); arma_static_check( (sizeof(u32) != 4), ERROR___TYPE_U32_HAS_UNSUPPORTED _SIZE );
arma_static_check( (sizeof(s32) != 4), ERROR___TYPE_S32_HAS_UNSUPPORTED _SIZE ); arma_static_check( (sizeof(s32) != 4), ERROR___TYPE_S32_HAS_UNSUPPORTED _SIZE );
#if defined(ARMA_USE_U64S64) #if defined(ARMA_USE_U64S64)
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added


 unwrap.hpp   unwrap.hpp 
// Copyright (C) 2008-2013 Conrad Sanderson // Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup unwrap //! \addtogroup unwrap
//! @{ //! @{
template<typename T1> template<typename T1>
struct unwrap_default struct unwrap_default
skipping to change at line 650 skipping to change at line 650
inline inline
partial_unwrap_default(const T1& A) partial_unwrap_default(const T1& A)
: M(A) : M(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return eT(1); } arma_hot arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = false; static const bool do_times = false;
const Mat<eT> M; const Mat<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_fixed struct partial_unwrap_fixed
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
skipping to change at line 671 skipping to change at line 673
inline explicit inline explicit
partial_unwrap_fixed(const T1& A) partial_unwrap_fixed(const T1& A)
: M(A) : M(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return eT(1); } arma_hot arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = false; static const bool do_times = false;
const T1& M; const T1& M;
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct partial_unwrap_redirect {}; struct partial_unwrap_redirect {};
template<typename T1> template<typename T1>
skipping to change at line 710 skipping to change at line 714
inline inline
partial_unwrap(const Mat<eT>& A) partial_unwrap(const Mat<eT>& A)
: M(A) : M(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(1); } inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return ((&X)
== (&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = false; static const bool do_times = false;
const Mat<eT>& M; const Mat<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< Row<eT> > struct partial_unwrap< Row<eT> >
{ {
typedef Row<eT> stored_type; typedef Row<eT> stored_type;
inline inline
partial_unwrap(const Row<eT>& A) partial_unwrap(const Row<eT>& A)
: M(A) : M(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(1); } inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = false; static const bool do_times = false;
const Row<eT>& M; const Row<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< Col<eT> > struct partial_unwrap< Col<eT> >
{ {
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
inline inline
partial_unwrap(const Col<eT>& A) partial_unwrap(const Col<eT>& A)
: M(A) : M(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(1); } inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = false; static const bool do_times = false;
const Col<eT>& M; const Col<eT>& M;
}; };
// NOTE: we can get away with this shortcut as the partial_unwrap class is
only used by as_scalar(),
// NOTE: which doesn't need to check for aliasing (ie. it doesn't need to c
ompare the address of M with another matrix)
template<typename eT> template<typename eT>
struct partial_unwrap< subview_col<eT> > struct partial_unwrap< subview_col<eT> >
{ {
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
inline inline
partial_unwrap(const subview_col<eT>& A) partial_unwrap(const subview_col<eT>& A)
: M ( const_cast<eT*>( A.colptr(0) ), A.n_rows, false, false ) : orig( A.m )
, M ( const_cast<eT*>( A.colptr(0) ), A.n_rows, false, false )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(1); } inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&orig)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = false; static const bool do_times = false;
const Col<eT> M; const Mat<eT>& orig;
const Col<eT> M;
};
template<typename eT>
struct partial_unwrap< subview_row<eT> >
{
typedef Row<eT> stored_type;
inline
partial_unwrap(const subview_row<eT>& A)
: M(A)
{
arma_extra_debug_sigprint();
}
inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = false;
static const bool do_times = false;
const Row<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_htrans_default struct partial_unwrap_htrans_default
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef Mat<eT> stored_type; typedef Mat<eT> stored_type;
inline inline
partial_unwrap_htrans_default(const Op<T1, op_htrans>& A) partial_unwrap_htrans_default(const Op<T1, op_htrans>& A)
: M(A.m) : M(A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return eT(1); } arma_hot arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = false; static const bool do_times = false;
const Mat<eT> M; const Mat<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_htrans_fixed struct partial_unwrap_htrans_fixed
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
skipping to change at line 814 skipping to change at line 850
inline explicit inline explicit
partial_unwrap_htrans_fixed(const Op<T1, op_htrans>& A) partial_unwrap_htrans_fixed(const Op<T1, op_htrans>& A)
: M(A.m) : M(A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return eT(1); } arma_hot arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = false; static const bool do_times = false;
const T1& M; const T1& M;
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct partial_unwrap_htrans_redirect {}; struct partial_unwrap_htrans_redirect {};
template<typename T1> template<typename T1>
skipping to change at line 852 skipping to change at line 890
inline inline
partial_unwrap(const Op< Mat<eT>, op_htrans>& A) partial_unwrap(const Op< Mat<eT>, op_htrans>& A)
: M(A.m) : M(A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline eT get_val() const { return eT(1); } arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = false; static const bool do_times = false;
const Mat<eT>& M; const Mat<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< Op< Row<eT>, op_htrans> > struct partial_unwrap< Op< Row<eT>, op_htrans> >
{ {
typedef Row<eT> stored_type; typedef Row<eT> stored_type;
inline inline
partial_unwrap(const Op< Row<eT>, op_htrans>& A) partial_unwrap(const Op< Row<eT>, op_htrans>& A)
: M(A.m) : M(A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline eT get_val() const { return eT(1); } arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = false; static const bool do_times = false;
const Row<eT>& M; const Row<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< Op< Col<eT>, op_htrans> > struct partial_unwrap< Op< Col<eT>, op_htrans> >
{ {
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
inline inline
partial_unwrap(const Op< Col<eT>, op_htrans>& A) partial_unwrap(const Op< Col<eT>, op_htrans>& A)
: M(A.m) : M(A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline eT get_val() const { return eT(1); } arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = false; static const bool do_times = false;
const Col<eT>& M; const Col<eT>& M;
}; };
// NOTE: we can get away with this shortcut as the partial_unwrap class is
only used by as_scalar(),
// NOTE: which doesn't need to check for aliasing (ie. it doesn't need to c
ompare the address of M with another matrix)
template<typename eT> template<typename eT>
struct partial_unwrap< Op< subview_col<eT>, op_htrans> > struct partial_unwrap< Op< subview_col<eT>, op_htrans> >
{ {
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
inline inline
partial_unwrap(const Op< subview_col<eT>, op_htrans>& A) partial_unwrap(const Op< subview_col<eT>, op_htrans>& A)
: M ( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, false, false ) : orig( A.m.m )
, M ( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, false, false )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline eT get_val() const { return eT(1); } arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&orig)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = false; static const bool do_times = false;
const Col<eT> M; const Mat<eT>& orig;
const Col<eT> M;
};
template<typename eT>
struct partial_unwrap< Op< subview_row<eT>, op_htrans> >
{
typedef Row<eT> stored_type;
inline
partial_unwrap(const Op< subview_row<eT>, op_htrans>& A)
: M(A.m)
{
arma_extra_debug_sigprint();
}
arma_inline eT get_val() const { return eT(1); }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = true;
static const bool do_times = false;
const Row<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_htrans2_default struct partial_unwrap_htrans2_default
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef Mat<eT> stored_type; typedef Mat<eT> stored_type;
inline inline
partial_unwrap_htrans2_default(const Op<T1, op_htrans2>& A) partial_unwrap_htrans2_default(const Op<T1, op_htrans2>& A)
: val(A.aux) : val(A.aux)
, M (A.m) , M (A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline eT get_val() const { return val; } arma_inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Mat<eT> M; const Mat<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_htrans2_fixed struct partial_unwrap_htrans2_fixed
{ {
skipping to change at line 959 skipping to change at line 1029
inline explicit inline explicit
partial_unwrap_htrans2_fixed(const Op<T1, op_htrans2>& A) partial_unwrap_htrans2_fixed(const Op<T1, op_htrans2>& A)
: val(A.aux) : val(A.aux)
, M (A.m) , M (A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline eT get_val() const { return val; } arma_inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const T1& M; const T1& M;
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct partial_unwrap_htrans2_redirect {}; struct partial_unwrap_htrans2_redirect {};
skipping to change at line 999 skipping to change at line 1071
inline inline
partial_unwrap(const Op< Mat<eT>, op_htrans2>& A) partial_unwrap(const Op< Mat<eT>, op_htrans2>& A)
: val(A.aux) : val(A.aux)
, M (A.m) , M (A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Mat<eT>& M; const Mat<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< Op< Row<eT>, op_htrans2> > struct partial_unwrap< Op< Row<eT>, op_htrans2> >
{ {
skipping to change at line 1021 skipping to change at line 1095
inline inline
partial_unwrap(const Op< Row<eT>, op_htrans2>& A) partial_unwrap(const Op< Row<eT>, op_htrans2>& A)
: val(A.aux) : val(A.aux)
, M (A.m) , M (A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Row<eT>& M; const Row<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< Op< Col<eT>, op_htrans2> > struct partial_unwrap< Op< Col<eT>, op_htrans2> >
{ {
skipping to change at line 1043 skipping to change at line 1119
inline inline
partial_unwrap(const Op< Col<eT>, op_htrans2>& A) partial_unwrap(const Op< Col<eT>, op_htrans2>& A)
: val(A.aux) : val(A.aux)
, M (A.m) , M (A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Col<eT>& M; const Col<eT>& M;
}; };
// NOTE: we can get away with this shortcut as the partial_unwrap class is
only used by as_scalar(),
// NOTE: which doesn't need to check for aliasing (ie. it doesn't need to c
ompare the address of M with another matrix)
template<typename eT> template<typename eT>
struct partial_unwrap< Op< subview_col<eT>, op_htrans2> > struct partial_unwrap< Op< subview_col<eT>, op_htrans2> >
{ {
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
inline inline
partial_unwrap(const Op< subview_col<eT>, op_htrans2>& A) partial_unwrap(const Op< subview_col<eT>, op_htrans2>& A)
: val( A.aux ) : orig( A.m.m )
, M ( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, false, false ) , val ( A.aux )
, M ( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, false, false )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&orig)); }
static const bool do_trans = true; static const bool do_trans = true;
static const bool do_times = true; static const bool do_times = true;
const Mat<eT>& orig;
const eT val; const eT val;
const Col<eT> M; const Col<eT> M;
}; };
template<typename eT>
struct partial_unwrap< Op< subview_row<eT>, op_htrans2> >
{
typedef Row<eT> stored_type;
inline
partial_unwrap(const Op< subview_row<eT>, op_htrans2>& A)
: val(A.aux)
, M (A.m )
{
arma_extra_debug_sigprint();
}
inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = true;
static const bool do_times = true;
const eT val;
const Row<eT> M;
};
template<typename T1> template<typename T1>
struct partial_unwrap_scalar_times_default struct partial_unwrap_scalar_times_default
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef Mat<eT> stored_type; typedef Mat<eT> stored_type;
inline inline
partial_unwrap_scalar_times_default(const eOp<T1, eop_scalar_times>& A) partial_unwrap_scalar_times_default(const eOp<T1, eop_scalar_times>& A)
: val(A.aux) : val(A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return val; } arma_hot arma_inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Mat<eT> M; const Mat<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_scalar_times_fixed struct partial_unwrap_scalar_times_fixed
{ {
skipping to change at line 1113 skipping to change at line 1220
inline explicit inline explicit
partial_unwrap_scalar_times_fixed(const eOp<T1, eop_scalar_times>& A) partial_unwrap_scalar_times_fixed(const eOp<T1, eop_scalar_times>& A)
: val(A.aux) : val(A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return val; } arma_hot arma_inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const T1& M; const T1& M;
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct partial_unwrap_scalar_times_redirect {}; struct partial_unwrap_scalar_times_redirect {};
skipping to change at line 1156 skipping to change at line 1265
inline inline
partial_unwrap(const eOp<Mat<eT>,eop_scalar_times>& A) partial_unwrap(const eOp<Mat<eT>,eop_scalar_times>& A)
: val(A.aux) : val(A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Mat<eT>& M; const Mat<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< eOp<Row<eT>, eop_scalar_times> > struct partial_unwrap< eOp<Row<eT>, eop_scalar_times> >
{ {
skipping to change at line 1178 skipping to change at line 1289
inline inline
partial_unwrap(const eOp<Row<eT>,eop_scalar_times>& A) partial_unwrap(const eOp<Row<eT>,eop_scalar_times>& A)
: val(A.aux) : val(A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Row<eT>& M; const Row<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< eOp<Col<eT>, eop_scalar_times> > struct partial_unwrap< eOp<Col<eT>, eop_scalar_times> >
{ {
skipping to change at line 1200 skipping to change at line 1313
inline inline
partial_unwrap(const eOp<Col<eT>,eop_scalar_times>& A) partial_unwrap(const eOp<Col<eT>,eop_scalar_times>& A)
: val(A.aux) : val(A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return val; } inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const eT val; const eT val;
const Col<eT>& M; const Col<eT>& M;
}; };
// TODO: struct partial_unwrap< eOp<subview_col<eT>, eop_scalar_times> > template<typename eT>
struct partial_unwrap< eOp<subview_col<eT>, eop_scalar_times> >
{
typedef Col<eT> stored_type;
arma_hot inline
partial_unwrap(const eOp<subview_col<eT>,eop_scalar_times>& A)
: orig( A.P.Q.m )
, val ( A.aux )
, M ( const_cast<eT*>( A.P.Q.colptr(0) ), A.P.Q.n_rows, false, false
)
{
arma_extra_debug_sigprint();
}
arma_hot arma_inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&orig)); }
static const bool do_trans = false;
static const bool do_times = true;
const Mat<eT>& orig;
const eT val;
const Col<eT> M;
};
template<typename eT>
struct partial_unwrap< eOp<subview_row<eT>, eop_scalar_times> >
{
typedef Row<eT> stored_type;
arma_hot inline
partial_unwrap(const eOp<subview_row<eT>,eop_scalar_times>& A)
: val(A.aux)
, M (A.P.Q)
{
arma_extra_debug_sigprint();
}
arma_hot arma_inline eT get_val() const { return val; }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = false;
static const bool do_times = true;
const eT val;
const Row<eT> M;
};
template<typename T1> template<typename T1>
struct partial_unwrap_neg_default struct partial_unwrap_neg_default
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef Mat<eT> stored_type; typedef Mat<eT> stored_type;
inline inline
partial_unwrap_neg_default(const eOp<T1, eop_neg>& A) partial_unwrap_neg_default(const eOp<T1, eop_neg>& A)
: M(A.P.Q) : M(A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return eT(-1); } arma_hot arma_inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const Mat<eT> M; const Mat<eT> M;
}; };
template<typename T1> template<typename T1>
struct partial_unwrap_neg_fixed struct partial_unwrap_neg_fixed
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
skipping to change at line 1245 skipping to change at line 1411
inline explicit inline explicit
partial_unwrap_neg_fixed(const eOp<T1, eop_neg>& A) partial_unwrap_neg_fixed(const eOp<T1, eop_neg>& A)
: M(A.P.Q) : M(A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_hot arma_inline eT get_val() const { return eT(-1); } arma_hot arma_inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const T1& M; const T1& M;
}; };
template<typename T1, bool condition> template<typename T1, bool condition>
struct partial_unwrap_neg_redirect {}; struct partial_unwrap_neg_redirect {};
template<typename T1> template<typename T1>
skipping to change at line 1286 skipping to change at line 1454
inline inline
partial_unwrap(const eOp<Mat<eT>,eop_neg>& A) partial_unwrap(const eOp<Mat<eT>,eop_neg>& A)
: M(A.P.Q) : M(A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(-1); } inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const Mat<eT>& M; const Mat<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< eOp<Row<eT>, eop_neg> > struct partial_unwrap< eOp<Row<eT>, eop_neg> >
{ {
typedef Row<eT> stored_type; typedef Row<eT> stored_type;
inline inline
partial_unwrap(const eOp<Row<eT>,eop_neg>& A) partial_unwrap(const eOp<Row<eT>,eop_neg>& A)
: M(A.P.Q) : M(A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(-1); } inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const Row<eT>& M; const Row<eT>& M;
}; };
template<typename eT> template<typename eT>
struct partial_unwrap< eOp<Col<eT>, eop_neg> > struct partial_unwrap< eOp<Col<eT>, eop_neg> >
{ {
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
inline inline
partial_unwrap(const eOp<Col<eT>,eop_neg>& A) partial_unwrap(const eOp<Col<eT>,eop_neg>& A)
: M(A.P.Q) : M(A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
inline eT get_val() const { return eT(-1); } inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&M)); }
static const bool do_trans = false; static const bool do_trans = false;
static const bool do_times = true; static const bool do_times = true;
const Col<eT>& M; const Col<eT>& M;
}; };
// TODO: struct partial_unwrap< eOp<subview_col<eT>, eop_neg> > template<typename eT>
struct partial_unwrap< eOp<subview_col<eT>, eop_neg> >
{
typedef Col<eT> stored_type;
inline
partial_unwrap(const eOp<subview_col<eT>,eop_neg>& A)
: orig( A.P.Q.m )
, M ( const_cast<eT*>( A.P.Q.colptr(0) ), A.P.Q.n_rows, false, false
)
{
arma_extra_debug_sigprint();
}
arma_hot arma_inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>& X) const { return (void
_ptr(&X) == void_ptr(&orig)); }
static const bool do_trans = false;
static const bool do_times = true;
const Mat<eT>& orig;
const Col<eT> M;
};
template<typename eT>
struct partial_unwrap< eOp<subview_row<eT>, eop_neg> >
{
typedef Row<eT> stored_type;
inline
partial_unwrap(const eOp<subview_row<eT>,eop_neg>& A)
: M(A.P.Q)
{
arma_extra_debug_sigprint();
}
arma_hot arma_inline eT get_val() const { return eT(-1); }
arma_hot arma_inline bool is_alias(const Mat<eT>&) const { return false;
}
static const bool do_trans = false;
static const bool do_times = true;
const Row<eT> M;
};
// //
template<typename T1> template<typename T1>
struct partial_unwrap_check_default struct partial_unwrap_check_default
{ {
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef Mat<eT> stored_type; typedef Mat<eT> stored_type;
inline inline
 End of changes. 41 change blocks. 
22 lines changed or deleted 271 lines changed or added

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