barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
counters-meat.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COUNTER_TYPE()   Counter<Array_Type,Data_Type>
 
#define COUNTER_TEMPLATE_ARGS()   <typename Array_Type, typename Data_Type>
 
#define COUNTER_TEMPLATE(a, b)    template COUNTER_TEMPLATE_ARGS() inline a COUNTER_TYPE()::b
 
#define TMP_HASHER_CALL   Hasher_fun_type<Array_Type,Data_Type>
 
#define COUNTERS_TYPE()   Counters<Array_Type,Data_Type>
 
#define COUNTERS_TEMPLATE_ARGS()   <typename Array_Type, typename Data_Type>
 
#define COUNTERS_TEMPLATE(a, b)    template COUNTERS_TEMPLATE_ARGS() inline a COUNTERS_TYPE()::b
 

Functions

 COUNTER_TEMPLATE (, Counter)(const Counter< Array_Type
 
Data_Type init_fun (counter_.init_fun)
 
Data_Type hasher_fun (counter_.hasher_fun)
 
Data_Type &&counter_ init_fun (std::move(counter_.init_fun))
 
Data_Type &&counter_ hasher_fun (std::move(counter_.hasher_fun))
 
Data_Type &&counter_ data (std::move(counter_.data))
 
Data_Type &&counter_ name (std::move(counter_.name))
 
Data_Type &&counter_ desc (std::move(counter_.desc))
 Move constructor. More...
 
 COUNTER_TEMPLATE (COUNTER_TYPE(), operator=)(const Counter< Array_Type
 
 COUNTER_TEMPLATE (COUNTER_TYPE() &, operator=)(Counter< Array_Type
 
 COUNTER_TEMPLATE (double, count)(Array_Type &Array
 < Move assignment More...
 
return count_fun (Array, i, j, data)
 
 COUNTER_TEMPLATE (double, init)(Array_Type &Array
 
return init_fun (Array, i, j, data)
 
 COUNTER_TEMPLATE (std::string, get_name)() const
 
 COUNTER_TEMPLATE (std::string, get_description)() const
 
 COUNTER_TEMPLATE (void, set_hasher)(Hasher_fun_type< Array_Type
 
 COUNTER_TEMPLATE (TMP_HASHER_CALL, get_hasher)()
 
 COUNTERS_TEMPLATE (, Counters)()
 
 COUNTERS_TEMPLATE (COUNTER_TYPE() &, operator[])(size_t idx)
 
Data_Type hasher (counter_.hasher)
 
Data_Type &&counters_ hasher (std::move(counters_.hasher))
 
 COUNTERS_TEMPLATE (COUNTERS_TYPE(), operator=)(const Counters< Array_Type
 
 COUNTERS_TEMPLATE (COUNTERS_TYPE() &, operator=)(Counters< Array_Type
 
 COUNTERS_TEMPLATE (void, add_counter)(Counter< Array_Type
 
 COUNTERS_TEMPLATE (std::vector< std::string >, get_names)() const
 
 COUNTERS_TEMPLATE (std::vector< std::string >, get_descriptions)() const
 
 COUNTERS_TEMPLATE (std::vector< double >, gen_hash)(const Array_Type &array
 
 for (auto &c:data)
 
 if (add_dims)
 
 if (hasher)
 
 if (res.size()==0u) res.push_back(0.0)
 
 COUNTERS_TEMPLATE (void, add_hash)(Hasher_fun_type< Array_Type
 

Variables

Data_Type & counter_
 
Data_Type &&counter_ noexcept
 
size_t i
 
size_t size_t j
 
Data_Type fun
 
Data_Type counter
 
 return
 
Data_Type count_fun_
 
Data_Type Counter_fun_type< Array_Type, Data_Type > init_fun_
 
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > hasher_fun_
 
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type data_
 
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string name_
 
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string std::string desc_
 
bool add_dims
 
return res
 
Data_Type fun_
 

Macro Definition Documentation

◆ COUNTER_TEMPLATE

#define COUNTER_TEMPLATE (   a,
 
)     template COUNTER_TEMPLATE_ARGS() inline a COUNTER_TYPE()::b

Definition at line 8 of file counters-meat.hpp.

◆ COUNTER_TEMPLATE_ARGS

#define COUNTER_TEMPLATE_ARGS ( )    <typename Array_Type, typename Data_Type>

Definition at line 6 of file counters-meat.hpp.

◆ COUNTER_TYPE

#define COUNTER_TYPE ( )    Counter<Array_Type,Data_Type>

Definition at line 4 of file counters-meat.hpp.

◆ COUNTERS_TEMPLATE

#define COUNTERS_TEMPLATE (   a,
 
)     template COUNTERS_TEMPLATE_ARGS() inline a COUNTERS_TYPE()::b

Definition at line 129 of file counters-meat.hpp.

◆ COUNTERS_TEMPLATE_ARGS

#define COUNTERS_TEMPLATE_ARGS ( )    <typename Array_Type, typename Data_Type>

Definition at line 127 of file counters-meat.hpp.

◆ COUNTERS_TYPE

#define COUNTERS_TYPE ( )    Counters<Array_Type,Data_Type>

Definition at line 125 of file counters-meat.hpp.

◆ TMP_HASHER_CALL

#define TMP_HASHER_CALL   Hasher_fun_type<Array_Type,Data_Type>

Definition at line 115 of file counters-meat.hpp.

Function Documentation

◆ count_fun()

return count_fun ( Array  ,
i  ,
j  ,
data   
)

◆ COUNTER_TEMPLATE() [1/9]

COUNTER_TEMPLATE ( Counter  ) const

◆ COUNTER_TEMPLATE() [2/9]

COUNTER_TEMPLATE ( COUNTER_TYPE() &  ,
operator   
)

◆ COUNTER_TEMPLATE() [3/9]

COUNTER_TEMPLATE ( COUNTER_TYPE()  ,
operator   
) const

◆ COUNTER_TEMPLATE() [4/9]

COUNTER_TEMPLATE ( double  ,
count   
) &

< Move assignment

◆ COUNTER_TEMPLATE() [5/9]

COUNTER_TEMPLATE ( double  ,
init   
) &

◆ COUNTER_TEMPLATE() [6/9]

COUNTER_TEMPLATE ( std::string  ,
get_description   
) const

Definition at line 107 of file counters-meat.hpp.

◆ COUNTER_TEMPLATE() [7/9]

COUNTER_TEMPLATE ( std::string  ,
get_name   
) const

Definition at line 103 of file counters-meat.hpp.

◆ COUNTER_TEMPLATE() [8/9]

COUNTER_TEMPLATE ( TMP_HASHER_CALL  ,
get_hasher   
)

Definition at line 116 of file counters-meat.hpp.

◆ COUNTER_TEMPLATE() [9/9]

COUNTER_TEMPLATE ( void  ,
set_hasher   
)

◆ COUNTERS_TEMPLATE() [1/9]

COUNTERS_TEMPLATE ( Counters  )

Definition at line 132 of file counters-meat.hpp.

◆ COUNTERS_TEMPLATE() [2/9]

COUNTERS_TEMPLATE ( COUNTER_TYPE() &  ,
operator  [] 
)

Definition at line 134 of file counters-meat.hpp.

◆ COUNTERS_TEMPLATE() [3/9]

COUNTERS_TEMPLATE ( COUNTERS_TYPE() &  ,
operator   
)

◆ COUNTERS_TEMPLATE() [4/9]

COUNTERS_TEMPLATE ( COUNTERS_TYPE()  ,
operator   
) const

◆ COUNTERS_TEMPLATE() [5/9]

COUNTERS_TEMPLATE ( std::vector< double >  ,
gen_hash   
) const &

◆ COUNTERS_TEMPLATE() [6/9]

COUNTERS_TEMPLATE ( std::vector< std::string >  ,
get_descriptions   
) const

Definition at line 213 of file counters-meat.hpp.

◆ COUNTERS_TEMPLATE() [7/9]

COUNTERS_TEMPLATE ( std::vector< std::string >  ,
get_names   
) const

Definition at line 201 of file counters-meat.hpp.

◆ COUNTERS_TEMPLATE() [8/9]

COUNTERS_TEMPLATE ( void  ,
add_counter   
)

◆ COUNTERS_TEMPLATE() [9/9]

COUNTERS_TEMPLATE ( void  ,
add_hash   
)

◆ data()

Data_Type&& counter_ data ( std::move(counter_.data)  )

◆ desc()

Data_Type&& counter_ desc ( std::move(counter_.desc)  )

Move constructor.

Definition at line 32 of file counters-meat.hpp.

◆ for()

for ( auto &c:data  )

Definition at line 233 of file counters-meat.hpp.

◆ hasher() [1/2]

Data_Type hasher ( counter_.  hasher)

Definition at line 141 of file counters-meat.hpp.

◆ hasher() [2/2]

Data_Type&& counters_ hasher ( std::move(counters_.hasher)  )

Definition at line 144 of file counters-meat.hpp.

◆ hasher_fun() [1/2]

Data_Type hasher_fun ( counter_.  hasher_fun)

Definition at line 13 of file counters-meat.hpp.

◆ hasher_fun() [2/2]

Data_Type&& counter_ hasher_fun ( std::move(counter_.hasher_fun)  )

◆ if() [1/3]

if ( add_dims  )

Definition at line 248 of file counters-meat.hpp.

◆ if() [2/3]

if ( hasher  )

Definition at line 255 of file counters-meat.hpp.

◆ if() [3/3]

if ( res.  size() = =0u)

◆ init_fun() [1/3]

return init_fun ( Array  ,
i  ,
j  ,
data   
)

◆ init_fun() [2/3]

Data_Type init_fun ( counter_.  init_fun)

◆ init_fun() [3/3]

Data_Type&& counter_ init_fun ( std::move(counter_.init_fun)  )

◆ name()

Data_Type&& counter_ name ( std::move(counter_.name)  )

Variable Documentation

◆ add_dims

bool add_dims
Initial value:
{
std::vector<double> res
return res

Definition at line 227 of file counters-meat.hpp.

◆ count_fun_

Data_Type count_fun_

Definition at line 179 of file counters-meat.hpp.

◆ counter

Data_Type counter
Initial value:
{
data.push_back(counter)
Data_Type &&counter_ data(std::move(counter_.data))
Data_Type counter

Definition at line 170 of file counters-meat.hpp.

◆ counter_

Data_Type & counter_
Initial value:
{
if (this != &counter_) {
this->count_fun = counter_.count_fun;
this->init_fun = counter_.init_fun;
this->hasher_fun = counter_.hasher_fun;
this->data = counter_.data;
this->name = counter_.name;
this->desc = counter_.desc;
}
return *this
Data_Type & counter_
Data_Type &&counter_ desc(std::move(counter_.desc))
Move constructor.
Data_Type &&counter_ name(std::move(counter_.name))
Data_Type init_fun(counter_.init_fun)
Data_Type hasher_fun(counter_.hasher_fun)
return count_fun(Array, i, j, data)

Definition at line 12 of file counters-meat.hpp.

◆ data_

Data_Type Counter_fun_type<Array_Type,Data_Type> Hasher_fun_type<Array_Type,Data_Type> Data_Type data_

Definition at line 182 of file counters-meat.hpp.

◆ desc_

Data_Type Counter_fun_type<Array_Type,Data_Type> Hasher_fun_type<Array_Type,Data_Type> Data_Type std::string std::string desc_
Initial value:
{
))
A counter function based on change statistics.
Data_Type count_fun_
Data_Type Counter_fun_type< Array_Type, Data_Type > init_fun_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > hasher_fun_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string std::string desc_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type std::string name_
Data_Type Counter_fun_type< Array_Type, Data_Type > Hasher_fun_type< Array_Type, Data_Type > Data_Type data_

Definition at line 184 of file counters-meat.hpp.

◆ fun

Data_Type fun
Initial value:
{
Data_Type fun

Definition at line 111 of file counters-meat.hpp.

◆ fun_

Data_Type fun_
Initial value:
{
Data_Type fun_
Data_Type hasher(counter_.hasher)

Definition at line 270 of file counters-meat.hpp.

◆ hasher_fun_

Data_Type Counter_fun_type<Array_Type,Data_Type> Hasher_fun_type<Array_Type,Data_Type> hasher_fun_

Definition at line 181 of file counters-meat.hpp.

◆ i

size_t i

Definition at line 83 of file counters-meat.hpp.

◆ init_fun_

Data_Type Counter_fun_type<Array_Type,Data_Type> init_fun_

Definition at line 180 of file counters-meat.hpp.

◆ j

size_t j
Initial value:
{
if (count_fun == nullptr)
return 0.0

Definition at line 83 of file counters-meat.hpp.

◆ name_

Data_Type Counter_fun_type<Array_Type,Data_Type> Hasher_fun_type<Array_Type,Data_Type> Data_Type std::string name_

Definition at line 183 of file counters-meat.hpp.

◆ noexcept

Data_Type &&counters_ noexcept
Initial value:
{
if (this != &counter_)
{
this->data = std::move(counter_.data);
this->count_fun = std::move(counter_.count_fun);
this->init_fun = std::move(counter_.init_fun);
this->hasher_fun = std::move(counter_.hasher_fun);
this->name = std::move(counter_.name);
this->desc = std::move(counter_.desc);
}
return *this

Definition at line 26 of file counters-meat.hpp.

◆ res

return res

Definition at line 265 of file counters-meat.hpp.

◆ return

return

Definition at line 175 of file counters-meat.hpp.