Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00016
00017
00019 template<typename eT>
00020 class diagview : public Base<eT, diagview<eT> >
00021 {
00022 public: arma_aligned const Mat<eT>& m;
00023 protected: arma_aligned Mat<eT>* m_ptr;
00024
00025 public:
00026
00027 typedef eT elem_type;
00028 typedef typename get_pod_type<eT>::result pod_type;
00029
00030 const uword row_offset;
00031 const uword col_offset;
00032
00033 const uword n_rows;
00034 const uword n_elem;
00035
00036 static const uword n_cols = 1;
00037
00038
00039 protected:
00040
00041 arma_inline diagview(const Mat<eT>& in_m, const uword in_row_offset, const uword in_col_offset, const uword len);
00042 arma_inline diagview( Mat<eT>& in_m, const uword in_row_offset, const uword in_col_offset, const uword len);
00043
00044
00045 public:
00046
00047 inline ~diagview();
00048
00049 inline void operator=(const diagview& x);
00050
00051 inline void operator+=(const eT val);
00052 inline void operator-=(const eT val);
00053 inline void operator*=(const eT val);
00054 inline void operator/=(const eT val);
00055
00056 template<typename T1> inline void operator= (const Base<eT,T1>& x);
00057 template<typename T1> inline void operator+=(const Base<eT,T1>& x);
00058 template<typename T1> inline void operator-=(const Base<eT,T1>& x);
00059 template<typename T1> inline void operator%=(const Base<eT,T1>& x);
00060 template<typename T1> inline void operator/=(const Base<eT,T1>& x);
00061
00062
00063 arma_inline eT& operator[](const uword i);
00064 arma_inline eT operator[](const uword i) const;
00065
00066 arma_inline eT& at(const uword i);
00067 arma_inline eT at(const uword i) const;
00068
00069 arma_inline eT& operator()(const uword i);
00070 arma_inline eT operator()(const uword i) const;
00071
00072 arma_inline eT& at(const uword in_n_row, const uword in_n_col);
00073 arma_inline eT at(const uword in_n_row, const uword in_n_col) const;
00074
00075 arma_inline eT& operator()(const uword in_n_row, const uword in_n_col);
00076 arma_inline eT operator()(const uword in_n_row, const uword in_n_col) const;
00077
00078
00079 inline void fill(const eT val);
00080 inline void zeros();
00081 inline void ones();
00082
00083 inline static void extract(Mat<eT>& out, const diagview& in);
00084
00085 inline static void plus_inplace(Mat<eT>& out, const diagview& in);
00086 inline static void minus_inplace(Mat<eT>& out, const diagview& in);
00087 inline static void schur_inplace(Mat<eT>& out, const diagview& in);
00088 inline static void div_inplace(Mat<eT>& out, const diagview& in);
00089
00090
00091 private:
00092
00093 friend class Mat<eT>;
00094 friend class subview<eT>;
00095
00096 diagview();
00097
00098 };
00099
00100