Chris@49
|
1 // Copyright (C) 2010-2012 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2010-2012 Conrad Sanderson
|
Chris@49
|
3 //
|
Chris@49
|
4 // This Source Code Form is subject to the terms of the Mozilla Public
|
Chris@49
|
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
|
Chris@49
|
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
Chris@49
|
7
|
Chris@49
|
8
|
Chris@49
|
9 //! \addtogroup subview_elem1
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12
|
Chris@49
|
13
|
Chris@49
|
14 template<typename eT, typename T1>
|
Chris@49
|
15 class subview_elem1 : public Base<eT, subview_elem1<eT,T1> >
|
Chris@49
|
16 {
|
Chris@49
|
17 public:
|
Chris@49
|
18
|
Chris@49
|
19 typedef eT elem_type;
|
Chris@49
|
20 typedef typename get_pod_type<elem_type>::result pod_type;
|
Chris@49
|
21
|
Chris@49
|
22 static const bool is_row = false;
|
Chris@49
|
23 static const bool is_col = true;
|
Chris@49
|
24
|
Chris@49
|
25 arma_aligned const Mat<eT>& m;
|
Chris@49
|
26 arma_aligned const Base<uword,T1>& a;
|
Chris@49
|
27
|
Chris@49
|
28
|
Chris@49
|
29 protected:
|
Chris@49
|
30
|
Chris@49
|
31 arma_inline subview_elem1(const Mat<eT>& in_m, const Base<uword,T1>& in_a);
|
Chris@49
|
32
|
Chris@49
|
33
|
Chris@49
|
34 public:
|
Chris@49
|
35
|
Chris@49
|
36 inline ~subview_elem1();
|
Chris@49
|
37
|
Chris@49
|
38 template<typename op_type> inline void inplace_op(const eT val);
|
Chris@49
|
39 template<typename op_type, typename T2> inline void inplace_op(const subview_elem1<eT,T2>& x );
|
Chris@49
|
40 template<typename op_type, typename T2> inline void inplace_op(const Base<eT,T2>& x );
|
Chris@49
|
41
|
Chris@49
|
42 arma_inline const Op<subview_elem1<eT,T1>,op_htrans> t() const;
|
Chris@49
|
43 arma_inline const Op<subview_elem1<eT,T1>,op_htrans> ht() const;
|
Chris@49
|
44 arma_inline const Op<subview_elem1<eT,T1>,op_strans> st() const;
|
Chris@49
|
45
|
Chris@49
|
46 inline void fill(const eT val);
|
Chris@49
|
47 inline void zeros();
|
Chris@49
|
48 inline void ones();
|
Chris@49
|
49
|
Chris@49
|
50 inline void operator+= (const eT val);
|
Chris@49
|
51 inline void operator-= (const eT val);
|
Chris@49
|
52 inline void operator*= (const eT val);
|
Chris@49
|
53 inline void operator/= (const eT val);
|
Chris@49
|
54
|
Chris@49
|
55
|
Chris@49
|
56 // deliberately returning void
|
Chris@49
|
57 template<typename T2> inline void operator_equ(const subview_elem1<eT,T2>& x);
|
Chris@49
|
58 template<typename T2> inline void operator= (const subview_elem1<eT,T2>& x);
|
Chris@49
|
59 inline void operator= (const subview_elem1<eT,T1>& x);
|
Chris@49
|
60 template<typename T2> inline void operator+= (const subview_elem1<eT,T2>& x);
|
Chris@49
|
61 template<typename T2> inline void operator-= (const subview_elem1<eT,T2>& x);
|
Chris@49
|
62 template<typename T2> inline void operator%= (const subview_elem1<eT,T2>& x);
|
Chris@49
|
63 template<typename T2> inline void operator/= (const subview_elem1<eT,T2>& x);
|
Chris@49
|
64
|
Chris@49
|
65 template<typename T2> inline void operator= (const Base<eT,T2>& x);
|
Chris@49
|
66 template<typename T2> inline void operator+= (const Base<eT,T2>& x);
|
Chris@49
|
67 template<typename T2> inline void operator-= (const Base<eT,T2>& x);
|
Chris@49
|
68 template<typename T2> inline void operator%= (const Base<eT,T2>& x);
|
Chris@49
|
69 template<typename T2> inline void operator/= (const Base<eT,T2>& x);
|
Chris@49
|
70
|
Chris@49
|
71 inline static void extract(Mat<eT>& out, const subview_elem1& in);
|
Chris@49
|
72
|
Chris@49
|
73 template<typename op_type> inline static void mat_inplace_op(Mat<eT>& out, const subview_elem1& in);
|
Chris@49
|
74
|
Chris@49
|
75 inline static void plus_inplace(Mat<eT>& out, const subview_elem1& in);
|
Chris@49
|
76 inline static void minus_inplace(Mat<eT>& out, const subview_elem1& in);
|
Chris@49
|
77 inline static void schur_inplace(Mat<eT>& out, const subview_elem1& in);
|
Chris@49
|
78 inline static void div_inplace(Mat<eT>& out, const subview_elem1& in);
|
Chris@49
|
79
|
Chris@49
|
80
|
Chris@49
|
81
|
Chris@49
|
82 private:
|
Chris@49
|
83
|
Chris@49
|
84 friend class Mat<eT>;
|
Chris@49
|
85 subview_elem1();
|
Chris@49
|
86 };
|
Chris@49
|
87
|
Chris@49
|
88
|
Chris@49
|
89
|
Chris@49
|
90 //! @}
|