operator_plus.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-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 
16 
17 
18 
20 template<typename T1>
23 operator+
25  {
27 
28  return X;
29  }
30 
31 
32 
34 template<typename T1>
37 operator+
38 (const Base<typename T1::elem_type,T1>& X, const typename T1::elem_type k)
39  {
41 
42  return eOp<T1, eop_scalar_plus>(X.get_ref(), k);
43  }
44 
45 
46 
48 template<typename T1>
51 operator+
52 (const typename T1::elem_type k, const Base<typename T1::elem_type,T1>& X)
53  {
55 
56  return eOp<T1, eop_scalar_plus>(X.get_ref(), k); // NOTE: order is swapped
57  }
58 
59 
60 
62 template<typename T1>
65 operator+
66  (
68  const std::complex<typename T1::pod_type>& k
69  )
70  {
72 
73  return mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_plus>('j', X.get_ref(), k);
74  }
75 
76 
77 
79 template<typename T1>
81 const mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_plus>
82 operator+
83  (
84  const std::complex<typename T1::pod_type>& k,
86  )
87  {
89 
90  return mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_plus>('j', X.get_ref(), k); // NOTE: order is swapped
91  }
92 
93 
94 
96 template<typename T1, typename T2>
99 operator+
100  (
103  )
104  {
106 
107  return eGlue<T1, T2, eglue_plus>(X.get_ref(), Y.get_ref());
108  }
109 
110 
111 
113 template<typename T1, typename T2>
114 inline
116 operator+
117  (
120  )
121  {
123 
124  typedef typename T1::elem_type eT1;
125  typedef typename T2::elem_type eT2;
126 
127  typedef typename promote_type<eT1,eT2>::result out_eT;
128 
130 
131  return mtGlue<out_eT, T1, T2, glue_mixed_plus>( X.get_ref(), Y.get_ref() );
132  }
133 
134 
135 
is_promotable< T1, T2 >::result result
static void check()
arma_inline const derived & get_ref() const
Definition: Base_meat.hpp:22
#define arma_extra_debug_sigprint
Definition: debug.hpp:1116
#define arma_inline


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:58