barry: Your go-to motif accountant
0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
|
Compute the support of sufficient statistics. More...
#include <support-bones.hpp>
Public Member Functions | |||||
Support (const Array_Type &Array_) | |||||
Constructor passing a reference Array. More... | |||||
Support (size_t N_, size_t M_) | |||||
Constructor specifying the dimensions of the array (empty). More... | |||||
Support () | |||||
~Support () | |||||
void | init_support (std::vector< Array_Type > *array_bank=nullptr, std::vector< double > *stats_bank=nullptr) | ||||
void | calc (std::vector< Array_Type > *array_bank=nullptr, std::vector< double > *stats_bank=nullptr, size_t max_num_elements_=0u) | ||||
Computes the entire support. More... | |||||
const std::vector< double > & | get_counts () const | ||||
std::vector< double > * | get_current_stats () | ||||
List current statistics. More... | |||||
void | print () const | ||||
const FreqTable< double > & | get_data () const | ||||
Counters< Array_Type, Data_Counter_Type > * | get_counters () | ||||
Vector of couter functions. More... | |||||
Rules< Array_Type, Data_Rule_Type > * | get_rules () | ||||
Vector of static rules (cells to iterate). More... | |||||
Rules< Array_Type, Data_Rule_Dyn_Type > * | get_rules_dyn () | ||||
Vector of dynamic rules (to include/exclude a realizaton). More... | |||||
Resets the support calculator | |||||
If needed, the counters of a support object can be reused.
| |||||
void | reset_array () | ||||
void | reset_array (const Array_Type &Array_) | ||||
Manage counters | |||||
| |||||
void | add_counter (Counter< Array_Type, Data_Counter_Type > f_) | ||||
void | set_counters (Counters< Array_Type, Data_Counter_Type > *counters_) | ||||
Manage rules | |||||
| |||||
void | add_rule (Rule< Array_Type, Data_Rule_Type > *f_) | ||||
void | add_rule (Rule< Array_Type, Data_Rule_Type > f_) | ||||
void | set_rules (Rules< Array_Type, Data_Rule_Type > *rules_) | ||||
void | add_rule_dyn (Rule< Array_Type, Data_Rule_Dyn_Type > *f_) | ||||
void | add_rule_dyn (Rule< Array_Type, Data_Rule_Dyn_Type > f_) | ||||
void | set_rules_dyn (Rules< Array_Type, Data_Rule_Dyn_Type > *rules_) | ||||
bool | eval_rules_dyn (const std::vector< double > &counts, const size_t &i, const size_t &j) | ||||
Public Attributes | |
size_t | N |
size_t | M |
bool | delete_counters = true |
bool | delete_rules = true |
bool | delete_rules_dyn = true |
size_t | max_num_elements = BARRY_MAX_NUM_ELEMENTS |
std::vector< double > | current_stats |
std::vector< size_t > | coordinates_free |
std::vector< size_t > | coordinates_locked |
size_t | coordiantes_n_free |
size_t | coordiantes_n_locked |
std::vector< double > | change_stats |
std::vector< size_t > | hashes |
std::vector< bool > | hashes_initialized |
size_t | n_counters |
Compute the support of sufficient statistics.
Given an array and a set of counters, this object iterates throughout the support set of the Array while at the same time computing the support of the sufficient statitics.
The members rule
and rule_dyn
allow constraining the support. The first will establish which cells of the array will be used to iterate, for example, in the case of social networks, self-loops are not allowed, so the entire diagonal would be fixed to zero, reducing the size of the support.
In the case of rule_dyn
, the function will stablish dynamically whether the current state will be included in the counts or not. For example, this set of rules can be used to constrain the support to networks that have a prescribed degree sequence.
Definition at line 42 of file support-bones.hpp.
|
inline |
Constructor passing a reference Array.
Definition at line 89 of file support-bones.hpp.
|
inline |
Constructor specifying the dimensions of the array (empty).
Definition at line 98 of file support-bones.hpp.
|
inline |
Definition at line 105 of file support-bones.hpp.
|
inline |
Definition at line 112 of file support-bones.hpp.
|
inline |
Definition at line 417 of file support-meat.hpp.
|
inline |
Definition at line 444 of file support-meat.hpp.
|
inline |
Definition at line 454 of file support-meat.hpp.
|
inline |
Definition at line 479 of file support-meat.hpp.
|
inline |
Definition at line 489 of file support-meat.hpp.
|
inline |
Computes the entire support.
Not to be used by the user. Sets the starting point in the array (column-major).
array_bank | If specified, the counter will add to the vector each possible state of the array, as it counts. |
stats_bank | If specified, the counter will add to the vector each possible set of statistics, as it counts. |
Definition at line 383 of file support-meat.hpp.
|
inline |
Definition at line 514 of file support-meat.hpp.
|
inline |
Vector of couter functions.
Definition at line 593 of file support-meat.hpp.
|
inline |
Definition at line 557 of file support-meat.hpp.
|
inline |
List current statistics.
Definition at line 571 of file support-meat.hpp.
|
inline |
Definition at line 588 of file support-meat.hpp.
|
inline |
Vector of static rules (cells to iterate).
Definition at line 598 of file support-meat.hpp.
|
inline |
Vector of dynamic rules (to include/exclude a realizaton).
Definition at line 603 of file support-meat.hpp.
|
inline |
Definition at line 5 of file support-meat.hpp.
|
inline |
Definition at line 576 of file support-meat.hpp.
|
inline |
Definition at line 111 of file support-meat.hpp.
|
inline |
Definition at line 118 of file support-meat.hpp.
|
inline |
Definition at line 427 of file support-meat.hpp.
|
inline |
Definition at line 464 of file support-meat.hpp.
|
inline |
Definition at line 499 of file support-meat.hpp.
std::vector< double > Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::change_stats |
Definition at line 82 of file support-bones.hpp.
size_t Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::coordiantes_n_free |
Definition at line 80 of file support-bones.hpp.
size_t Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::coordiantes_n_locked |
Definition at line 81 of file support-bones.hpp.
std::vector< size_t > Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::coordinates_free |
Definition at line 78 of file support-bones.hpp.
std::vector< size_t > Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::coordinates_locked |
Definition at line 79 of file support-bones.hpp.
std::vector< double > Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::current_stats |
Definition at line 77 of file support-bones.hpp.
bool Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::delete_counters = true |
Definition at line 71 of file support-bones.hpp.
bool Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::delete_rules = true |
Definition at line 72 of file support-bones.hpp.
bool Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::delete_rules_dyn = true |
Definition at line 73 of file support-bones.hpp.
std::vector< size_t > Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::hashes |
Definition at line 83 of file support-bones.hpp.
std::vector< bool > Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::hashes_initialized |
Definition at line 84 of file support-bones.hpp.
size_t Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::M |
Definition at line 70 of file support-bones.hpp.
size_t Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::max_num_elements = BARRY_MAX_NUM_ELEMENTS |
Definition at line 74 of file support-bones.hpp.
size_t Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::N |
Definition at line 70 of file support-bones.hpp.
size_t Support< Array_Type, Data_Counter_Type, Data_Rule_Type, Data_Rule_Dyn_Type >::n_counters |
Definition at line 85 of file support-bones.hpp.