mpqc::FermionStringSparseSet< FString, HashMap > Class Template Reference

Documentation

template<typename FString, template< typename... > class HashMap>
class mpqc::FermionStringSparseSet< FString, HashMap >

hashmap-based container of strings

Note
finding strings is fast

Public Types

using ordinal_type = std::int64_t
 
typedef HashMap< FString, ordinal_type, std::hash< FString > > container_type
 
typedef container_type::iterator iterator
 
typedef container_type::const_iterator const_iterator
 
typedef FString value_type
 

Public Member Functions

 FermionStringSparseSet ()
 
 FermionStringSparseSet (const FermionStringSparseSet &)=default
 
 FermionStringSparseSet (FermionStringSparseSet &&)=default
 
FermionStringSparseSetoperator= (const FermionStringSparseSet &)=default
 
FermionStringSparseSetoperator= (FermionStringSparseSet &&)=default
 
 ~FermionStringSparseSet ()=default
 
const_iterator insert (const FString &s)
 
const_iterator insert (FString &&s)
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator find (const FString &str) const
 
std::optional< const_iteratorsafe_find (const FString &str) const
 
std::tuple< ordinal_type, bool > find_or_insert (const FString &str)
 
bool contains (const FString &str) const
 
size_t size () const
 
size_t bucket_count () const
 

Member Typedef Documentation

◆ const_iterator

template<typename FString , template< typename... > class HashMap>
typedef container_type::const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::const_iterator

◆ container_type

template<typename FString , template< typename... > class HashMap>
typedef HashMap<FString, ordinal_type, std::hash<FString> > mpqc::FermionStringSparseSet< FString, HashMap >::container_type

◆ iterator

template<typename FString , template< typename... > class HashMap>
typedef container_type::iterator mpqc::FermionStringSparseSet< FString, HashMap >::iterator

◆ ordinal_type

template<typename FString , template< typename... > class HashMap>
using mpqc::FermionStringSparseSet< FString, HashMap >::ordinal_type = std::int64_t

◆ value_type

template<typename FString , template< typename... > class HashMap>
typedef FString mpqc::FermionStringSparseSet< FString, HashMap >::value_type

Constructor & Destructor Documentation

◆ FermionStringSparseSet() [1/3]

template<typename FString , template< typename... > class HashMap>
mpqc::FermionStringSparseSet< FString, HashMap >::FermionStringSparseSet ( )
inline

◆ FermionStringSparseSet() [2/3]

template<typename FString , template< typename... > class HashMap>
mpqc::FermionStringSparseSet< FString, HashMap >::FermionStringSparseSet ( const FermionStringSparseSet< FString, HashMap > &  )
default

◆ FermionStringSparseSet() [3/3]

template<typename FString , template< typename... > class HashMap>
mpqc::FermionStringSparseSet< FString, HashMap >::FermionStringSparseSet ( FermionStringSparseSet< FString, HashMap > &&  )
default

◆ ~FermionStringSparseSet()

template<typename FString , template< typename... > class HashMap>
mpqc::FermionStringSparseSet< FString, HashMap >::~FermionStringSparseSet ( )
default

Member Function Documentation

◆ begin()

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::begin ( ) const
inline

◆ bucket_count()

template<typename FString , template< typename... > class HashMap>
size_t mpqc::FermionStringSparseSet< FString, HashMap >::bucket_count ( ) const
inline
Returns
the number of buckets holding the strings

◆ cbegin()

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::cbegin ( ) const
inline

◆ cend()

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::cend ( ) const
inline

◆ contains()

template<typename FString , template< typename... > class HashMap>
bool mpqc::FermionStringSparseSet< FString, HashMap >::contains ( const FString &  str) const
inline

◆ end()

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::end ( ) const
inline

◆ find()

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::find ( const FString &  str) const
inline

◆ find_or_insert()

template<typename FString , template< typename... > class HashMap>
std::tuple<ordinal_type, bool> mpqc::FermionStringSparseSet< FString, HashMap >::find_or_insert ( const FString &  str)
inline

Looks for the string, and inserts it if not found

Parameters
[in]strstring
Returns
{ordinal,inserted} where is the ordinal index and inserted is true if the string was inserted

◆ insert() [1/2]

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::insert ( const FString &  s)
inline
Parameters
[in]sa nonnull string to be inserted into this
Note
asserts that s.size() matches that of the first string in this, if any
asserts that s does not have equivalent already inserted

◆ insert() [2/2]

template<typename FString , template< typename... > class HashMap>
const_iterator mpqc::FermionStringSparseSet< FString, HashMap >::insert ( FString &&  s)
inline
Parameters
[in]sa nonnull string to be inserted into this
Note
asserts that s.size() matches that of the first string in this, if any
asserts that s does not have equivalent already inserted

◆ operator=() [1/2]

template<typename FString , template< typename... > class HashMap>
FermionStringSparseSet& mpqc::FermionStringSparseSet< FString, HashMap >::operator= ( const FermionStringSparseSet< FString, HashMap > &  )
default

◆ operator=() [2/2]

template<typename FString , template< typename... > class HashMap>
FermionStringSparseSet& mpqc::FermionStringSparseSet< FString, HashMap >::operator= ( FermionStringSparseSet< FString, HashMap > &&  )
default

◆ safe_find()

template<typename FString , template< typename... > class HashMap>
std::optional<const_iterator> mpqc::FermionStringSparseSet< FString, HashMap >::safe_find ( const FString &  str) const
inline

◆ size()

template<typename FString , template< typename... > class HashMap>
size_t mpqc::FermionStringSparseSet< FString, HashMap >::size ( ) const
inline
Returns
the number of strings in the set

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