$search
00001 // Copyright (C) 2010 NICTA (www.nicta.com.au) 00002 // Copyright (C) 2010 Conrad Sanderson 00003 // 00004 // This file is part of the Armadillo C++ library. 00005 // It is provided without any warranty of fitness 00006 // for any purpose. You can redistribute this file 00007 // and/or modify it under the terms of the GNU 00008 // Lesser General Public License (LGPL) as published 00009 // by the Free Software Foundation, either version 3 00010 // of the License or (at your option) any later version. 00011 // (see http://www.opensource.org/licenses for more info) 00012 00013 00016 00017 00018 00019 template<typename eT, typename T1> 00020 class subview_elem1 : public Base<eT, subview_elem1<eT,T1> > 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<elem_type>::result pod_type; 00029 00030 arma_aligned const Base<uword,T1>& a; 00031 00032 00033 protected: 00034 00035 arma_inline subview_elem1(const Mat<eT>& in_m, const Base<uword,T1>& in_a); 00036 arma_inline subview_elem1( Mat<eT>& in_m, const Base<uword,T1>& in_a); 00037 00038 00039 public: 00040 00041 inline ~subview_elem1(); 00042 00043 template<typename op_type> inline void inplace_op(const eT val); 00044 template<typename op_type, typename T2> inline void inplace_op(const subview_elem1<eT,T2>& x ); 00045 template<typename op_type, typename T2> inline void inplace_op(const Base<eT,T2>& x ); 00046 00047 inline void fill(const eT val); 00048 inline void zeros(); 00049 inline void ones(); 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 00057 // deliberately returning void 00058 template<typename T2> inline void operator_equ(const subview_elem1<eT,T2>& x); 00059 template<typename T2> inline void operator= (const subview_elem1<eT,T2>& x); 00060 inline void operator= (const subview_elem1<eT,T1>& x); 00061 template<typename T2> inline void operator+= (const subview_elem1<eT,T2>& x); 00062 template<typename T2> inline void operator-= (const subview_elem1<eT,T2>& x); 00063 template<typename T2> inline void operator%= (const subview_elem1<eT,T2>& x); 00064 template<typename T2> inline void operator/= (const subview_elem1<eT,T2>& x); 00065 00066 template<typename T2> inline void operator= (const Base<eT,T2>& x); 00067 template<typename T2> inline void operator+= (const Base<eT,T2>& x); 00068 template<typename T2> inline void operator-= (const Base<eT,T2>& x); 00069 template<typename T2> inline void operator%= (const Base<eT,T2>& x); 00070 template<typename T2> inline void operator/= (const Base<eT,T2>& x); 00071 00072 inline static void extract(Mat<eT>& out, const subview_elem1& in); 00073 00074 template<typename op_type> inline static void mat_inplace_op(Mat<eT>& out, const subview_elem1& in); 00075 00076 inline static void plus_inplace(Mat<eT>& out, const subview_elem1& in); 00077 inline static void minus_inplace(Mat<eT>& out, const subview_elem1& in); 00078 inline static void schur_inplace(Mat<eT>& out, const subview_elem1& in); 00079 inline static void div_inplace(Mat<eT>& out, const subview_elem1& in); 00080 00081 00082 00083 private: 00084 00085 friend class Mat<eT>; 00086 subview_elem1(); 00087 }; 00088 00089 00090 00091 class op_subview_elem_equ; 00092 class op_subview_elem_inplace_plus; 00093 class op_subview_elem_inplace_minus; 00094 class op_subview_elem_inplace_schur; 00095 class op_subview_elem_inplace_div; 00096 00097 00098