22 #ifndef Rcpp__sugar__minus_h
23 #define Rcpp__sugar__minus_h
28 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T >
30 public Rcpp::VectorBase<RTYPE,true, Minus_Vector_Vector<RTYPE,LHS_NA,LHS_T,RHS_NA,RHS_T> > {
43 if( Rcpp::traits::is_na<RTYPE>( x ) )
return x ;
45 return Rcpp::traits::is_na<RTYPE>( y ) ? y : ( x - y ) ;
48 inline R_xlen_t
size()
const {
return lhs.size() ; }
55 template <
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T >
57 public Rcpp::VectorBase<REALSXP,true, Minus_Vector_Vector<REALSXP,LHS_NA,LHS_T,RHS_NA,RHS_T> > {
71 inline R_xlen_t
size()
const {
return lhs.size() ; }
79 template <
int RTYPE,
typename LHS_T,
bool RHS_NA,
typename RHS_T >
80 class Minus_Vector_Vector<RTYPE,false,LHS_T,RHS_NA,RHS_T> :
public Rcpp::VectorBase<RTYPE,true, Minus_Vector_Vector<RTYPE,false,LHS_T,RHS_NA,RHS_T> > {
93 if( Rcpp::traits::is_na<RTYPE>( y ) )
return y ;
97 inline R_xlen_t
size()
const {
return lhs.size() ; }
104 template <
typename LHS_T,
bool RHS_NA,
typename RHS_T >
106 public Rcpp::VectorBase<REALSXP,true, Minus_Vector_Vector<REALSXP,false,LHS_T,RHS_NA,RHS_T> > {
120 inline R_xlen_t
size()
const {
return lhs.size() ; }
128 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
typename RHS_T >
129 class Minus_Vector_Vector<RTYPE,LHS_NA,LHS_T,false,RHS_T> :
public Rcpp::VectorBase<RTYPE,true, Minus_Vector_Vector<RTYPE,LHS_NA,LHS_T,false,RHS_T> > {
142 if( Rcpp::traits::is_na<RTYPE>( x ) )
return x ;
146 inline R_xlen_t
size()
const {
return lhs.size() ; }
153 template <
bool LHS_NA,
typename LHS_T,
typename RHS_T >
155 public Rcpp::VectorBase<REALSXP,true, Minus_Vector_Vector<REALSXP,LHS_NA,LHS_T,false,RHS_T> > {
169 inline R_xlen_t
size()
const {
return lhs.size() ; }
177 template <
int RTYPE,
typename LHS_T,
typename RHS_T >
179 public Rcpp::VectorBase<RTYPE,false, Minus_Vector_Vector<RTYPE,false,LHS_T,false,RHS_T> > {
194 inline R_xlen_t
size()
const {
return lhs.size() ; }
200 template <
typename LHS_T,
typename RHS_T >
202 public Rcpp::VectorBase<REALSXP,false, Minus_Vector_Vector<REALSXP,false,LHS_T,false,RHS_T> > {
216 inline R_xlen_t
size()
const {
return lhs.size() ; }
227 template <
int RTYPE,
bool NA,
typename T>
241 return Rcpp::traits::is_na<RTYPE>(x) ? x : (x -
rhs) ;
244 inline R_xlen_t
size()
const {
return lhs.size() ; }
251 template <
bool NA,
typename T>
253 public Rcpp::VectorBase<REALSXP,true, Minus_Vector_Primitive<REALSXP,NA,T> > {
265 inline R_xlen_t
size()
const {
return lhs.size() ; }
273 template <
int RTYPE,
typename T>
275 public Rcpp::VectorBase<RTYPE,true, Minus_Vector_Primitive<RTYPE,false,T> > {
287 return Rcpp::traits::is_na<RTYPE>(x) ? x : (x -
rhs) ;
290 inline R_xlen_t
size()
const {
return lhs.size() ; }
297 template <
typename T>
299 public Rcpp::VectorBase<REALSXP,true, Minus_Vector_Primitive<REALSXP,false,T> > {
311 inline R_xlen_t
size()
const {
return lhs.size() ; }
323 template <
int RTYPE,
bool NA,
typename T>
338 inline R_xlen_t
size()
const {
return rhs.size() ; }
345 template <
bool NA,
typename T>
347 public Rcpp::VectorBase<REALSXP,true, Minus_Primitive_Vector<REALSXP,NA,T> > {
358 inline R_xlen_t
size()
const {
return rhs.size() ; }
367 template <
int RTYPE,
typename T>
369 public Rcpp::VectorBase<RTYPE,true, Minus_Primitive_Vector<RTYPE,false,T> > {
383 inline R_xlen_t
size()
const {
return rhs.size() ; }
391 template <
typename T>
393 public Rcpp::VectorBase<REALSXP,true, Minus_Primitive_Vector<REALSXP,false,T> > {
405 inline R_xlen_t
size()
const {
return rhs.size() ; }
415 template <
int RTYPE,
bool NA,
typename T,
typename U>
425 template <
int RTYPE,
bool NA,
typename T,
typename U>
426 inline typename traits::enable_if<traits::is_convertible<typename traits::remove_const_and_reference<U>::type,
typename traits::storage_type<RTYPE>::type>::value, sugar::Minus_Primitive_Vector< RTYPE , NA,T> >::type
434 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
435 inline sugar::Minus_Vector_Vector<
Minus_Vector_Vector< RTYPE, LHS_NA, LHS_T, RHS_NA, RHS_T > & get_ref()
Minus_Primitive_Vector(double lhs_, const VEC_TYPE &rhs_)
Rcpp::traits::Extractor< REALSXP, NA, T >::type VEC_EXT
Rcpp::VectorBase< REALSXP, NA, T > VEC_TYPE
double operator[](R_xlen_t i) const
double operator[](R_xlen_t i) const
Minus_Primitive_Vector(double lhs_, const VEC_TYPE &rhs_)
Rcpp::VectorBase< REALSXP, false, T > VEC_TYPE
Rcpp::traits::Extractor< REALSXP, false, T >::type VEC_EXT
STORAGE operator[](R_xlen_t i) const
Minus_Primitive_Vector(STORAGE lhs_, const VEC_TYPE &rhs_)
traits::storage_type< RTYPE >::type STORAGE
Rcpp::traits::Extractor< REALSXP, false, T >::type VEC_EXT
Rcpp::VectorBase< RTYPE, false, T > VEC_TYPE
traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
Minus_Primitive_Vector(STORAGE lhs_, const VEC_TYPE &rhs_)
Rcpp::traits::Extractor< RTYPE, NA, T >::type VEC_EXT
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Rcpp::traits::Extractor< REALSXP, NA, T >::type VEC_EXT
Rcpp::VectorBase< REALSXP, NA, T > VEC_TYPE
Minus_Vector_Primitive(const VEC_TYPE &lhs_, double rhs_)
double operator[](R_xlen_t i) const
Rcpp::traits::Extractor< REALSXP, false, T >::type VEC_EXT
double operator[](R_xlen_t i) const
Minus_Vector_Primitive(const VEC_TYPE &lhs_, double rhs_)
Rcpp::VectorBase< REALSXP, false, T > VEC_TYPE
Minus_Vector_Primitive(const VEC_TYPE &lhs_, STORAGE rhs_)
Rcpp::VectorBase< RTYPE, false, T > VEC_TYPE
Rcpp::traits::Extractor< RTYPE, false, T >::type VEC_EXT
traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Minus_Vector_Primitive(const VEC_TYPE &lhs_, STORAGE rhs_)
STORAGE operator[](R_xlen_t i) const
Rcpp::traits::Extractor< RTYPE, NA, T >::type VEC_EXT
traits::storage_type< RTYPE >::type STORAGE
double operator[](R_xlen_t i) const
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< REALSXP, LHS_NA, LHS_T >::type LHS_EXT
Rcpp::VectorBase< REALSXP, RHS_NA, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< REALSXP, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::VectorBase< REALSXP, LHS_NA, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< REALSXP, LHS_NA, LHS_T >::type LHS_EXT
Rcpp::traits::Extractor< REALSXP, false, RHS_T >::type RHS_EXT
double operator[](R_xlen_t i) const
Rcpp::VectorBase< REALSXP, false, RHS_T > RHS_TYPE
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::VectorBase< REALSXP, LHS_NA, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, LHS_T >::type LHS_EXT
Rcpp::VectorBase< REALSXP, RHS_NA, RHS_T > RHS_TYPE
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< REALSXP, RHS_NA, RHS_T >::type RHS_EXT
double operator[](R_xlen_t i) const
Rcpp::VectorBase< REALSXP, false, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, RHS_T >::type RHS_EXT
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
double operator[](R_xlen_t i) const
Rcpp::VectorBase< REALSXP, false, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, LHS_T >::type LHS_EXT
Rcpp::VectorBase< REALSXP, false, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, false, RHS_T >::type RHS_EXT
Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
STORAGE operator[](R_xlen_t i) const
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, false, RHS_T > RHS_TYPE
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > RHS_TYPE
STORAGE operator[](R_xlen_t i) const
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< RTYPE, false, LHS_T >::type LHS_EXT
Rcpp::VectorBase< RTYPE, false, LHS_T > LHS_TYPE
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, false, RHS_T > RHS_TYPE
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE, false, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, false, LHS_T >::type LHS_EXT
Rcpp::traits::Extractor< RTYPE, false, RHS_T >::type RHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Minus_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > RHS_TYPE
STORAGE operator[](R_xlen_t i) const
sugar::IsNa< RTYPE, NA, T > is_na(const Rcpp::VectorBase< RTYPE, NA, T > &t)
double operator-(const Date &d1, const Date &d2)