22 #ifndef Rcpp__sugar__sign_h
23 #define Rcpp__sugar__sign_h
28 template <
bool NA,
int RTYPE>
33 return Rcpp::traits::is_na<RTYPE>(x) ? NA_INTEGER : ( x > 0 ? 1 : (x==0 ? 0 : -1) ) ;
42 return ( x > 0 ? 1 : (x==0 ? 0 : -1) ) ;
47 template <
int RTYPE,
bool NA,
typename T>
59 inline R_xlen_t
size()
const {
return object.size() ; }
61 operator SEXP()
const {
return wrap( *
this ); }
69 template <
bool NA,
typename T>
74 template <
bool NA,
typename T>
int operator[](R_xlen_t i) const
int get(R_xlen_t i) const
Sign(const VEC_TYPE &object_)
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Rcpp::traits::storage_type< RTYPE >::type STORAGE
Rcpp::traits::storage_type< RTYPE >::type STORAGE
static int get(STORAGE x)
Rcpp::traits::storage_type< RTYPE >::type STORAGE
static int get(STORAGE x)
sugar::Sign< INTSXP, NA, T > sign(const VectorBase< INTSXP, NA, T > &t)
SEXP wrap(const Date &date)