Chris@49
|
1 // Copyright (C) 2012 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 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_elem2
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12
|
Chris@49
|
13
|
Chris@49
|
14 template<typename eT, typename T1, typename T2>
|
Chris@49
|
15 class subview_elem2 : public Base<eT, subview_elem2<eT,T1,T2> >
|
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 = false;
|
Chris@49
|
24
|
Chris@49
|
25 arma_aligned const Mat<eT>& m;
|
Chris@49
|
26
|
Chris@49
|
27 arma_aligned const Base<uword,T1>& base_ri;
|
Chris@49
|
28 arma_aligned const Base<uword,T2>& base_ci;
|
Chris@49
|
29
|
Chris@49
|
30 const bool all_rows;
|
Chris@49
|
31 const bool all_cols;
|
Chris@49
|
32
|
Chris@49
|
33
|
Chris@49
|
34 protected:
|
Chris@49
|
35
|
Chris@49
|
36 arma_inline subview_elem2(const Mat<eT>& in_m, const Base<uword,T1>& in_ri, const Base<uword,T2>& in_ci, const bool in_all_rows, const bool in_all_cols);
|
Chris@49
|
37
|
Chris@49
|
38
|
Chris@49
|
39 public:
|
Chris@49
|
40
|
Chris@49
|
41 inline ~subview_elem2();
|
Chris@49
|
42
|
Chris@49
|
43 template<typename op_type>
|
Chris@49
|
44 inline void inplace_op(const eT val);
|
Chris@49
|
45
|
Chris@49
|
46 template<typename op_type, typename expr>
|
Chris@49
|
47 inline void inplace_op(const Base<eT,expr>& x);
|
Chris@49
|
48
|
Chris@49
|
49 inline void fill(const eT val);
|
Chris@49
|
50 inline void zeros();
|
Chris@49
|
51 inline void ones();
|
Chris@49
|
52
|
Chris@49
|
53 inline void operator+= (const eT val);
|
Chris@49
|
54 inline void operator-= (const eT val);
|
Chris@49
|
55 inline void operator*= (const eT val);
|
Chris@49
|
56 inline void operator/= (const eT val);
|
Chris@49
|
57
|
Chris@49
|
58
|
Chris@49
|
59 // deliberately returning void
|
Chris@49
|
60 template<typename T3, typename T4> inline void operator_equ(const subview_elem2<eT,T3,T4>& x);
|
Chris@49
|
61 template<typename T3, typename T4> inline void operator= (const subview_elem2<eT,T3,T4>& x);
|
Chris@49
|
62 inline void operator= (const subview_elem2<eT,T1,T2>& x);
|
Chris@49
|
63
|
Chris@49
|
64 template<typename T3, typename T4> inline void operator+= (const subview_elem2<eT,T3,T4>& x);
|
Chris@49
|
65 template<typename T3, typename T4> inline void operator-= (const subview_elem2<eT,T3,T4>& x);
|
Chris@49
|
66 template<typename T3, typename T4> inline void operator%= (const subview_elem2<eT,T3,T4>& x);
|
Chris@49
|
67 template<typename T3, typename T4> inline void operator/= (const subview_elem2<eT,T3,T4>& x);
|
Chris@49
|
68
|
Chris@49
|
69 template<typename expr> inline void operator= (const Base<eT,expr>& x);
|
Chris@49
|
70 template<typename expr> inline void operator+= (const Base<eT,expr>& x);
|
Chris@49
|
71 template<typename expr> inline void operator-= (const Base<eT,expr>& x);
|
Chris@49
|
72 template<typename expr> inline void operator%= (const Base<eT,expr>& x);
|
Chris@49
|
73 template<typename expr> inline void operator/= (const Base<eT,expr>& x);
|
Chris@49
|
74
|
Chris@49
|
75 inline static void extract(Mat<eT>& out, const subview_elem2& in);
|
Chris@49
|
76
|
Chris@49
|
77 inline static void plus_inplace(Mat<eT>& out, const subview_elem2& in);
|
Chris@49
|
78 inline static void minus_inplace(Mat<eT>& out, const subview_elem2& in);
|
Chris@49
|
79 inline static void schur_inplace(Mat<eT>& out, const subview_elem2& in);
|
Chris@49
|
80 inline static void div_inplace(Mat<eT>& out, const subview_elem2& in);
|
Chris@49
|
81
|
Chris@49
|
82
|
Chris@49
|
83
|
Chris@49
|
84 private:
|
Chris@49
|
85
|
Chris@49
|
86 friend class Mat<eT>;
|
Chris@49
|
87 subview_elem2();
|
Chris@49
|
88 };
|
Chris@49
|
89
|
Chris@49
|
90
|
Chris@49
|
91
|
Chris@49
|
92 //! @}
|