max@0
|
1 // Copyright (C) 2010 NICTA (www.nicta.com.au)
|
max@0
|
2 // Copyright (C) 2010 Conrad Sanderson
|
max@0
|
3 //
|
max@0
|
4 // This file is part of the Armadillo C++ library.
|
max@0
|
5 // It is provided without any warranty of fitness
|
max@0
|
6 // for any purpose. You can redistribute this file
|
max@0
|
7 // and/or modify it under the terms of the GNU
|
max@0
|
8 // Lesser General Public License (LGPL) as published
|
max@0
|
9 // by the Free Software Foundation, either version 3
|
max@0
|
10 // of the License or (at your option) any later version.
|
max@0
|
11 // (see http://www.opensource.org/licenses for more info)
|
max@0
|
12
|
max@0
|
13
|
max@0
|
14 //! \addtogroup subview_elem1
|
max@0
|
15 //! @{
|
max@0
|
16
|
max@0
|
17
|
max@0
|
18
|
max@0
|
19 template<typename eT, typename T1>
|
max@0
|
20 class subview_elem1 : public Base<eT, subview_elem1<eT,T1> >
|
max@0
|
21 {
|
max@0
|
22 public: arma_aligned const Mat<eT>& m;
|
max@0
|
23 protected: arma_aligned Mat<eT>* m_ptr;
|
max@0
|
24
|
max@0
|
25 public:
|
max@0
|
26
|
max@0
|
27 typedef eT elem_type;
|
max@0
|
28 typedef typename get_pod_type<elem_type>::result pod_type;
|
max@0
|
29
|
max@0
|
30 arma_aligned const Base<uword,T1>& a;
|
max@0
|
31
|
max@0
|
32
|
max@0
|
33 protected:
|
max@0
|
34
|
max@0
|
35 arma_inline subview_elem1(const Mat<eT>& in_m, const Base<uword,T1>& in_a);
|
max@0
|
36 arma_inline subview_elem1( Mat<eT>& in_m, const Base<uword,T1>& in_a);
|
max@0
|
37
|
max@0
|
38
|
max@0
|
39 public:
|
max@0
|
40
|
max@0
|
41 inline ~subview_elem1();
|
max@0
|
42
|
max@0
|
43 template<typename op_type> inline void inplace_op(const eT val);
|
max@0
|
44 template<typename op_type, typename T2> inline void inplace_op(const subview_elem1<eT,T2>& x );
|
max@0
|
45 template<typename op_type, typename T2> inline void inplace_op(const Base<eT,T2>& x );
|
max@0
|
46
|
max@0
|
47 inline void fill(const eT val);
|
max@0
|
48 inline void zeros();
|
max@0
|
49 inline void ones();
|
max@0
|
50
|
max@0
|
51 inline void operator+= (const eT val);
|
max@0
|
52 inline void operator-= (const eT val);
|
max@0
|
53 inline void operator*= (const eT val);
|
max@0
|
54 inline void operator/= (const eT val);
|
max@0
|
55
|
max@0
|
56
|
max@0
|
57 // deliberately returning void
|
max@0
|
58 template<typename T2> inline void operator_equ(const subview_elem1<eT,T2>& x);
|
max@0
|
59 template<typename T2> inline void operator= (const subview_elem1<eT,T2>& x);
|
max@0
|
60 inline void operator= (const subview_elem1<eT,T1>& x);
|
max@0
|
61 template<typename T2> inline void operator+= (const subview_elem1<eT,T2>& x);
|
max@0
|
62 template<typename T2> inline void operator-= (const subview_elem1<eT,T2>& x);
|
max@0
|
63 template<typename T2> inline void operator%= (const subview_elem1<eT,T2>& x);
|
max@0
|
64 template<typename T2> inline void operator/= (const subview_elem1<eT,T2>& x);
|
max@0
|
65
|
max@0
|
66 template<typename T2> inline void operator= (const Base<eT,T2>& x);
|
max@0
|
67 template<typename T2> inline void operator+= (const Base<eT,T2>& x);
|
max@0
|
68 template<typename T2> inline void operator-= (const Base<eT,T2>& x);
|
max@0
|
69 template<typename T2> inline void operator%= (const Base<eT,T2>& x);
|
max@0
|
70 template<typename T2> inline void operator/= (const Base<eT,T2>& x);
|
max@0
|
71
|
max@0
|
72 inline static void extract(Mat<eT>& out, const subview_elem1& in);
|
max@0
|
73
|
max@0
|
74 template<typename op_type> inline static void mat_inplace_op(Mat<eT>& out, const subview_elem1& in);
|
max@0
|
75
|
max@0
|
76 inline static void plus_inplace(Mat<eT>& out, const subview_elem1& in);
|
max@0
|
77 inline static void minus_inplace(Mat<eT>& out, const subview_elem1& in);
|
max@0
|
78 inline static void schur_inplace(Mat<eT>& out, const subview_elem1& in);
|
max@0
|
79 inline static void div_inplace(Mat<eT>& out, const subview_elem1& in);
|
max@0
|
80
|
max@0
|
81
|
max@0
|
82
|
max@0
|
83 private:
|
max@0
|
84
|
max@0
|
85 friend class Mat<eT>;
|
max@0
|
86 subview_elem1();
|
max@0
|
87 };
|
max@0
|
88
|
max@0
|
89
|
max@0
|
90
|
max@0
|
91 class op_subview_elem_equ;
|
max@0
|
92 class op_subview_elem_inplace_plus;
|
max@0
|
93 class op_subview_elem_inplace_minus;
|
max@0
|
94 class op_subview_elem_inplace_schur;
|
max@0
|
95 class op_subview_elem_inplace_div;
|
max@0
|
96
|
max@0
|
97
|
max@0
|
98
|
max@0
|
99 //! @}
|