22 #ifndef Rcpp__sugar__pmin_h
23 #define Rcpp__sugar__pmin_h
28 template <
int RTYPE,
bool LHS_NA,
bool RHS_NA>
struct pmin_op ;
34 inline double operator()(
double left,
double right )
const {
38 template <>
struct pmin_op<REALSXP,true,false> {
39 inline double operator()(
double left,
double right )
const {
40 return right < left ? right : left ;
43 template <>
struct pmin_op<REALSXP,false,true> {
44 inline double operator()(
double left,
double right )
const {
45 return right < left ? right : left ;
48 template <>
struct pmin_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 Pmin_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 Pmin_Vector_Primitive<RTYPE,LHS_NA,LHS_T>
139 inline R_xlen_t
size()
const {
return lhs.size() ; }
152 bool LHS_NA,
typename LHS_T,
153 bool RHS_NA,
typename RHS_T
165 bool LHS_NA,
typename LHS_T
167 inline sugar::Pmin_Vector_Primitive<RTYPE,LHS_NA,LHS_T>
178 bool RHS_NA,
typename RHS_T
180 inline sugar::Pmin_Vector_Primitive<RTYPE,RHS_NA,RHS_T>
Rcpp::traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
Pmin_Vector_Primitive(const LHS_T &lhs_, STORAGE rhs_)
pmin_op_Vector_Primitive< RTYPE, LHS_NA > OPERATOR
Rcpp::traits::storage_type< RTYPE >::type STORAGE
pmin_op< RTYPE, LHS_NA, RHS_NA > OPERATOR
Pmin_Vector_Vector(const LHS_T &lhs_, const RHS_T &rhs_)
STORAGE operator[](R_xlen_t i) const
pmin_op_Vector_Primitive(double right_)
double operator()(double left) const
Rcpp::traits::storage_type< RTYPE >::type STORAGE
pmin_op_Vector_Primitive(STORAGE right_)
STORAGE operator()(STORAGE left) const
bool is_na< REALSXP >(double x)
sugar::Pmin_Vector_Vector< RTYPE, LHS_NA, LHS_T, RHS_NA, RHS_T > pmin(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