22 #ifndef Rcpp__sugar__pmax_h
23 #define Rcpp__sugar__pmax_h
28 template <
int RTYPE,
bool LHS_NA,
bool RHS_NA>
struct pmax_op ;
34 inline double operator()(
double left,
double right )
const {
38 template <>
struct pmax_op<REALSXP,true,false> {
39 inline double operator()(
double left,
double right )
const {
40 return right > left ? right : left ;
43 template <>
struct pmax_op<REALSXP,false,true> {
44 inline double operator()(
double left,
double right )
const {
45 return right > left ? right : left ;
48 template <>
struct pmax_op<REALSXP,false,false> {
49 inline double operator()(
double left,
double right )
const {
50 return left > right ? left : right ;
56 template <
bool LHS_NA,
bool RHS_NA>
59 return left > right ? left : right ;
96 bool LHS_NA,
typename LHS_T,
97 bool RHS_NA,
typename RHS_T
101 ( LHS_NA || RHS_NA ) ,
102 Pmax_Vector_Vector<RTYPE,LHS_NA,LHS_T,RHS_NA,RHS_T>
113 inline R_xlen_t
size()
const {
return lhs.size() ; }
125 bool LHS_NA,
typename LHS_T
130 Pmax_Vector_Primitive<RTYPE,LHS_NA,LHS_T>
139 return op(
lhs[i] ) ;
141 inline R_xlen_t
size()
const {
return lhs.size() ; }
154 bool LHS_NA,
typename LHS_T,
155 bool RHS_NA,
typename RHS_T
167 bool LHS_NA,
typename LHS_T
169 inline sugar::Pmax_Vector_Primitive<RTYPE,LHS_NA,LHS_T>
180 bool RHS_NA,
typename RHS_T
182 inline sugar::Pmax_Vector_Primitive<RTYPE,RHS_NA,RHS_T>
STORAGE operator[](R_xlen_t i) const
Rcpp::traits::storage_type< RTYPE >::type STORAGE
pmax_op_Vector_Primitive< RTYPE, LHS_NA > OPERATOR
Pmax_Vector_Primitive(const LHS_T &lhs_, STORAGE rhs_)
pmax_op< RTYPE, LHS_NA, RHS_NA > OPERATOR
STORAGE operator[](R_xlen_t i) const
Rcpp::traits::storage_type< RTYPE >::type STORAGE
Pmax_Vector_Vector(const LHS_T &lhs_, const RHS_T &rhs_)
pmax_op_Vector_Primitive(double right_)
double operator()(double left) const
pmax_op_Vector_Primitive(STORAGE right_)
Rcpp::traits::storage_type< RTYPE >::type STORAGE
STORAGE operator()(STORAGE left) const
bool is_na< REALSXP >(double x)
sugar::Pmax_Vector_Vector< RTYPE, LHS_NA, LHS_T, RHS_NA, RHS_T > pmax(const Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > &lhs, const Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > &rhs)
int operator()(int left, int right) const
double operator()(double left, double right) const
double operator()(double left, double right) const
double operator()(double left, double right) const
double operator()(double left, double right) const