subview_field_proto.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 template<typename oT>
00023 class subview_field
00024 {
00025 public: const field<oT>& f;
00026 protected: field<oT>* f_ptr;
00027
00028 public:
00029
00030 typedef oT object_type;
00031
00032 const u32 aux_row1;
00033 const u32 aux_col1;
00034
00035 const u32 aux_row2;
00036 const u32 aux_col2;
00037
00038 const u32 n_rows;
00039 const u32 n_cols;
00040 const u32 n_elem;
00041
00042
00043 protected:
00044
00045 arma_inline subview_field(const field<oT>& in_f, const u32 in_row1, const u32 in_col1, const u32 in_row2, const u32 in_col2);
00046 arma_inline subview_field( field<oT>& in_f, const u32 in_row1, const u32 in_col1, const u32 in_row2, const u32 in_col2);
00047
00048
00049 public:
00050
00051 inline ~subview_field();
00052
00053 inline void operator= (const field<oT>& x);
00054 inline void operator= (const subview_field& x);
00055
00056 arma_inline oT& operator[](const u32 i);
00057 arma_inline const oT& operator[](const u32 i) const;
00058
00059 arma_inline oT& operator()(const u32 i);
00060 arma_inline const oT& operator()(const u32 i) const;
00061
00062 arma_inline oT& at(const u32 row, const u32 col);
00063 arma_inline const oT& at(const u32 row, const u32 col) const;
00064
00065 arma_inline oT& operator()(const u32 row, const u32 col);
00066 arma_inline const oT& operator()(const u32 row, const u32 col) const;
00067
00068 inline bool check_overlap(const subview_field& x) const;
00069
00070 inline static void extract(field<oT>& out, const subview_field& in);
00071
00072
00073 private:
00074
00075 friend class field<oT>;
00076
00077
00078 subview_field();
00079
00080 };
00081
00082
00083