22 #ifndef Rcpp__sugar__divides_h
23 #define Rcpp__sugar__divides_h
28 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T >
42 if( Rcpp::traits::is_na<RTYPE>( x ) )
return x ;
44 return Rcpp::traits::is_na<RTYPE>(
y ) ? y : ( x / y ) ;
47 inline int size()
const {
return lhs.size() ; }
54 template <
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T >
56 public Rcpp::VectorBase<REALSXP,true, Divides_Vector_Vector<REALSXP,LHS_NA,LHS_T,RHS_NA,RHS_T> > {
70 inline int size()
const {
return lhs.size() ; }
78 template <
int RTYPE,
typename LHS_T,
bool RHS_NA,
typename RHS_T >
79 class Divides_Vector_Vector<RTYPE,false,LHS_T,RHS_NA,RHS_T> :
public Rcpp::VectorBase<RTYPE,true, Divides_Vector_Vector<RTYPE,false,LHS_T,RHS_NA,RHS_T> > {
92 if( Rcpp::traits::is_na<RTYPE>( y ) )
return y ;
96 inline int size()
const {
return lhs.size() ; }
103 template <
typename LHS_T,
bool RHS_NA,
typename RHS_T >
105 public Rcpp::VectorBase<REALSXP,true, Divides_Vector_Vector<REALSXP,false,LHS_T,RHS_NA,RHS_T> > {
119 inline int size()
const {
return lhs.size() ; }
127 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
typename RHS_T >
129 public Rcpp::VectorBase<RTYPE,true, Divides_Vector_Vector<RTYPE,LHS_NA,LHS_T,false,RHS_T> > {
142 if( Rcpp::traits::is_na<RTYPE>( x ) )
return x ;
145 inline int size()
const {
return lhs.size() ; }
152 template <
bool LHS_NA,
typename LHS_T,
typename RHS_T >
154 public Rcpp::VectorBase<REALSXP,true, Divides_Vector_Vector<REALSXP,LHS_NA,LHS_T,false,RHS_T> > {
167 inline int size()
const {
return lhs.size() ; }
175 template <
int RTYPE,
typename LHS_T,
typename RHS_T >
177 public Rcpp::VectorBase<RTYPE,false, Divides_Vector_Vector<RTYPE,false,LHS_T,false,RHS_T> > {
192 inline int size()
const {
return lhs.size() ; }
199 template <
typename LHS_T,
typename RHS_T >
201 public Rcpp::VectorBase<REALSXP,false, Divides_Vector_Vector<REALSXP,false,LHS_T,false,RHS_T> > {
215 inline int size()
const {
return lhs.size() ; }
225 template <
int RTYPE,
bool NA,
typename T>
227 public Rcpp::VectorBase<RTYPE,true, Divides_Vector_Primitive<RTYPE,NA,T> > {
240 return Rcpp::traits::is_na<RTYPE>(
x) ? x : (x /
rhs) ;
243 inline int size()
const {
return lhs.size() ; }
251 template <
bool NA,
typename T>
253 public Rcpp::VectorBase<REALSXP,true, Divides_Vector_Primitive<REALSXP,NA,T> > {
266 inline int size()
const {
return lhs.size() ; }
275 template <
int RTYPE,
typename T>
277 public Rcpp::VectorBase<RTYPE,true, Divides_Vector_Primitive<RTYPE,false,T> > {
289 return Rcpp::traits::is_na<RTYPE>(
x) ? x : (x /
rhs) ;
291 inline int size()
const {
return lhs.size() ; }
299 template <
typename T>
301 public Rcpp::VectorBase<REALSXP,true, Divides_Vector_Primitive<REALSXP,false,T> > {
312 inline int size()
const {
return lhs.size() ; }
321 template <
int RTYPE,
bool NA,
typename T>
323 public Rcpp::VectorBase<RTYPE,true, Divides_Primitive_Vector<RTYPE,NA,T> > {
335 return Rcpp::traits::is_na<RTYPE>(
x) ? x : (
lhs / x) ;
337 inline int size()
const {
return rhs.size() ; }
344 template <
bool NA,
typename T>
346 public Rcpp::VectorBase<REALSXP,true, Divides_Primitive_Vector<REALSXP,NA,T> > {
357 inline int size()
const {
return rhs.size() ; }
365 template <
int RTYPE,
typename T>
367 public Rcpp::VectorBase<RTYPE,true, Divides_Primitive_Vector<RTYPE,false,T> > {
380 inline int size()
const {
return rhs.size() ; }
388 template <
typename T>
390 public Rcpp::VectorBase<REALSXP,true, Divides_Primitive_Vector<REALSXP,false,T> > {
401 inline int size()
const {
return rhs.size() ; }
412 template <
int RTYPE,
bool NA,
typename T>
422 template <
int RTYPE,
bool NA,
typename T>
431 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>