23#ifndef Rcpp__sugar__self_match_h
24#define Rcpp__sugar__self_match_h
29template <
typename HASH,
typename STORAGE>
35 typename HASH::iterator it =
hash.find( value ) ;
36 if( it ==
hash.end() ){
37 hash.insert( std::make_pair(value, ++
index) ) ;
49template <
int RTYPE,
typename TABLE_T>
61 typedef std::unordered_map<STORAGE, int>
HASH ;
69template <
int RTYPE,
bool NA,
typename T>
IntegerVector fill_and_self_match()
SelfInserter(HASH &hash_)
R_xlen_t operator()(STORAGE value)
std::unordered_map< STORAGE, int > HASH
SelfInserter< HASH, STORAGE > Inserter
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)