22#ifndef Rcpp__sugar__ifelse_h
23#define Rcpp__sugar__ifelse_h
30 bool COND_NA,
typename COND_T,
31 bool LHS_NA ,
typename LHS_T,
32 bool RHS_NA ,
typename RHS_T
36 ( COND_NA || LHS_NA || RHS_NA ) ,
37 IfElse<RTYPE,COND_NA,COND_T,LHS_NA,LHS_T,RHS_NA,RHS_T>
58 if( x )
return lhs[i] ;
62 inline R_xlen_t
size()
const {
return cond.size() ; }
74 bool LHS_NA ,
typename LHS_T,
75 bool RHS_NA ,
typename RHS_T
79 ( LHS_NA || RHS_NA ) ,
80 IfElse<RTYPE,false,COND_T,LHS_NA,LHS_T,RHS_NA,RHS_T>
101 inline R_xlen_t
size()
const {
return cond.size() ; }
116 bool COND_NA,
typename COND_T,
117 bool RHS_NA ,
typename RHS_T
122 IfElse_Primitive_Vector<RTYPE,COND_NA,COND_T,RHS_NA,RHS_T>
143 inline R_xlen_t
size()
const {
return cond.size() ; }
155 bool RHS_NA ,
typename RHS_T
160 IfElse_Primitive_Vector<RTYPE,false,COND_T,RHS_NA,RHS_T>
178 inline R_xlen_t
size()
const {
return cond.size() ; }
193 bool COND_NA,
typename COND_T,
194 bool LHS_NA ,
typename LHS_T
199 IfElse_Vector_Primitive<RTYPE,COND_NA,COND_T,LHS_NA,LHS_T>
215 if( x )
return lhs[i] ;
219 inline R_xlen_t
size()
const {
return cond.size() ; }
231 bool LHS_NA ,
typename LHS_T
236 IfElse_Vector_Primitive<RTYPE,false,COND_T,LHS_NA,LHS_T>
254 inline R_xlen_t
size()
const {
return cond.size() ; }
271 bool COND_NA,
typename COND_T
276 IfElse_Primitive_Primitive<RTYPE,COND_NA,COND_T>
293 inline R_xlen_t
size()
const {
return cond.size() ; }
304 int RTYPE,
typename COND_T
309 IfElse_Primitive_Primitive<RTYPE,false,COND_T>
324 inline R_xlen_t
size()
const {
return cond.size() ; }
337 bool COND_NA,
typename COND_T,
338 bool LHS_NA ,
typename LHS_T,
339 bool RHS_NA ,
typename RHS_T
353 bool COND_NA,
typename COND_T,
354 bool RHS_NA ,
typename RHS_T
356inline sugar::IfElse_Primitive_Vector< RTYPE,COND_NA,COND_T,RHS_NA,RHS_T >
367 bool COND_NA,
typename COND_T,
368 bool RHS_NA ,
typename RHS_T
370inline sugar::IfElse_Vector_Primitive< RTYPE,COND_NA,COND_T,RHS_NA,RHS_T >
380 bool COND_NA,
typename COND_T
382inline sugar::IfElse_Primitive_Primitive< REALSXP,COND_NA,COND_T >
392 bool COND_NA,
typename COND_T
394inline sugar::IfElse_Primitive_Primitive< INTSXP,COND_NA,COND_T >
404 bool COND_NA,
typename COND_T
406inline sugar::IfElse_Primitive_Primitive< CPLXSXP,COND_NA,COND_T >
416 bool COND_NA,
typename COND_T
418inline sugar::IfElse_Primitive_Primitive< LGLSXP,COND_NA,COND_T >
IfElse< RTYPE, COND_NA, COND_T, LHS_NA, LHS_T, RHS_NA, RHS_T > & get_ref()
IfElse(const COND_TYPE &cond_, const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::VectorBase< RTYPE,LHS_NA,LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< LGLSXP, false, COND_T > COND_TYPE
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE,RHS_NA,RHS_T > RHS_TYPE
traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
IfElse_Primitive_Primitive(const COND_TYPE &cond_, STORAGE lhs_, STORAGE rhs_)
Rcpp::VectorBase< LGLSXP, false, COND_T > COND_TYPE
traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< LGLSXP, COND_NA, COND_T > COND_TYPE
IfElse_Primitive_Primitive(const COND_TYPE &cond_, STORAGE lhs_, STORAGE rhs_)
IfElse_Primitive_Vector(const COND_TYPE &cond_, STORAGE lhs_, const RHS_TYPE &rhs_)
STORAGE operator[](R_xlen_t i) const
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::VectorBase< RTYPE,RHS_NA,RHS_T > RHS_TYPE
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< LGLSXP, false, COND_T > COND_TYPE
Rcpp::VectorBase< RTYPE,RHS_NA,RHS_T > RHS_TYPE
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
STORAGE operator[](R_xlen_t i) const
traits::storage_type< RTYPE >::type STORAGE
IfElse_Primitive_Vector(const COND_TYPE &cond_, STORAGE lhs_, const RHS_TYPE &rhs_)
Rcpp::VectorBase< LGLSXP, COND_NA, COND_T > COND_TYPE
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE,LHS_NA,LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< LGLSXP, false, COND_T > COND_TYPE
IfElse_Vector_Primitive(const COND_TYPE &cond_, const LHS_TYPE &lhs_, STORAGE rhs_)
Rcpp::VectorBase< RTYPE,LHS_NA,LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
IfElse_Vector_Primitive(const COND_TYPE &cond_, const LHS_TYPE &lhs_, STORAGE rhs_)
Rcpp::VectorBase< LGLSXP, COND_NA, COND_T > COND_TYPE
traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE,LHS_NA,LHS_T > LHS_TYPE
Rcpp::VectorBase< RTYPE,RHS_NA,RHS_T > RHS_TYPE
STORAGE operator[](R_xlen_t i) const
IfElse(const COND_TYPE &cond_, const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< LGLSXP, COND_NA, COND_T > COND_TYPE
#define DEMANGLE(__TYPE__)
storage_type< RTYPE >::type get_na()
bool is_na(typename storage_type< RTYPE >::type)
sugar::IfElse< RTYPE, COND_NA, COND_T, LHS_NA, LHS_T, RHS_NA, RHS_T > ifelse(const Rcpp::VectorBase< LGLSXP, COND_NA, COND_T > &cond, const Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > &lhs, const Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > &rhs)