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

Powerset of a binary array. More...

#include <powerset-bones.hpp>

Collaboration diagram for PowerSet< Array_Type, Data_Rule_Type >:

Public Member Functions

void init_support ()
 
void calc ()
 
void reset (size_t N_, size_t M_)
 
Construct and destroy a PowerSet object
 PowerSet ()
 
 PowerSet (size_t N_, size_t M_)
 
 PowerSet (const Array_Type &array)
 
 ~PowerSet ()
 
Wrappers for the <tt>Rules</tt> member.

These will add rules to the model, which are shared by the support and the actual counter function.

void add_rule (Rule< Array_Type, Data_Rule_Type > rule)
 
void add_rule (Rule_fun_type< Array_Type, Data_Rule_Type > count_fun_, Data_Rule_Type data_)
 
Getter functions
const std::vector< Array_Type > * get_data_ptr () const
 
std::vector< Array_Type > get_data () const
 
std::vector< Array_Type >::iterator begin ()
 
std::vector< Array_Type >::iterator end ()
 
std::size_t size () const noexcept
 
const Array_Type & operator[] (const size_t &i) const
 

Public Attributes

Array_Type EmptyArray
 
std::vector< Array_Type > data
 
Rules< Array_Type, Data_Rule_Type > * rules
 
size_t N
 
size_t M
 
bool rules_deleted = false
 
std::vector< size_t > coordinates_free
 
std::vector< size_t > coordinates_locked
 
size_t n_free
 
size_t n_locked
 

Detailed Description

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
class PowerSet< Array_Type, Data_Rule_Type >

Powerset of a binary array.

Template Parameters
Array_Type
Data_Rule_Type

Definition at line 11 of file powerset-bones.hpp.

Constructor & Destructor Documentation

◆ PowerSet() [1/3]

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
PowerSet< Array_Type, Data_Rule_Type >::PowerSet ( )
inline

Definition at line 36 of file powerset-bones.hpp.

◆ PowerSet() [2/3]

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
PowerSet< Array_Type, Data_Rule_Type >::PowerSet ( size_t  N_,
size_t  M_ 
)
inline

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

◆ PowerSet() [3/3]

template<typename Array_Type , typename Data_Rule_Type >
PowerSet< Array_Type, Data_Rule_Type >::PowerSet ( const Array_Type &  array)
inline

Definition at line 5 of file powerset-meat.hpp.

◆ ~PowerSet()

template<typename Array_Type , typename Data_Rule_Type >
PowerSet< Array_Type, Data_Rule_Type >::~PowerSet
inline

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

Member Function Documentation

◆ add_rule() [1/2]

template<typename Array_Type , typename Data_Rule_Type >
void PowerSet< Array_Type, Data_Rule_Type >::add_rule ( Rule< Array_Type, Data_Rule_Type >  rule)
inline

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

◆ add_rule() [2/2]

template<typename Array_Type , typename Data_Rule_Type >
void PowerSet< Array_Type, Data_Rule_Type >::add_rule ( Rule_fun_type< Array_Type, Data_Rule_Type >  count_fun_,
Data_Rule_Type  data_ 
)
inline

Definition at line 189 of file powerset-meat.hpp.

◆ begin()

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
std::vector< Array_Type >::iterator PowerSet< Array_Type, Data_Rule_Type >::begin ( )
inline

Definition at line 68 of file powerset-bones.hpp.

◆ calc()

template<typename Array_Type , typename Data_Rule_Type >
void PowerSet< Array_Type, Data_Rule_Type >::calc
inline

Definition at line 151 of file powerset-meat.hpp.

◆ end()

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
std::vector< Array_Type >::iterator PowerSet< Array_Type, Data_Rule_Type >::end ( )
inline

Definition at line 69 of file powerset-bones.hpp.

◆ get_data()

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
std::vector< Array_Type > PowerSet< Array_Type, Data_Rule_Type >::get_data ( ) const
inline

Definition at line 67 of file powerset-bones.hpp.

◆ get_data_ptr()

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
const std::vector< Array_Type >* PowerSet< Array_Type, Data_Rule_Type >::get_data_ptr ( ) const
inline

Definition at line 66 of file powerset-bones.hpp.

◆ init_support()

template<typename Array_Type , typename Data_Rule_Type >
void PowerSet< Array_Type, Data_Rule_Type >::init_support
inline

Definition at line 19 of file powerset-meat.hpp.

◆ operator[]()

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
const Array_Type& PowerSet< Array_Type, Data_Rule_Type >::operator[] ( const size_t &  i) const
inline

Definition at line 71 of file powerset-bones.hpp.

◆ reset()

template<typename Array_Type , typename Data_Rule_Type >
void PowerSet< Array_Type, Data_Rule_Type >::reset ( size_t  N_,
size_t  M_ 
)
inline

Definition at line 167 of file powerset-meat.hpp.

◆ size()

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

Definition at line 70 of file powerset-bones.hpp.

Member Data Documentation

◆ coordinates_free

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
std::vector< size_t > PowerSet< Array_Type, Data_Rule_Type >::coordinates_free

Definition at line 26 of file powerset-bones.hpp.

◆ coordinates_locked

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
std::vector< size_t > PowerSet< Array_Type, Data_Rule_Type >::coordinates_locked

Definition at line 27 of file powerset-bones.hpp.

◆ data

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
std::vector< Array_Type > PowerSet< Array_Type, Data_Rule_Type >::data

Definition at line 19 of file powerset-bones.hpp.

◆ EmptyArray

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
Array_Type PowerSet< Array_Type, Data_Rule_Type >::EmptyArray

Definition at line 18 of file powerset-bones.hpp.

◆ M

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
size_t PowerSet< Array_Type, Data_Rule_Type >::M

Definition at line 22 of file powerset-bones.hpp.

◆ N

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
size_t PowerSet< Array_Type, Data_Rule_Type >::N

Definition at line 22 of file powerset-bones.hpp.

◆ n_free

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
size_t PowerSet< Array_Type, Data_Rule_Type >::n_free

Definition at line 28 of file powerset-bones.hpp.

◆ n_locked

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
size_t PowerSet< Array_Type, Data_Rule_Type >::n_locked

Definition at line 29 of file powerset-bones.hpp.

◆ rules

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
Rules<Array_Type,Data_Rule_Type>* PowerSet< Array_Type, Data_Rule_Type >::rules

Definition at line 20 of file powerset-bones.hpp.

◆ rules_deleted

template<typename Array_Type = BArray<>, typename Data_Rule_Type = bool>
bool PowerSet< Array_Type, Data_Rule_Type >::rules_deleted = false

Definition at line 23 of file powerset-bones.hpp.


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