Rcpp Version 1.0.14
Loading...
Searching...
No Matches
logical_operators__Vector__primitive.h
Go to the documentation of this file.
1// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2//
3// logical_operators__Vector__primitive.h: Rcpp R/C++ interface class library --
4// logical operators for Vector to primitive comparisons
5//
6// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
7//
8// This file is part of Rcpp.
9//
10// Rcpp is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 2 of the License, or
13// (at your option) any later version.
14//
15// Rcpp is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
22
23#ifndef Rcpp__sugar__logical_operators__Vector__primitive_h
24#define Rcpp__sugar__logical_operators__Vector__primitive_h
25
26/* Vector < primitive */
27template <int RTYPE, bool NA, typename T>
29 RTYPE ,
30 Rcpp::sugar::less<RTYPE>,
31 NA,
32 T
33 >
37 ){
39 RTYPE,
40 Rcpp::sugar::less<RTYPE>,
41 NA,
42 T
43 >(
44 lhs, rhs
45 ) ;
46}
47template <int RTYPE, bool NA, typename T>
49 RTYPE ,
50 Rcpp::sugar::less<RTYPE>,
51 NA,
52 T
53 >
57 ){
59 RTYPE,
60 Rcpp::sugar::less<RTYPE>,
61 NA,
62 T
63 >(
64 lhs, rhs
65 ) ;
66}
67
68
69
70/* Vector > primitive */
71template <int RTYPE, bool NA, typename T>
73 RTYPE ,
74 Rcpp::sugar::greater<RTYPE>,
75 NA,
76 T
77 >
81 ){
83 RTYPE,
84 Rcpp::sugar::greater<RTYPE>,
85 NA,
86 T
87 >(
88 lhs, rhs
89 ) ;
90}
91template <int RTYPE, bool NA, typename T>
93 RTYPE ,
94 Rcpp::sugar::greater<RTYPE>,
95 NA,
96 T
97 >
101 ){
103 RTYPE,
104 Rcpp::sugar::greater<RTYPE>,
105 NA,
106 T
107 >(
108 lhs, rhs
109 ) ;
110}
111
112
113
114/* Vector <= primitive */
115template <int RTYPE, bool NA, typename T>
117 RTYPE ,
118 Rcpp::sugar::less_or_equal<RTYPE>,
119 NA,
120 T
121 >
125 ){
127 RTYPE,
128 Rcpp::sugar::less_or_equal<RTYPE>,
129 NA,
130 T
131 >(
132 lhs, rhs
133 ) ;
134}
135template <int RTYPE, bool NA, typename T>
137 RTYPE ,
138 Rcpp::sugar::less_or_equal<RTYPE>,
139 NA,
140 T
141 >
145 ){
147 RTYPE,
148 Rcpp::sugar::less_or_equal<RTYPE>,
149 NA,
150 T
151 >(
152 lhs, rhs
153 ) ;
154}
155
156
157
158
159/* Vector >= primitive */
160template <int RTYPE, bool NA, typename T>
162 RTYPE ,
163 Rcpp::sugar::greater_or_equal<RTYPE>,
164 NA,
165 T
166 >
170 ){
172 RTYPE,
173 Rcpp::sugar::greater_or_equal<RTYPE>,
174 NA,
175 T
176 >(
177 lhs, rhs
178 ) ;
179}
180template <int RTYPE, bool NA, typename T>
182 RTYPE ,
183 Rcpp::sugar::greater_or_equal<RTYPE>,
184 NA,
185 T
186 >
190 ){
192 RTYPE,
193 Rcpp::sugar::greater_or_equal<RTYPE>,
194 NA,
195 T
196 >(
197 lhs, rhs
198 ) ;
199}
200
201
202
203/* Vector == primitive */
204template <int RTYPE, bool NA, typename T>
206 RTYPE ,
207 Rcpp::sugar::equal<RTYPE>,
208 NA,
209 T
210 >
214 ){
216 RTYPE,
217 Rcpp::sugar::equal<RTYPE>,
218 NA,
219 T
220 >(
221 lhs, rhs
222 ) ;
223}
224template <int RTYPE, bool NA, typename T>
226 RTYPE ,
227 Rcpp::sugar::equal<RTYPE>,
228 NA,
229 T
230 >
234 ){
236 RTYPE,
237 Rcpp::sugar::equal<RTYPE>,
238 NA,
239 T
240 >(
241 lhs, rhs
242 ) ;
243}
244
245
246
247/* Vector != primitive */
248template <int RTYPE, bool NA, typename T>
250 RTYPE ,
251 Rcpp::sugar::not_equal<RTYPE>,
252 NA,
253 T
254 >
258 ){
260 RTYPE,
261 Rcpp::sugar::not_equal<RTYPE>,
262 NA,
263 T
264 >(
265 lhs, rhs
266 ) ;
267}
268template <int RTYPE, bool NA, typename T>
270 RTYPE ,
271 Rcpp::sugar::not_equal<RTYPE>,
272 NA,
273 T
274 >
278 ){
280 RTYPE,
281 Rcpp::sugar::not_equal<RTYPE>,
282 NA,
283 T
284 >(
285 lhs, rhs
286 ) ;
287}
288
289
290#endif
Rcpp::sugar::Comparator_With_One_Value< RTYPE, Rcpp::sugar::not_equal< RTYPE >, NA, T > operator!=(const Rcpp::VectorBase< RTYPE, NA, T > &lhs, typename Rcpp::traits::storage_type< RTYPE >::type rhs)
Rcpp::sugar::Comparator_With_One_Value< RTYPE, Rcpp::sugar::equal< RTYPE >, NA, T > operator==(const Rcpp::VectorBase< RTYPE, NA, T > &lhs, typename Rcpp::traits::storage_type< RTYPE >::type rhs)
Rcpp::sugar::Comparator_With_One_Value< RTYPE, Rcpp::sugar::less< RTYPE >, NA, T > operator<(const Rcpp::VectorBase< RTYPE, NA, T > &lhs, typename Rcpp::traits::storage_type< RTYPE >::type rhs)
Rcpp::sugar::Comparator_With_One_Value< RTYPE, Rcpp::sugar::less_or_equal< RTYPE >, NA, T > operator<=(const Rcpp::VectorBase< RTYPE, NA, T > &lhs, typename Rcpp::traits::storage_type< RTYPE >::type rhs)
Rcpp::sugar::Comparator_With_One_Value< RTYPE, Rcpp::sugar::less_or_equal< RTYPE >, NA, T > operator>=(typename Rcpp::traits::storage_type< RTYPE >::type rhs, const Rcpp::VectorBase< RTYPE, NA, T > &lhs)
Rcpp::sugar::Comparator_With_One_Value< RTYPE, Rcpp::sugar::less< RTYPE >, NA, T > operator>(typename Rcpp::traits::storage_type< RTYPE >::type rhs, const Rcpp::VectorBase< RTYPE, NA, T > &lhs)