22 #ifndef Rcpp__sugar__self_match_h
23 #define Rcpp__sugar__self_match_h
28 template <
typename HASH,
typename STORAGE>
34 typename HASH::iterator it =
hash.find( value ) ;
35 if( it ==
hash.end() ){
36 hash.insert( std::make_pair(value, ++
index) ) ;
48 template <
int RTYPE,
typename TABLE_T>
60 typedef RCPP_UNORDERED_MAP<STORAGE, int>
HASH ;
68 template <
int RTYPE,
bool NA,
typename T>
IntegerVector fill_and_self_match()
SelfInserter(HASH &hash_)
R_xlen_t operator()(STORAGE value)
SelfInserter< HASH, STORAGE > Inserter
RCPP_UNORDERED_MAP< STORAGE, int > HASH
Rcpp::traits::storage_type< RTYPE >::type STORAGE
SelfMatch(const TABLE_T &table)
Vector< INTSXP > IntegerVector
IntegerVector self_match(const VectorBase< RTYPE, NA, T > &x)
IntegerVector table(const VectorBase< RTYPE, NA, T > &x)