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

A counter function based on change statistics. More...

#include <counters-bones.hpp>

Public Member Functions

 ~Counter ()
 
double count (Array_Type &Array, size_t i, size_t j)
 
double init (Array_Type &Array, size_t i, size_t j)
 
std::string get_name () const
 
std::string get_description () const
 
Creator passing a counter and an initializer
Parameters
count_fun_The main counter function.
init_fun_The initializer function can also be used to check if the BArray as the needed variables (see BArray::data).
data_Data to be used with the counter.
delete_data_When true, the destructor will delete the pointer in the main data.
 Counter ()
 
 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_="")
 
 Counter (const Counter< Array_Type, Data_Type > &counter_)
 Copy constructor. More...
 
 Counter (Counter< Array_Type, Data_Type > &&counter_) noexcept
 Move constructor. More...
 
Counter< Array_Type, Data_Type > operator= (const Counter< Array_Type, Data_Type > &counter_)
 Copy assignment. More...
 
Counter< Array_Type, Data_Type > & operator= (Counter< Array_Type, Data_Type > &&counter_) noexcept
 Move assignment. More...
 
void set_hasher (Hasher_fun_type< Array_Type, Data_Type > fun)
 Get and set the hasher function. More...
 
Hasher_fun_type< Array_Type, Data_Type > get_hasher ()
 

Public Attributes

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 = ""
 

Detailed Description

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

A counter function based on change statistics.

This class is used by CountStats and StatsCounter as a way to count statistics using change statistics.

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

Constructor & Destructor Documentation

◆ Counter() [1/4]

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

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

◆ Counter() [2/4]

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counter< Array_Type, Data_Type >::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_ = "" 
)
inline

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

◆ Counter() [3/4]

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

Copy constructor.

◆ Counter() [4/4]

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

Move constructor.

◆ ~Counter()

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

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

Member Function Documentation

◆ count()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
double Counter< Array_Type, Data_Type >::count ( Array_Type &  Array,
size_t  i,
size_t  j 
)

◆ get_description()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::string Counter< Array_Type, Data_Type >::get_description ( ) const

◆ get_hasher()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Hasher_fun_type<Array_Type,Data_Type> Counter< Array_Type, Data_Type >::get_hasher ( )

◆ get_name()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::string Counter< Array_Type, Data_Type >::get_name ( ) const

◆ init()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
double Counter< Array_Type, Data_Type >::init ( Array_Type &  Array,
size_t  i,
size_t  j 
)

◆ operator=() [1/2]

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

Copy assignment.

◆ operator=() [2/2]

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

Move assignment.

◆ set_hasher()

template<typename Array_Type = BArray<>, typename Data_Type = bool>
void Counter< Array_Type, Data_Type >::set_hasher ( Hasher_fun_type< Array_Type, Data_Type >  fun)

Get and set the hasher function.

The hasher function is used to characterize the support of the array. This way, if possible, the support enumeration is recycled.

Parameters
fun

Member Data Documentation

◆ count_fun

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counter_fun_type<Array_Type,Data_Type> Counter< Array_Type, Data_Type >::count_fun

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

◆ data

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Data_Type Counter< Array_Type, Data_Type >::data

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

◆ desc

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::string Counter< Array_Type, Data_Type >::desc = ""

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

◆ hasher_fun

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Hasher_fun_type<Array_Type,Data_Type> Counter< Array_Type, Data_Type >::hasher_fun

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

◆ init_fun

template<typename Array_Type = BArray<>, typename Data_Type = bool>
Counter_fun_type<Array_Type,Data_Type> Counter< Array_Type, Data_Type >::init_fun

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

◆ name

template<typename Array_Type = BArray<>, typename Data_Type = bool>
std::string Counter< Array_Type, Data_Type >::name = ""

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


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