barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
FreqTable< T > Class Template Reference

Frequency table of vectors. More...

#include <freqtable.hpp>

Public Member Functions

 FreqTable ()
 
 ~FreqTable ()
 
size_t add (const std::vector< T > &x, size_t *h_precomp)
 
Counts_type as_vector () const
 
const std::vector< double > & get_data () const
 
const std::unordered_map< size_t, size_t > & get_index () const
 
void clear ()
 
void reserve (size_t n, size_t k)
 
void print () const
 
size_t size () const noexcept
 Number of unique elements in the table. (. More...
 
size_t make_hash (const std::vector< T > &x) const
 

Detailed Description

template<typename T = double>
class FreqTable< T >

Frequency table of vectors.

This is mostly used in Support. The main data is contained in the data double vector. The matrix is stored in a row-wise fashion, where the first element is the frequency with which the vector is observed.

For example, in a model with k terms the first k + 1 elements of data would be:

  • weights
  • term 1
  • term 2
  • ...
  • term k

Definition at line 22 of file freqtable.hpp.

Constructor & Destructor Documentation

◆ FreqTable()

template<typename T = double>
FreqTable< T >::FreqTable ( )
inline

Definition at line 34 of file freqtable.hpp.

◆ ~FreqTable()

template<typename T = double>
FreqTable< T >::~FreqTable ( )
inline

Definition at line 35 of file freqtable.hpp.

Member Function Documentation

◆ add()

template<typename T >
size_t FreqTable< T >::add ( const std::vector< T > &  x,
size_t *  h_precomp 
)
inline

Definition at line 59 of file freqtable.hpp.

◆ as_vector()

template<typename T >
Counts_type FreqTable< T >::as_vector
inline

Definition at line 139 of file freqtable.hpp.

◆ clear()

template<typename T >
void FreqTable< T >::clear
inline

Definition at line 168 of file freqtable.hpp.

◆ get_data()

template<typename T = double>
const std::vector< double >& FreqTable< T >::get_data ( ) const
inline

Definition at line 40 of file freqtable.hpp.

◆ get_index()

template<typename T = double>
const std::unordered_map<size_t,size_t>& FreqTable< T >::get_index ( ) const
inline

Definition at line 41 of file freqtable.hpp.

◆ make_hash()

template<typename T >
size_t FreqTable< T >::make_hash ( const std::vector< T > &  x) const
inline

Definition at line 239 of file freqtable.hpp.

◆ print()

template<typename T >
void FreqTable< T >::print
inline

Definition at line 204 of file freqtable.hpp.

◆ reserve()

template<typename T >
void FreqTable< T >::reserve ( size_t  n,
size_t  k 
)
inline

Definition at line 182 of file freqtable.hpp.

◆ size()

template<typename T >
size_t FreqTable< T >::size
inlinenoexcept

Number of unique elements in the table. (.

Returns
size_t

Definition at line 231 of file freqtable.hpp.


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