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 ;
33 struct pmin_op<REALSXP,true,true>{
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>
57 struct pmin_op<INTSXP,LHS_NA,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 int size()
const {
return lhs.size() ; }
125 bool LHS_NA,
typename LHS_T
130 Pmin_Vector_Primitive<RTYPE,LHS_NA,LHS_T>
139 inline int 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>