mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap > Class Template Reference

Documentation

template<typename String, typename Value, typename Compare, typename Equal, template< typename... > class HashMap>
class mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >

A (sparse) set of Slater determinants represented as a sparse matrix.

Implemented as a hashtable indexed by alpha strings, with the corresponding element containing sorted vector (by beta string hash) of determinants and their ordinal values. This

Classes

struct  Iterator
 iterator is a proxy to a FString object, stores an ordinal More...
 

Public Types

using row_type = boost::container::small_vector< Value, 8 >
 
using col_const_iterator = typename row_type::const_iterator
 
using container_type = HashMap< String, row_type, string::hash< String >, string::equal_to< String > >
 
using row_const_iterator = typename container_type::const_iterator
 
using const_iterator = Iterator
 

Public Member Functions

 StringToSortedVector ()=default
 
 StringToSortedVector (const StringToSortedVector &)=default
 
 StringToSortedVector (StringToSortedVector &&) noexcept=default
 
StringToSortedVectoroperator= (const StringToSortedVector &)=default
 
StringToSortedVectoroperator= (StringToSortedVector &&) noexcept=default
 
 ~StringToSortedVector ()=default
 
auto size () const
 
bool contains (const String &str) const
 
const auto & row (const String &str) const
 
const auto * row_ptr (const String &str) const
 
std::pair< col_const_iterator, bool > insert (const String &astr, const Value &v)
 
auto & finalize ()
 
template<typename F >
auto & finalize (F &&f)
 
bool is_finalized () const
 
Iterator accessors
Note
iterator dereferences to std::pair<SlaterDeterminantSet::SlaterDeterminant,ordinal_type>
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 

Protected Member Functions

const auto & data () const
 
auto & data ()
 

Friends

struct Iterator
 

Member Typedef Documentation

◆ col_const_iterator

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
using mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::col_const_iterator = typename row_type::const_iterator

◆ const_iterator

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
using mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::const_iterator = Iterator

◆ container_type

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
using mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::container_type = HashMap<String, row_type, string::hash<String>, string::equal_to<String> >

◆ row_const_iterator

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
using mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::row_const_iterator = typename container_type::const_iterator

◆ row_type

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
using mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::row_type = boost::container::small_vector<Value, 8>

Constructor & Destructor Documentation

◆ StringToSortedVector() [1/3]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::StringToSortedVector ( )
default

◆ StringToSortedVector() [2/3]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::StringToSortedVector ( const StringToSortedVector< String, Value, Compare, Equal, HashMap > &  )
default

◆ StringToSortedVector() [3/3]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::StringToSortedVector ( StringToSortedVector< String, Value, Compare, Equal, HashMap > &&  )
defaultnoexcept

◆ ~StringToSortedVector()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::~StringToSortedVector ( )
default

Member Function Documentation

◆ begin()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const_iterator mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::begin ( ) const
inline

◆ cbegin()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const_iterator mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::cbegin ( ) const
inline

◆ cend()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const_iterator mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::cend ( ) const
inline

◆ contains()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
bool mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::contains ( const String &  str) const
inline
Returns
true if contains the given string

◆ data() [1/2]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
auto& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::data ( )
inlineprotected

◆ data() [2/2]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const auto& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::data ( ) const
inlineprotected

◆ end()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const_iterator mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::end ( ) const
inline

◆ finalize() [1/2]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
auto& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::finalize ( )
inline

finalizes the matrix by sorting the rows; this object cannot be mutated henceforth

◆ finalize() [2/2]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
template<typename F >
auto& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::finalize ( F &&  f)
inline

finalizes the matrix by sorting the rows and applying callable F

Template Parameters
Fcallable with signature void(StringToSortedVector&)
Note
this object cannot be mutated henceforth

◆ insert()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
std::pair<col_const_iterator, bool> mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::insert ( const String &  astr,
const Value &  v 
)
inline

try inserting determinant defined by 2 strings, with optionally-specified ordinal value

Parameters
[in]astrspin-up string
[in]bstrspin-down string
[in]ordordinal value to assign to this determinant; if not given use this->size()
Returns
std::pair containing the iterator to the found or inserted determinant and the flag indicating whether insertion took place

◆ is_finalized()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
bool mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::is_finalized ( ) const
inline
Returns
whether this object has been finalized
See also
finalize()

◆ operator=() [1/2]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
StringToSortedVector& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::operator= ( const StringToSortedVector< String, Value, Compare, Equal, HashMap > &  )
default

◆ operator=() [2/2]

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
StringToSortedVector& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::operator= ( StringToSortedVector< String, Value, Compare, Equal, HashMap > &&  )
defaultnoexcept

◆ row()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const auto& mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::row ( const String &  str) const
inline
Returns
the row of values contained for str

◆ row_ptr()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
const auto* mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::row_ptr ( const String &  str) const
inline
Returns
ptr to the row of values contained for str; nullptr if str is not contained in the set

◆ size()

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
auto mpqc::StringToSortedVector< String, Value, Compare, Equal, HashMap >::size ( ) const
inline
Returns
the total number of determinants

Friends And Related Function Documentation

◆ Iterator

template<typename String , typename Value , typename Compare , typename Equal , template< typename... > class HashMap>
friend struct Iterator
friend

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