Rcpp Version 1.1.2
Loading...
Searching...
No Matches
Rcpp::sugar::IndexHash< RTYPE > Class Template Reference

#include <IndexHash.h>

Public Types

typedef traits::storage_type< RTYPE >::type STORAGE
typedef Vector< RTYPE > VECTOR

Public Member Functions

 IndexHash (SEXP table)
IndexHashfill ()
LogicalVector fill_and_get_duplicated ()
template<typename T>
SEXP lookup (const T &vec) const
SEXP lookup (const VECTOR &vec) const
bool contains (STORAGE val) const
int size () const
Vector< RTYPE > keys () const
template<typename T>
SEXP lookup__impl (const T &vec, int n_) const
SEXP get_profile_data ()
STORAGE normalize (STORAGE val) const
bool not_equal (const STORAGE &lhs, const STORAGE &rhs)
bool add_value (int i)
uint32_t get_index (STORAGE value) const
uint32_t get_addr (STORAGE value) const
double normalize (double val) const
uint32_t get_addr (int value) const
uint32_t get_addr (double val) const
uint32_t get_addr (SEXP value) const

Public Attributes

int n
int m
int k
STORAGEsrc
int size_
int * data

Detailed Description

template<int RTYPE>
class Rcpp::sugar::IndexHash< RTYPE >

Definition at line 50 of file IndexHash.h.

Member Typedef Documentation

◆ STORAGE

template<int RTYPE>
typedef traits::storage_type<RTYPE>::type Rcpp::sugar::IndexHash< RTYPE >::STORAGE

Definition at line 52 of file IndexHash.h.

◆ VECTOR

template<int RTYPE>
typedef Vector<RTYPE> Rcpp::sugar::IndexHash< RTYPE >::VECTOR

Definition at line 53 of file IndexHash.h.

Constructor & Destructor Documentation

◆ IndexHash()

template<int RTYPE>
Rcpp::sugar::IndexHash< RTYPE >::IndexHash ( SEXP table)
inline

Definition at line 55 of file IndexHash.h.

References data, dataptr(), get_cache(), k, m, n, RCPP_PROFILE_RECORD, RCPP_PROFILE_TIC, RCPP_PROFILE_TOC, size_, src, and Rcpp::table().

Referenced by add_value(), and fill().

Here is the call graph for this function:

Member Function Documentation

◆ add_value()

template<int RTYPE>
bool Rcpp::sugar::IndexHash< RTYPE >::add_value ( int i)
inline

Definition at line 169 of file IndexHash.h.

References data, DEMANGLE, get_addr(), IndexHash(), m, normalize(), not_equal(), RCPP_DEBUG_2, size_, and src.

Referenced by fill(), and fill_and_get_duplicated().

Here is the call graph for this function:

◆ contains()

template<int RTYPE>
bool Rcpp::sugar::IndexHash< RTYPE >::contains ( STORAGE val) const
inline

Definition at line 102 of file IndexHash.h.

References get_index().

Here is the call graph for this function:

◆ fill()

template<int RTYPE>
IndexHash & Rcpp::sugar::IndexHash< RTYPE >::fill ( )
inline

Definition at line 74 of file IndexHash.h.

References add_value(), fill(), IndexHash(), n, RCPP_PROFILE_RECORD, RCPP_PROFILE_TIC, and RCPP_PROFILE_TOC.

Referenced by fill(), Rcpp::match(), and Rcpp::unique().

Here is the call graph for this function:

◆ fill_and_get_duplicated()

template<int RTYPE>
LogicalVector Rcpp::sugar::IndexHash< RTYPE >::fill_and_get_duplicated ( )
inline

Definition at line 85 of file IndexHash.h.

References add_value(), n, and Rcpp::no_init().

Referenced by Rcpp::duplicated().

Here is the call graph for this function:

◆ get_addr() [1/4]

uint32_t Rcpp::sugar::IndexHash< REALSXP >::get_addr ( double val) const
inline

Definition at line 219 of file IndexHash.h.

References RCPP_HASH.

◆ get_addr() [2/4]

uint32_t Rcpp::sugar::IndexHash< INTSXP >::get_addr ( int value) const
inline

Definition at line 215 of file IndexHash.h.

References RCPP_HASH.

◆ get_addr() [3/4]

uint32_t Rcpp::sugar::IndexHash< STRSXP >::get_addr ( SEXP value) const
inline

Definition at line 232 of file IndexHash.h.

References RCPP_HASH.

◆ get_addr() [4/4]

