Rcpp Version 1.1.2
Loading...
Searching...
No Matches
plus.h
Go to the documentation of this file.
1// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
2//
3// plus.h: Rcpp R/C++ interface class library -- operator+
4//
5// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
6// Copyright (C) 2026 Dirk Eddelbuettel, Romain Francois and IƱaki Ucar
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__plus_h
24#define Rcpp__sugar__plus_h
25
26namespace Rcpp{
27namespace sugar{
28
29 template <int RTYPE, bool LHS_NA, typename LHS_T, bool RHS_NA, typename RHS_T >
30 class Plus_Vector_Vector : public Rcpp::VectorBase<RTYPE, true , Plus_Vector_Vector<RTYPE,LHS_NA,LHS_T,RHS_NA,RHS_T> > {
31 public:
35
38
39 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
40 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()) {}
41
42 inline STORAGE operator[]( R_xlen_t i ) const {
43 STORAGE lhs_ = lhs[i] ;
44 if( traits::is_na<RTYPE>(lhs_) ) return lhs_ ;
45 STORAGE rhs_ = rhs[i] ;
46 return traits::is_na<RTYPE>(rhs_) ? rhs_ : RCPP_SAFE_ADD(lhs_, rhs_);
47 }
48
49 inline R_xlen_t size() const { return lhs.size() ; }
50
51 private:
52 const LHS_EXT& lhs ;
53 const RHS_EXT& rhs ;
54 } ;
55 // specialization of the above for REALSXP because :
56 // NA_REAL + NA_REAL = NA_REAL
57 // NA_REAL + x = NA_REAL
58 // x + NA_REAL = NA_REAL
59 template <bool LHS_NA, typename LHS_T, bool RHS_NA, typename RHS_T >
60 class Plus_Vector_Vector<REALSXP,LHS_NA,LHS_T,RHS_NA,RHS_T> :
61 public Rcpp::VectorBase<REALSXP, true , Plus_Vector_Vector<REALSXP,LHS_NA,LHS_T,RHS_NA,RHS_T> > {
62 public:
65
68
69 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
70 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()) {}
71
72 inline double operator[]( R_xlen_t i ) const {
73 return lhs[i] + rhs[i] ;
74 }
75
76 inline R_xlen_t size() const { return lhs.size() ; }
77
78 private:
79 const LHS_EXT& lhs ;
80 const RHS_EXT& rhs ;
81 } ;
82
83
84
85
86 // specialization LHS_NA = false
87 template <int RTYPE, typename LHS_T, bool RHS_NA, typename RHS_T >
88 class Plus_Vector_Vector<RTYPE,false,LHS_T,RHS_NA,RHS_T> : public Rcpp::VectorBase<RTYPE,true, Plus_Vector_Vector<RTYPE,false,LHS_T,RHS_NA,RHS_T> > {
89 public:
93
96
97 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
98 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()){}
99
100 inline STORAGE operator[]( R_xlen_t i ) const {
101 STORAGE rhs_ = rhs[i] ;
102 if( traits::is_na<RTYPE>(rhs_) ) return rhs_ ;
103 return lhs[i] + rhs_;
104 }
105
106 inline R_xlen_t size() const { return lhs.size() ; }
107
108 private:
109 const LHS_EXT& lhs ;
110 const RHS_EXT& rhs ;
111 } ;
112 // LHS_NA = false & RTYPE = REALSXP
113 template <typename LHS_T, bool RHS_NA, typename RHS_T >
114 class Plus_Vector_Vector<REALSXP,false,LHS_T,RHS_NA,RHS_T> :
115 public Rcpp::VectorBase<REALSXP,true, Plus_Vector_Vector<REALSXP,false,LHS_T,RHS_NA,RHS_T> > {
116 public:
119
122
123 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
124 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()){}
125
126 inline double operator[]( R_xlen_t i ) const {
127 return lhs[i] + rhs[i] ;
128 }
129
130 inline R_xlen_t size() const { return lhs.size() ; }
131
132 private:
133 const LHS_EXT& lhs ;
134 const RHS_EXT& rhs ;
135 } ;
136
137
138
139 // specialization for RHS_NA = false
140 template <int RTYPE, bool LHS_NA, typename LHS_T, typename RHS_T >
141 class Plus_Vector_Vector<RTYPE,LHS_NA,LHS_T,false,RHS_T> : public Rcpp::VectorBase<RTYPE, true , Plus_Vector_Vector<RTYPE,LHS_NA,LHS_T,false,RHS_T> > {
142 public:
146
149
150 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
151 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()){}
152
153 inline STORAGE operator[]( R_xlen_t i ) const {
154 STORAGE lhs_ = lhs[i] ;
155 if( traits::is_na<RTYPE>(lhs_) ) return lhs_ ;
156 return lhs_ + rhs[i];
157 }
158
159 inline R_xlen_t size() const { return lhs.size() ; }
160
161 private:
162 const LHS_EXT& lhs ;
163 const RHS_EXT& rhs ;
164 } ;
165 // RHS_NA = false, RTYPE = REALSXP
166 template <bool LHS_NA, typename LHS_T, typename RHS_T >
167 class Plus_Vector_Vector<REALSXP,LHS_NA,LHS_T,false,RHS_T> :
168 public Rcpp::VectorBase<REALSXP, true , Plus_Vector_Vector<REALSXP,LHS_NA,LHS_T,false,RHS_T> > {
169 public:
172
175
176 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
177 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()){}
178
179 inline double operator[]( R_xlen_t i ) const {
180 return lhs[i] + rhs[i] ;
181 }
182
183 inline R_xlen_t size() const { return lhs.size() ; }
184
185 private:
186 const LHS_EXT& lhs ;
187 const RHS_EXT& rhs ;
188 } ;
189
190
191
192
193 // specialization for RHS_NA = false and LHS_NA = false
194 template <int RTYPE, typename LHS_T, typename RHS_T >
195 class Plus_Vector_Vector<RTYPE,false,LHS_T,false,RHS_T> : public Rcpp::VectorBase<RTYPE, false , Plus_Vector_Vector<RTYPE,false,LHS_T,false,RHS_T> > {
196 public:
200
203
204 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
205 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()){}
206
207 inline STORAGE operator[]( R_xlen_t i ) const {
208 return lhs[i] + rhs[i];
209 }
210
211 inline R_xlen_t size() const { return lhs.size() ; }
212
213 private:
214 const LHS_EXT& lhs ;
215 const RHS_EXT& rhs ;
216 } ;
217 // specialization for RHS_NA = false and LHS_NA = false, RTYPE = REALSXP
218 template <typename LHS_T, typename RHS_T >
219 class Plus_Vector_Vector<REALSXP,false,LHS_T,false,RHS_T> :
220 public Rcpp::VectorBase<REALSXP, false , Plus_Vector_Vector<REALSXP,false,LHS_T,false,RHS_T> > {
221 public:
224
227
228 Plus_Vector_Vector( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
229 lhs(lhs_.get_ref()), rhs(rhs_.get_ref()){}
230
231 inline double operator[]( R_xlen_t i ) const {
232 return lhs[i] + rhs[i] ;
233 }
234
235 inline R_xlen_t size() const { return lhs.size() ; }
236
237 private:
238 const LHS_EXT& lhs ;
239 const RHS_EXT& rhs ;
240 } ;
241
242
243
244
245
246
247
248 template <int RTYPE, bool NA, typename T>
250 public Rcpp::VectorBase<RTYPE,true, Plus_Vector_Primitive<RTYPE,NA,T> > {
251 public:
255
257 lhs(lhs_.get_ref()), rhs(rhs_), rhs_na( Rcpp::traits::is_na<RTYPE>(rhs_) )
258 {}
259
260 inline STORAGE operator[]( R_xlen_t i ) const {
261 if( rhs_na ) return rhs ;
262 STORAGE x = lhs[i] ;
263 return Rcpp::traits::is_na<RTYPE>(x) ? x : RCPP_SAFE_ADD(x, rhs);
264 }
265
266 inline R_xlen_t size() const { return lhs.size() ; }
267
268 private:
269 const EXT& lhs ;
271 bool rhs_na ;
272
273 } ;
274 // RTYPE = REALSXP
275 template <bool NA, typename T>
276 class Plus_Vector_Primitive<REALSXP,NA,T> :
277 public Rcpp::VectorBase<REALSXP,true, Plus_Vector_Primitive<REALSXP,NA,T> > {
278 public:
281
282 Plus_Vector_Primitive( const VEC_TYPE& lhs_, double rhs_ ) :
283 lhs(lhs_.get_ref()), rhs(rhs_)
284 {}
285
286 inline double operator[]( R_xlen_t i ) const {
287 return rhs + lhs[i] ;
288 }
289
290 inline R_xlen_t size() const { return lhs.size() ; }
291
292 private:
293 const EXT& lhs ;
294 double rhs ;
295 } ;
296
297
298
299 template <int RTYPE, typename T>
300 class Plus_Vector_Primitive<RTYPE,false,T> : public Rcpp::VectorBase<RTYPE,false, Plus_Vector_Primitive<RTYPE,false,T> > {
301 public:
304
306
308 lhs(lhs_.get_ref()), rhs(rhs_), rhs_na( Rcpp::traits::is_na<RTYPE>(rhs_) ) {}
309
310 inline STORAGE operator[]( R_xlen_t i ) const {
311 return rhs_na ? rhs : (rhs + lhs[i]);
312 }
313
314 inline R_xlen_t size() const { return lhs.size() ; }
315
316 private:
317 const EXT& lhs ;
319 bool rhs_na ;
320 } ;
321 // RTYPE = REALSXP
322 template <typename T>
323 class Plus_Vector_Primitive<REALSXP,false,T> :
324 public Rcpp::VectorBase<REALSXP,false, Plus_Vector_Primitive<REALSXP,false,T> > {
325 public:
327
329
330 Plus_Vector_Primitive( const VEC_TYPE& lhs_, double rhs_ ) :
331 lhs(lhs_.get_ref()), rhs(rhs_) {}
332
333 inline double operator[]( R_xlen_t i ) const {
334 return rhs + lhs[i] ;
335 }
336
337 inline R_xlen_t size() const { return lhs.size() ; }
338
339 private:
340 const EXT& lhs ;
341 double rhs ;
342 } ;
343
344
345
346
347
348
349 // Vector * nona(primitive)
350 template <int RTYPE, bool NA, typename T>
351 class Plus_Vector_Primitive_nona : public Rcpp::VectorBase<RTYPE,true, Plus_Vector_Primitive_nona<RTYPE,NA,T> > {
352 public:
356
358 lhs(lhs_.get_ref()), rhs(rhs_)
359 {}
360
361 inline STORAGE operator[]( R_xlen_t i ) const {
362 STORAGE x = lhs[i] ;
363 return Rcpp::traits::is_na<RTYPE>(x) ? x : x + rhs;
364 }
365
366 inline R_xlen_t size() const { return lhs.size() ; }
367
368 private:
369 const EXT& lhs ;
371
372 } ;
373 template <bool NA, typename T>
375 public Rcpp::VectorBase<REALSXP,true, Plus_Vector_Primitive_nona<REALSXP,NA,T> > {
376 public:
379
380 Plus_Vector_Primitive_nona( const VEC_TYPE& lhs_, double rhs_ ) :
381 lhs(lhs_.get_ref()), rhs(rhs_)
382 {}
383
384 inline double operator[]( R_xlen_t i ) const {
385 return rhs + lhs[i] ;
386 }
387
388 inline R_xlen_t size() const { return lhs.size() ; }
389
390 private:
391 const EXT& lhs ;
392 double rhs ;
393
394 } ;
395
396
397
398 template <int RTYPE, typename T>
399 class Plus_Vector_Primitive_nona<RTYPE,false,T> : public Rcpp::VectorBase<RTYPE,false, Plus_Vector_Primitive_nona<RTYPE,false,T> > {
400 public:
403
405
407 lhs(lhs_.get_ref()), rhs(rhs_) {}
408
409 inline STORAGE operator[]( R_xlen_t i ) const {
410 return rhs + lhs[i];
411 }
412
413 inline R_xlen_t size() const { return lhs.size() ; }
414
415 private:
416 const EXT& lhs ;
418
419 } ;
420 // RTYPE = REALSXP
421 template <typename T>
422 class Plus_Vector_Primitive_nona<REALSXP,false,T> :
423 public Rcpp::VectorBase<REALSXP,false, Plus_Vector_Primitive_nona<REALSXP,false,T> > {
424 public:
427
428 Plus_Vector_Primitive_nona( const VEC_TYPE& lhs_, double rhs_ ) :
429 lhs(lhs_.get_ref()), rhs(rhs_) {}
430
431 inline double operator[]( R_xlen_t i ) const {
432 return rhs + lhs[i] ;
433 }
434
435 inline R_xlen_t size() const { return lhs.size() ; }
436
437 private:
438 const EXT& lhs ;
439 double rhs ;
440
441 } ;
442
443}
444
445
446template <int RTYPE,bool NA, typename T, typename U>
449 const VectorBase<RTYPE,NA,T>& lhs,
450 const U &rhs
451) {
453}
454
455
456template <int RTYPE,bool NA, typename T, typename U>
457inline typename traits::enable_if<traits::is_convertible<typename traits::remove_const_and_reference<U>::type, typename traits::storage_type<RTYPE>::type>::value, typename sugar::Plus_Vector_Primitive< RTYPE , NA , T> >::type
459 const U &rhs,
460 const VectorBase<RTYPE,NA,T>& lhs
461) {
463}
464
465
466
467template <int RTYPE,bool NA, typename T, typename U>
468inline typename traits::enable_if<traits::is_convertible<typename traits::remove_const_and_reference<U>::type, typename traits::storage_type<RTYPE>::type>::value, sugar::Plus_Vector_Primitive_nona<RTYPE,NA,T> >::type
470 const VectorBase<RTYPE,NA,T>& lhs,
471 const typename sugar::NonaPrimitive< U > &rhs
472) {
474}
475
476template <int RTYPE,bool NA, typename T, typename U>
477inline typename traits::enable_if<traits::is_convertible<typename traits::remove_const_and_reference<U>::type, typename traits::storage_type<RTYPE>::type>::value, sugar::Plus_Vector_Primitive_nona< RTYPE , NA , T> >::type
479 const typename sugar::NonaPrimitive< U > &rhs,
480 const VectorBase<RTYPE,NA,T>& lhs
481) {
483}
484
485
486template <int RTYPE,bool LHS_NA, typename LHS_T, bool RHS_NA, typename RHS_T>
487inline sugar::Plus_Vector_Vector<
488 RTYPE ,
489 LHS_NA, LHS_T,
490 RHS_NA, RHS_T
491 >
495) {
497 RTYPE,
498 LHS_NA, LHS_T,
499 RHS_NA, RHS_T
500 >( lhs, rhs ) ;
501}
502
503}
504
505#endif
Plus_Vector_Vector< RTYPE, LHS_NA, LHS_T, RHS_NA, RHS_T > & get_ref()
Definition VectorBase.h:37
Plus_Vector_Primitive(const VEC_TYPE &lhs_, double rhs_)
Definition plus.h:282
Rcpp::traits::Extractor< REALSXP, NA, T >::type EXT
Definition plus.h:280
Rcpp::VectorBase< REALSXP, NA, T > VEC_TYPE
Definition plus.h:279
Plus_Vector_Primitive(const VEC_TYPE &lhs_, double rhs_)
Definition plus.h:330
Rcpp::VectorBase< REALSXP, false, T > VEC_TYPE
Definition plus.h:326
Rcpp::traits::Extractor< REALSXP, false, T >::type EXT
Definition plus.h:328
Plus_Vector_Primitive(const VEC_TYPE &lhs_, STORAGE rhs_)
Definition plus.h:307
traits::storage_type< RTYPE >::type STORAGE
Definition plus.h:303
Rcpp::VectorBase< RTYPE, false, T > VEC_TYPE
Definition plus.h:302
Rcpp::traits::Extractor< RTYPE, false, T >::type EXT
Definition plus.h:305
Rcpp::VectorBase< REALSXP, NA, T > VEC_TYPE
Definition plus.h:377
Plus_Vector_Primitive_nona(const VEC_TYPE &lhs_, double rhs_)
Definition plus.h:380
Rcpp::traits::Extractor< REALSXP, NA, T >::type EXT
Definition plus.h:378
Rcpp::VectorBase< REALSXP, false, T > VEC_TYPE
Definition plus.h:425
Rcpp::traits::Extractor< REALSXP, false, T >::type EXT
Definition plus.h:426
Plus_Vector_Primitive_nona(const VEC_TYPE &lhs_, double rhs_)
Definition plus.h:428
Plus_Vector_Primitive_nona(const VEC_TYPE &lhs_, STORAGE rhs_)
Definition plus.h:406
Rcpp::traits::Extractor< RTYPE, false, T >::type EXT
Definition plus.h:404
traits::storage_type< RTYPE >::type STORAGE
Definition plus.h:402
Rcpp::VectorBase< RTYPE, false, T > VEC_TYPE
Definition plus.h:401
STORAGE operator[](R_xlen_t i) const
Definition plus.h:361
Rcpp::traits::Extractor< RTYPE, NA, T >::type EXT
Definition plus.h:355
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Definition plus.h:353
Plus_Vector_Primitive_nona(const VEC_TYPE &lhs_, STORAGE rhs_)
Definition plus.h:357
traits::storage_type< RTYPE >::type STORAGE
Definition plus.h:354
Plus_Vector_Primitive(const VEC_TYPE &lhs_, STORAGE rhs_)
Definition plus.h:256
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Definition plus.h:252
STORAGE operator[](R_xlen_t i) const
Definition plus.h:260
Rcpp::traits::Extractor< RTYPE, NA, T >::type EXT
Definition plus.h:254
traits::storage_type< RTYPE >::type STORAGE
Definition plus.h:253
Rcpp::VectorBase< REALSXP, RHS_NA, RHS_T > RHS_TYPE
Definition plus.h:64
Rcpp::VectorBase< REALSXP, LHS_NA, LHS_T > LHS_TYPE
Definition plus.h:63
Rcpp::traits::Extractor< REALSXP, LHS_NA, LHS_T >::type LHS_EXT
Definition plus.h:66
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:69
Rcpp::traits::Extractor< REALSXP, RHS_NA, RHS_T >::type RHS_EXT
Definition plus.h:67
Rcpp::traits::Extractor< REALSXP, LHS_NA, LHS_T >::type LHS_EXT
Definition plus.h:173
Rcpp::traits::Extractor< REALSXP, false, RHS_T >::type RHS_EXT
Definition plus.h:174
Rcpp::VectorBase< REALSXP, false, RHS_T > RHS_TYPE
Definition plus.h:171
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:176
Rcpp::VectorBase< REALSXP, LHS_NA, LHS_T > LHS_TYPE
Definition plus.h:170
Rcpp::traits::Extractor< REALSXP, RHS_NA, RHS_T >::type RHS_EXT
Definition plus.h:121
Rcpp::VectorBase< REALSXP, false, LHS_T > LHS_TYPE
Definition plus.h:117
Rcpp::traits::Extractor< REALSXP, false, LHS_T >::type LHS_EXT
Definition plus.h:120
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:123
Rcpp::VectorBase< REALSXP, RHS_NA, RHS_T > RHS_TYPE
Definition plus.h:118
Rcpp::traits::Extractor< REALSXP, false, RHS_T >::type RHS_EXT
Definition plus.h:226
Rcpp::traits::Extractor< REALSXP, false, LHS_T >::type LHS_EXT
Definition plus.h:225
Rcpp::VectorBase< REALSXP, false, LHS_T > LHS_TYPE
Definition plus.h:222
Rcpp::VectorBase< REALSXP, false, RHS_T > RHS_TYPE
Definition plus.h:223
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:228
Rcpp::traits::Extractor< RTYPE, false, RHS_T >::type RHS_EXT
Definition plus.h:148
Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
Definition plus.h:144
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
Definition plus.h:147
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:150
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Definition plus.h:95
Rcpp::VectorBase< RTYPE, false, LHS_T > LHS_TYPE
Definition plus.h:91
Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > RHS_TYPE
Definition plus.h:92
Rcpp::traits::Extractor< RTYPE, false, LHS_T >::type LHS_EXT
Definition plus.h:94
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:97
Rcpp::VectorBase< RTYPE, false, LHS_T > LHS_TYPE
Definition plus.h:198
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:204
Rcpp::traits::Extractor< RTYPE, false, LHS_T >::type LHS_EXT
Definition plus.h:201
Rcpp::VectorBase< RTYPE, false, RHS_T > RHS_TYPE
Definition plus.h:199
Rcpp::traits::Extractor< RTYPE, false, RHS_T >::type RHS_EXT
Definition plus.h:202
const LHS_EXT & lhs
Definition plus.h:52
STORAGE operator[](R_xlen_t i) const
Definition plus.h:42
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
Definition plus.h:36
const RHS_EXT & rhs
Definition plus.h:53
traits::storage_type< RTYPE >::type STORAGE
Definition plus.h:32
R_xlen_t size() const
Definition plus.h:49
Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > RHS_TYPE
Definition plus.h:34
Plus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Definition plus.h:39
Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
Definition plus.h:33
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Definition plus.h:37
traits used to dispatch wrap
Definition Date.h:27
bool is_na(typename storage_type< RTYPE >::type)
Definition is_na.h:32
Rcpp API.
Definition algo.h:28
sugar::IsNa< RTYPE, NA, T > is_na(const Rcpp::VectorBase< RTYPE, NA, T > &t)
Definition is_na.h:91
static Na_Proxy NA
Definition Na_Proxy.h:52
Date operator+(const Date &date, int offset)
Definition Date.h:156
#define RCPP_SAFE_ADD(a, b)
Definition safe_math.h:33