Mercurial > hg > segmenter-vamp-plugin
comparison armadillo-2.4.4/include/armadillo_bits/operator_relational.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) 2009-2010 NICTA (www.nicta.com.au) | |
2 // Copyright (C) 2009-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 operator_relational | |
15 //! @{ | |
16 | |
17 | |
18 // < : lt | |
19 // > : gt | |
20 // <= : lteq | |
21 // >= : gteq | |
22 // == : eq | |
23 // != : noteq | |
24 | |
25 | |
26 | |
27 template<typename T1, typename T2> | |
28 inline | |
29 const mtGlue<uword, T1, T2, glue_rel_lt> | |
30 operator< | |
31 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const Base<typename arma_not_cx<typename T1::elem_type>::result,T2>& Y) | |
32 { | |
33 arma_extra_debug_sigprint(); | |
34 | |
35 return mtGlue<uword, T1, T2, glue_rel_lt>( X.get_ref(), Y.get_ref() ); | |
36 } | |
37 | |
38 | |
39 | |
40 template<typename T1, typename T2> | |
41 inline | |
42 const mtGlue<uword, T1, T2, glue_rel_gt> | |
43 operator> | |
44 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const Base<typename arma_not_cx<typename T1::elem_type>::result,T2>& Y) | |
45 { | |
46 arma_extra_debug_sigprint(); | |
47 | |
48 return mtGlue<uword, T1, T2, glue_rel_gt>( X.get_ref(), Y.get_ref() ); | |
49 } | |
50 | |
51 | |
52 | |
53 template<typename T1, typename T2> | |
54 inline | |
55 const mtGlue<uword, T1, T2, glue_rel_lteq> | |
56 operator<= | |
57 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const Base<typename arma_not_cx<typename T1::elem_type>::result,T2>& Y) | |
58 { | |
59 arma_extra_debug_sigprint(); | |
60 | |
61 return mtGlue<uword, T1, T2, glue_rel_lteq>( X.get_ref(), Y.get_ref() ); | |
62 } | |
63 | |
64 | |
65 | |
66 template<typename T1, typename T2> | |
67 inline | |
68 const mtGlue<uword, T1, T2, glue_rel_gteq> | |
69 operator>= | |
70 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const Base<typename arma_not_cx<typename T1::elem_type>::result,T2>& Y) | |
71 { | |
72 arma_extra_debug_sigprint(); | |
73 | |
74 return mtGlue<uword, T1, T2, glue_rel_gteq>( X.get_ref(), Y.get_ref() ); | |
75 } | |
76 | |
77 | |
78 | |
79 template<typename T1, typename T2> | |
80 inline | |
81 const mtGlue<uword, T1, T2, glue_rel_eq> | |
82 operator== | |
83 (const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T2>& Y) | |
84 { | |
85 arma_extra_debug_sigprint(); | |
86 | |
87 return mtGlue<uword, T1, T2, glue_rel_eq>( X.get_ref(), Y.get_ref() ); | |
88 } | |
89 | |
90 | |
91 | |
92 template<typename T1, typename T2> | |
93 inline | |
94 const mtGlue<uword, T1, T2, glue_rel_noteq> | |
95 operator!= | |
96 (const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T2>& Y) | |
97 { | |
98 arma_extra_debug_sigprint(); | |
99 | |
100 return mtGlue<uword, T1, T2, glue_rel_noteq>( X.get_ref(), Y.get_ref() ); | |
101 } | |
102 | |
103 | |
104 | |
105 // | |
106 // | |
107 // | |
108 | |
109 | |
110 | |
111 template<typename T1> | |
112 inline | |
113 const mtOp<uword, T1, op_rel_lt_pre> | |
114 operator< | |
115 (const typename arma_not_cx<typename T1::elem_type>::result val, const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X) | |
116 { | |
117 arma_extra_debug_sigprint(); | |
118 | |
119 return mtOp<uword, T1, op_rel_lt_pre>(X.get_ref(), val); | |
120 } | |
121 | |
122 | |
123 | |
124 template<typename T1> | |
125 inline | |
126 const mtOp<uword, T1, op_rel_lt_post> | |
127 operator< | |
128 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const typename arma_not_cx<typename T1::elem_type>::result val) | |
129 { | |
130 arma_extra_debug_sigprint(); | |
131 | |
132 return mtOp<uword, T1, op_rel_lt_post>(X.get_ref(), val); | |
133 } | |
134 | |
135 | |
136 | |
137 template<typename T1> | |
138 inline | |
139 const mtOp<uword, T1, op_rel_gt_pre> | |
140 operator> | |
141 (const typename arma_not_cx<typename T1::elem_type>::result val, const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X) | |
142 { | |
143 arma_extra_debug_sigprint(); | |
144 | |
145 return mtOp<uword, T1, op_rel_gt_pre>(X.get_ref(), val); | |
146 } | |
147 | |
148 | |
149 | |
150 template<typename T1> | |
151 inline | |
152 const mtOp<uword, T1, op_rel_gt_post> | |
153 operator> | |
154 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const typename arma_not_cx<typename T1::elem_type>::result val) | |
155 { | |
156 arma_extra_debug_sigprint(); | |
157 | |
158 return mtOp<uword, T1, op_rel_gt_post>(X.get_ref(), val); | |
159 } | |
160 | |
161 | |
162 | |
163 template<typename T1> | |
164 inline | |
165 const mtOp<uword, T1, op_rel_lteq_pre> | |
166 operator<= | |
167 (const typename arma_not_cx<typename T1::elem_type>::result val, const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X) | |
168 { | |
169 arma_extra_debug_sigprint(); | |
170 | |
171 return mtOp<uword, T1, op_rel_lteq_pre>(X.get_ref(), val); | |
172 } | |
173 | |
174 | |
175 | |
176 template<typename T1> | |
177 inline | |
178 const mtOp<uword, T1, op_rel_lteq_post> | |
179 operator<= | |
180 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const typename arma_not_cx<typename T1::elem_type>::result val) | |
181 { | |
182 arma_extra_debug_sigprint(); | |
183 | |
184 return mtOp<uword, T1, op_rel_lteq_post>(X.get_ref(), val); | |
185 } | |
186 | |
187 | |
188 | |
189 template<typename T1> | |
190 inline | |
191 const mtOp<uword, T1, op_rel_gteq_pre> | |
192 operator>= | |
193 (const typename arma_not_cx<typename T1::elem_type>::result val, const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X) | |
194 { | |
195 arma_extra_debug_sigprint(); | |
196 | |
197 return mtOp<uword, T1, op_rel_gteq_pre>(X.get_ref(), val); | |
198 } | |
199 | |
200 | |
201 | |
202 template<typename T1> | |
203 inline | |
204 const mtOp<uword, T1, op_rel_gteq_post> | |
205 operator>= | |
206 (const Base<typename arma_not_cx<typename T1::elem_type>::result,T1>& X, const typename arma_not_cx<typename T1::elem_type>::result val) | |
207 { | |
208 arma_extra_debug_sigprint(); | |
209 | |
210 return mtOp<uword, T1, op_rel_gteq_post>(X.get_ref(), val); | |
211 } | |
212 | |
213 | |
214 | |
215 template<typename T1> | |
216 inline | |
217 const mtOp<uword, T1, op_rel_eq> | |
218 operator== | |
219 (const typename T1::elem_type val, const Base<typename T1::elem_type,T1>& X) | |
220 { | |
221 arma_extra_debug_sigprint(); | |
222 | |
223 return mtOp<uword, T1, op_rel_eq>(X.get_ref(), val); | |
224 } | |
225 | |
226 | |
227 | |
228 template<typename T1> | |
229 inline | |
230 const mtOp<uword, T1, op_rel_eq> | |
231 operator== | |
232 (const Base<typename T1::elem_type,T1>& X, const typename T1::elem_type val) | |
233 { | |
234 arma_extra_debug_sigprint(); | |
235 | |
236 return mtOp<uword, T1, op_rel_eq>(X.get_ref(), val); | |
237 } | |
238 | |
239 | |
240 | |
241 template<typename T1> | |
242 inline | |
243 const mtOp<uword, T1, op_rel_noteq> | |
244 operator!= | |
245 (const typename T1::elem_type val, const Base<typename T1::elem_type,T1>& X) | |
246 { | |
247 arma_extra_debug_sigprint(); | |
248 | |
249 return mtOp<uword, T1, op_rel_noteq>(X.get_ref(), val); | |
250 } | |
251 | |
252 | |
253 | |
254 template<typename T1> | |
255 inline | |
256 const mtOp<uword, T1, op_rel_noteq> | |
257 operator!= | |
258 (const Base<typename T1::elem_type,T1>& X, const typename T1::elem_type val) | |
259 { | |
260 arma_extra_debug_sigprint(); | |
261 | |
262 return mtOp<uword, T1, op_rel_noteq>(X.get_ref(), val); | |
263 } | |
264 | |
265 | |
266 | |
267 //! @} |