template<int RTYPE>
uint32_t Rcpp::sugar::IndexHash< RTYPE >::get_addr ( STORAGE value) const

Referenced by add_value(), and get_index().

◆ get_index()

template<int RTYPE>
uint32_t Rcpp::sugar::IndexHash< RTYPE >::get_index ( STORAGE value) const
inline

Definition at line 190 of file IndexHash.h.

References data, get_addr(), m, and src.

Referenced by contains(), and lookup__impl().

Here is the call graph for this function:

◆ get_profile_data()

template<int RTYPE>
SEXP Rcpp::sugar::IndexHash< RTYPE >::get_profile_data ( )
inline

Definition at line 155 of file IndexHash.h.

References Rcpp::wrap().

Here is the call graph for this function:

◆ keys()

template<int RTYPE>
Vector< RTYPE > Rcpp::sugar::IndexHash< RTYPE >::keys ( ) const
inline

Definition at line 111 of file IndexHash.h.

References data, Rcpp::no_init(), size_, and src.

Referenced by Rcpp::unique().

Here is the call graph for this function:

◆ lookup() [1/2]

template<int RTYPE>
template<typename T>
SEXP Rcpp::sugar::IndexHash< RTYPE >::lookup ( const T & vec) const
inline

Definition at line 93 of file IndexHash.h.

References lookup__impl().

Referenced by lookup__impl(), and Rcpp::match().

Here is the call graph for this function:

◆ lookup() [2/2]

template<int RTYPE>
SEXP Rcpp::sugar::IndexHash< RTYPE >::lookup ( const VECTOR & vec) const
inline

Definition at line 98 of file IndexHash.h.

References Rcpp::Vector< RTYPE, StoragePolicy >::begin(), lookup__impl(), and Rcpp::Vector< RTYPE, StoragePolicy >::size().

Here is the call graph for this function:

◆ lookup__impl()

template<int RTYPE>
template<typename T>
SEXP Rcpp::sugar::IndexHash< RTYPE >::lookup__impl ( const T & vec,
int n_ ) const
inline

Definition at line 135 of file IndexHash.h.

References get_index(), lookup(), RCPP_PROFILE_RECORD, RCPP_PROFILE_TIC, and RCPP_PROFILE_TOC.

Referenced by lookup(), and lookup().

Here is the call graph for this function:

◆ normalize() [1/2]

double Rcpp::sugar::IndexHash< REALSXP >::normalize ( double val) const
inline

Definition at line 206 of file IndexHash.h.

◆ normalize() [2/2]

template<int RTYPE>
STORAGE Rcpp::sugar::IndexHash< RTYPE >::normalize ( STORAGE val) const
inline

Definition at line 163 of file IndexHash.h.

Referenced by add_value(), and not_equal().

◆ not_equal()

template<int RTYPE>
bool Rcpp::sugar::IndexHash< RTYPE >::not_equal ( const STORAGE & lhs,
const STORAGE & rhs )
inline

Definition at line 165 of file IndexHash.h.

References normalize().

Referenced by add_value().

Here is the call graph for this function:

◆ size()

template<int RTYPE>
int Rcpp::sugar::IndexHash< RTYPE >::size ( ) const
inline

Definition at line 106 of file IndexHash.h.

References size_.

Member Data Documentation

◆ data

template<int RTYPE>
int* Rcpp::sugar::IndexHash< RTYPE >::data

Definition at line 123 of file IndexHash.h.

Referenced by add_value(), get_index(), IndexHash(), and keys().

◆ k

template<int RTYPE>
int Rcpp::sugar::IndexHash< RTYPE >::k

Definition at line 119 of file IndexHash.h.

Referenced by IndexHash().

◆ m

template<int RTYPE>
int Rcpp::sugar::IndexHash< RTYPE >::m

Definition at line 119 of file IndexHash.h.

Referenced by add_value(), get_index(), and IndexHash().

◆ n

template<int RTYPE>
int Rcpp::sugar::IndexHash< RTYPE >::n

Definition at line 119 of file IndexHash.h.

Referenced by fill(), fill_and_get_duplicated(), and IndexHash().

◆ size_

template<int RTYPE>
int Rcpp::sugar::IndexHash< RTYPE >::size_

Definition at line 121 of file IndexHash.h.

Referenced by add_value(), IndexHash(), keys(), and size().

◆ src

template<int RTYPE>
STORAGE* Rcpp::sugar::IndexHash< RTYPE >::src

Definition at line 120 of file IndexHash.h.

Referenced by add_value(), get_index(), IndexHash(), and keys().


The documentation for this class was generated from the following file: