max@0: // Copyright (C) 2008-2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2008-2011 Conrad Sanderson max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: //! \addtogroup subview_field max@0: //! @{ max@0: max@0: max@0: //! Class for storing data required to construct or apply operations to a subfield max@0: //! (i.e. where the subfield starts and ends as well as a reference/pointer to the original field), max@0: template max@0: class subview_field max@0: { max@0: public: const field& f; max@0: protected: field* f_ptr; max@0: max@0: public: max@0: max@0: typedef oT object_type; max@0: max@0: const uword aux_row1; max@0: const uword aux_col1; max@0: max@0: const uword n_rows; max@0: const uword n_cols; max@0: const uword n_elem; max@0: max@0: max@0: protected: max@0: max@0: arma_inline subview_field(const field& in_f, const uword in_row1, const uword in_col1, const uword in_n_rows, const uword in_n_cols); max@0: arma_inline subview_field( field& in_f, const uword in_row1, const uword in_col1, const uword in_n_rows, const uword in_n_cols); max@0: max@0: max@0: public: max@0: max@0: inline ~subview_field(); max@0: max@0: inline void operator= (const field& x); max@0: inline void operator= (const subview_field& x); max@0: max@0: arma_inline oT& operator[](const uword i); max@0: arma_inline const oT& operator[](const uword i) const; max@0: max@0: arma_inline oT& operator()(const uword i); max@0: arma_inline const oT& operator()(const uword i) const; max@0: max@0: arma_inline oT& at(const uword row, const uword col); max@0: arma_inline const oT& at(const uword row, const uword col) const; max@0: max@0: arma_inline oT& operator()(const uword row, const uword col); max@0: arma_inline const oT& operator()(const uword row, const uword col) const; max@0: max@0: inline bool check_overlap(const subview_field& x) const; max@0: max@0: inline static void extract(field& out, const subview_field& in); max@0: max@0: max@0: private: max@0: max@0: friend class field; max@0: max@0: max@0: subview_field(); max@0: //subview_field(const subview_field&); max@0: }; max@0: max@0: max@0: //! @}