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

Vector of counters. More...

#include <counters-bones.hpp>

Public Member Functions

 Counters ()
 
 ~Counters ()
 
 Counters (const Counters< Array_Type, Data_Type > &counter_)
 Copy constructor. More...
 
 Counters (Counters< Array_Type, Data_Type > &&counters_) noexcept
 Move constructor. More...
 
Counters< Array_Type, Data_Type > operator= (const Counters< Array_Type, Data_Type > &counter_)
 Copy assignment constructor. More...
 
Counters< Array_Type, Data_Type > & operator= (Counters< Array_Type, Data_Type > &&counter_) noexcept
 Move assignment constructor. More...
 
Counter< Array_Type, Data_Type > & operator[] (size_t idx)
 Returns a pointer to a particular counter. More...
 
std::size_t size () const noexcept
 Number of counters in the set. More...
 
void add_counter (Counter< Array_Type, Data_Type > counter)
 
void add_counter (Counter_fun_type< Array_Type, Data_Type > count_fun_, Counter_fun_type< Array_Type, Data_Type > init_fun_, Hasher_fun_type< Array_Type, Data_Type > hasher_fun_, Data_Type data_, std::string name_="", std::string desc_="")
 
std::vector< std::string > get_names () const
 
std::vector< std::string > get_descriptions () const
 
std::vector< double > gen_hash (const Array_Type &array, bool add_dims=true)
 Generates a hash for the given array according to the counters. More...
 
void add_hash (Hasher_fun_type< Array_Type, Data_Type > fun_)
 

Detailed Description

template<typename Array_Type = BArray<>, typename Data_Type = bool>
class Counters< Array_Type, Data_Type >

Vector of counters.

Various functions hold more than one counter, so this class is a helper class that allows managing multiple counters efficiently. The main data is a vector to pointers of counters.

Definition at line 108 of file counters-bones.hpp.

Constructor & Destructor Documentation

◆ Counters() [1/3]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counters< Array_Type, Data_Type >::Counters ( )

◆ ~Counters()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counters< Array_Type, Data_Type >::~Counters ( )
inline

Definition at line 120 of file counters-bones.hpp.

◆ Counters() [2/3]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counters< Array_Type, Data_Type >::Counters ( const Counters< Array_Type, Data_Type > &  counter_)

Copy constructor.

Parameters
counter_

◆ Counters() [3/3]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counters< Array_Type, Data_Type >::Counters ( Counters< Array_Type, Data_Type > &&  counters_)
noexcept

Move constructor.

Parameters
counters_

Member Function Documentation

◆ add_counter() [1/2]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
void Counters< Array_Type, Data_Type >::add_counter ( Counter< Array_Type, Data_Type >  counter)

◆ add_counter() [2/2]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
void Counters< Array_Type, Data_Type >::add_counter ( Counter_fun_type< Array_Type, Data_Type >  count_fun_,
Counter_fun_type< Array_Type, Data_Type >  init_fun_,
Hasher_fun_type< Array_Type, Data_Type >  hasher_fun_,
Data_Type  data_,
std::string  name_ = "",
std::string  desc_ = "" 
)

◆ add_hash()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
void Counters< Array_Type, Data_Type >::add_hash ( Hasher_fun_type< Array_Type, Data_Type >  fun_)

◆ gen_hash()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::vector< double > Counters< Array_Type, Data_Type >::gen_hash ( const Array_Type &  array,
bool  add_dims = true 
)

Generates a hash for the given array according to the counters.

Parameters
array
add_dimsWhen true (default) the dimmension of the array will be added to the hash.
Returns
std::vector< double > That can be hashed later.

◆ get_descriptions()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::vector< std::string > Counters< Array_Type, Data_Type >::get_descriptions ( ) const

◆ get_names()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::vector< std::string > Counters< Array_Type, Data_Type >::get_names ( ) const

◆ operator=() [1/2]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counters<Array_Type,Data_Type> Counters< Array_Type, Data_Type >::operator= ( const Counters< Array_Type, Data_Type > &  counter_)

Copy assignment constructor.

Parameters
counter_
Returns
Counters<Array_Type,Data_Type>

◆ operator=() [2/2]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counters<Array_Type,Data_Type>& Counters< Array_Type, Data_Type >::operator= ( Counters< Array_Type, Data_Type > &&  counter_)
noexcept

Move assignment constructor.

Parameters
counter_
Returns
Counters<Array_Type,Data_Type>&

◆ operator[]()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counter<Array_Type,Data_Type>& Counters< Array_Type, Data_Type >::operator[] ( size_t  idx)

Returns a pointer to a particular counter.

Parameters
idxId of the counter
Returns
Counter<Array_Type,Data_Type>*

◆ size()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::size_t Counters< Array_Type, Data_Type >::size ( ) const
inlinenoexcept

Number of counters in the set.

Returns
size_t

Definition at line 164 of file counters-bones.hpp.


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