Skip to content

Class barry::FreqTable

template <typename T>

ClassList > barry > FreqTable

Frequency table of vectors. More...

  • #include <barry.hpp>

Public Functions

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

Detailed Description

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

Public Functions Documentation

function FreqTable

inline barry::FreqTable::FreqTable () 

function add

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

function as_vector

inline Counts_type barry::FreqTable::as_vector () const

function clear

inline void barry::FreqTable::clear () 

function get_data

inline const std::vector< double > & barry::FreqTable::get_data () const

function get_index

inline const std::unordered_map< size_t, size_t > & barry::FreqTable::get_index () const

function make_hash

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

function print

inline void barry::FreqTable::print () const

function reserve

inline void barry::FreqTable::reserve (
    size_t n,
    size_t k
) 

function size

Number of unique elements in the table. (.

inline size_t barry::FreqTable::size () noexcept const

Returns:

size_t


function ~FreqTable

inline barry::FreqTable::~FreqTable () 


The documentation for this class was generated from the following file include/barry/freqtable.hpp