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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
size()
const {
return lhs.size() ; }
299 template <
typename T>
301 public Rcpp::VectorBase<REALSXP,true, Divides_Vector_Primitive<REALSXP,false,T> > {
312 inline R_xlen_t
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 R_xlen_t
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 R_xlen_t
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 R_xlen_t
size()
const {
return rhs.size() ; }
388 template <
typename T>
390 public Rcpp::VectorBase<REALSXP,true, Divides_Primitive_Vector<REALSXP,false,T> > {
401 inline R_xlen_t
size()
const {
return rhs.size() ; }
411 template <
int RTYPE,
bool NA,
typename T,
typename U>
421 template <
int RTYPE,
bool NA,
typename T,
typename U>
422 inline typename traits::enable_if< traits::is_convertible< typename traits::remove_const_and_reference<U>::type,
typename traits::storage_type<RTYPE>::type>::value, sugar::Divides_Primitive_Vector< RTYPE , NA,T> >::type
430 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
431 inline sugar::Divides_Vector_Vector<
Divides_Vector_Vector< RTYPE, LHS_NA, LHS_T, RHS_NA, RHS_T > & get_ref()
Divides_Primitive_Vector(double lhs_, const VEC_TYPE &rhs_)
double operator[](R_xlen_t i) const
Rcpp::traits::Extractor< REALSXP, NA, T >::type VEC_EXT
Rcpp::VectorBase< REALSXP, NA, T > VEC_TYPE
Divides_Primitive_Vector(double lhs_, const VEC_TYPE &rhs_)
Rcpp::traits::Extractor< REALSXP, false, T >::type VEC_EXT
Rcpp::VectorBase< REALSXP, false, T > VEC_TYPE
double operator[](R_xlen_t i) const
Rcpp::traits::Extractor< RTYPE, false, T >::type VEC_EXT
Divides_Primitive_Vector(STORAGE lhs_, const VEC_TYPE &rhs_)
STORAGE operator[](R_xlen_t i) const
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, false, T > VEC_TYPE
Rcpp::traits::Extractor< RTYPE, NA, T >::type VEC_EXT
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Divides_Primitive_Vector(STORAGE lhs_, const VEC_TYPE &rhs_)
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< REALSXP, NA, T > VEC_TYPE
Divides_Vector_Primitive(const VEC_TYPE &lhs_, double rhs_)
Rcpp::traits::Extractor< REALSXP, NA, T >::type VEC_EXT
double operator[](R_xlen_t i) const
double operator[](R_xlen_t i) const
Divides_Vector_Primitive(const VEC_TYPE &lhs_, double rhs_)
Rcpp::traits::Extractor< REALSXP, false, T >::type VEC_EXT
Rcpp::VectorBase< REALSXP, false, T > VEC_TYPE
Divides_Vector_Primitive(const VEC_TYPE &lhs_, STORAGE rhs_)
Rcpp::VectorBase< RTYPE, false, T > VEC_TYPE
Rcpp::traits::Extractor< RTYPE, false, T >::type VEC_EXT
traits::storage_type< RTYPE >::type STORAGE
STORAGE operator[](R_xlen_t i) const
STORAGE operator[](R_xlen_t i) const
Divides_Vector_Primitive(const VEC_TYPE &lhs_, STORAGE rhs_)
traits::storage_type< RTYPE >::type STORAGE
Rcpp::traits::Extractor< RTYPE, NA, T >::type VEC_EXT
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Rcpp::traits::Extractor< REALSXP, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::VectorBase< REALSXP, RHS_NA, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< REALSXP, LHS_NA, LHS_T >::type LHS_EXT
double operator[](R_xlen_t i) const
Rcpp::VectorBase< REALSXP, LHS_NA, LHS_T > LHS_TYPE
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< REALSXP, LHS_NA, LHS_T >::type LHS_EXT
Rcpp::VectorBase< REALSXP, LHS_NA, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, RHS_T >::type RHS_EXT
double operator[](R_xlen_t i) const
Rcpp::VectorBase< REALSXP, false, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, LHS_T >::type LHS_EXT
double operator[](R_xlen_t i) const
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::VectorBase< REALSXP, false, LHS_T > LHS_TYPE
Rcpp::VectorBase< REALSXP, RHS_NA, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< REALSXP, RHS_NA, RHS_T >::type RHS_EXT
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::VectorBase< REALSXP, false, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, LHS_T >::type LHS_EXT
double operator[](R_xlen_t i) const
Rcpp::VectorBase< REALSXP, false, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< REALSXP, false, RHS_T >::type RHS_EXT
STORAGE operator[](R_xlen_t i) const
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
Rcpp::traits::Extractor< RTYPE, false, RHS_T >::type RHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, false, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
Rcpp::VectorBase< RTYPE, false, LHS_T > LHS_TYPE
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > RHS_TYPE
traits::storage_type< RTYPE >::type STORAGE
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::traits::Extractor< RTYPE, false, LHS_T >::type LHS_EXT
traits::storage_type< RTYPE >::type STORAGE
Rcpp::traits::Extractor< RTYPE, false, LHS_T >::type LHS_EXT
Rcpp::traits::Extractor< RTYPE, false, RHS_T >::type RHS_EXT
Rcpp::VectorBase< RTYPE, false, LHS_T > LHS_TYPE
Rcpp::VectorBase< RTYPE, false, RHS_T > RHS_TYPE
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
STORAGE operator[](R_xlen_t i) const
Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
Divides_Vector_Vector(const LHS_TYPE &lhs_, const RHS_TYPE &rhs_)
Rcpp::traits::Extractor< RTYPE, RHS_NA, RHS_T >::type RHS_EXT
Rcpp::VectorBase< RTYPE, RHS_NA, RHS_T > RHS_TYPE
Rcpp::traits::Extractor< RTYPE, LHS_NA, LHS_T >::type LHS_EXT
STORAGE operator[](R_xlen_t i) const
traits::storage_type< RTYPE >::type STORAGE
sugar::IsNa< RTYPE, NA, T > is_na(const Rcpp::VectorBase< RTYPE, NA, T > &t)
traits::enable_if< traits::is_convertible< typename traits::remove_const_and_reference< U >::type, typename traits::storage_type< RTYPE >::type >::value, sugar::Divides_Vector_Primitive< RTYPE, NA, T > >::type operator/(const VectorBase< RTYPE, NA, T > &lhs, const U &rhs)