// Copyright (C) 2012-2015 National ICT Australia (NICTA) // // 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 // file, You can obtain one at http://mozilla.org/MPL/2.0/. // ------------------------------------------------------------------- // // Written by Conrad Sanderson - http://conradsanderson.id.au //! \addtogroup subview_each //! @{ template class subview_each_common { public: typedef typename parent::elem_type eT; const parent& P; inline void check_size(const Mat& A) const; protected: arma_inline subview_each_common(const parent& in_P); arma_inline const Mat& get_mat_ref_helper(const Mat & X) const; arma_inline const Mat& get_mat_ref_helper(const subview& X) const; arma_inline const Mat& get_mat_ref() const; arma_cold inline const std::string incompat_size_string(const Mat& A) const; private: subview_each_common(); }; template class subview_each1 : public subview_each_common { protected: arma_inline subview_each1(const parent& in_P); public: typedef typename parent::elem_type eT; inline ~subview_each1(); // deliberately returning void template inline void operator= (const Base& x); template inline void operator+= (const Base& x); template inline void operator-= (const Base& x); template inline void operator%= (const Base& x); template inline void operator/= (const Base& x); private: friend class Mat; friend class subview; }; template class subview_each2 : public subview_each_common { protected: inline subview_each2(const parent& in_P, const Base& in_indices); public: const Base& base_indices; typedef typename parent::elem_type eT; inline void check_indices(const Mat& indices) const; inline ~subview_each2(); // deliberately returning void template inline void operator= (const Base& x); template inline void operator+= (const Base& x); template inline void operator-= (const Base& x); template inline void operator%= (const Base& x); template inline void operator/= (const Base& x); private: friend class Mat; friend class subview; }; class subview_each1_aux { public: template static inline Mat operator_plus(const subview_each1& X, const Base& Y); template static inline Mat operator_minus(const subview_each1& X, const Base& Y); template static inline Mat operator_minus(const Base& X, const subview_each1& Y); template static inline Mat operator_schur(const subview_each1& X, const Base& Y); template static inline Mat operator_div(const subview_each1& X,const Base& Y); template static inline Mat operator_div(const Base& X, const subview_each1& Y); }; class subview_each2_aux { public: template static inline Mat operator_plus(const subview_each2& X, const Base& Y); template static inline Mat operator_minus(const subview_each2& X, const Base& Y); template static inline Mat operator_minus(const Base& X, const subview_each2& Y); template static inline Mat operator_schur(const subview_each2& X, const Base& Y); template static inline Mat operator_div(const subview_each2& X, const Base& Y); template static inline Mat operator_div(const Base& X, const subview_each2& Y); }; //! @}