22 #ifndef Rcpp__sugar__setdiff_h
23 #define Rcpp__sugar__setdiff_h
28 template <
typename SET>
42 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
47 SetDiff(
const LHS_T& lhs,
const RHS_T& rhs) :
63 typedef RCPP_UNORDERED_SET<STORAGE>
SET ;
64 typedef typename SET::const_iterator
ITERATOR ;
70 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
75 SetEqual(
const LHS_T& lhs,
const RHS_T& rhs) :
86 if(
rhs_set.find(*it++) == rhs_end )
return false ;
92 typedef RCPP_UNORDERED_SET<STORAGE>
SET ;
93 typedef typename SET::const_iterator
ITERATOR ;
99 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
113 for(
ITERATOR it=lhs_set.begin(); it != end; it++){
114 if( rhs_set.find(*it) != rhs_end )
intersect.insert(*it) ;
126 typedef RCPP_UNORDERED_SET<STORAGE>
SET ;
132 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
137 Union(
const LHS_T& lhs,
const RHS_T& rhs) :
144 R_xlen_t n =
result.size() ;
151 typedef RCPP_UNORDERED_SET<STORAGE>
SET ;
160 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
165 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
170 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
176 template <
int RTYPE,
bool LHS_NA,
typename LHS_T,
bool RHS_NA,
typename RHS_T>
Intersect(const LHS_T &lhs, const RHS_T &rhs)
RCPP_UNORDERED_SET< STORAGE > SET
Vector< RTYPE > get() const
Rcpp::traits::storage_type< RTYPE >::type STORAGE
SET::const_iterator ITERATOR
Vector< RTYPE > get() const
RCPP_UNORDERED_SET< STORAGE > SET
Rcpp::traits::storage_type< RTYPE >::type STORAGE
SetDiff(const LHS_T &lhs, const RHS_T &rhs)
SET::const_iterator ITERATOR
SetEqual(const LHS_T &lhs, const RHS_T &rhs)
RCPP_UNORDERED_SET< STORAGE > SET
SET::const_iterator ITERATOR
Rcpp::traits::storage_type< RTYPE >::type STORAGE
Vector< RTYPE > get() const
RCPP_UNORDERED_SET< STORAGE > SET
Union(const LHS_T &lhs, const RHS_T &rhs)
Rcpp::traits::storage_type< RTYPE >::type STORAGE
SET::const_iterator ITERATOR
sugar_const_iterator_type< T >::type get_const_end(const T &obj)
sugar_const_iterator_type< T >::type get_const_begin(const T &obj)
Vector< RTYPE > union_(const VectorBase< RTYPE, LHS_NA, LHS_T > &lhs, const VectorBase< RTYPE, RHS_NA, RHS_T > &rhs)
Vector< RTYPE > setdiff(const VectorBase< RTYPE, LHS_NA, LHS_T > &lhs, const VectorBase< RTYPE, RHS_NA, RHS_T > &rhs)
no_init_vector no_init(R_xlen_t size)
bool setequal(const VectorBase< RTYPE, LHS_NA, LHS_T > &lhs, const VectorBase< RTYPE, RHS_NA, RHS_T > &rhs)
Vector< RTYPE > intersect(const VectorBase< RTYPE, LHS_NA, LHS_T > &lhs, const VectorBase< RTYPE, RHS_NA, RHS_T > &rhs)