comparison armadillo-2.4.4/include/armadillo_bits/subview_elem1_bones.hpp @ 0:8b6102e2a9b0

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