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

Go to the source code of this file.

Macros

#define MAKE_DEFM_HASHER(hasher, a, cov)
 Data for the counters. More...
 
#define DEFM_RULEDYN_LAMBDA(a)
 
#define UNI_SUB(a)
 
Macros for defining counters
#define DEFM_COUNTER(a)   inline double (a) (const DEFMArray & Array, size_t i, size_t j, DEFMCounterData & data)
 
#define DEFM_COUNTER_LAMBDA(a)
 
Macros for defining rules
#define DEFM_RULE(a)   inline bool (a) (const DEFMArray & Array, size_t i, size_t j, bool & data)
 
#define DEFM_RULE_LAMBDA(a)
 

Functions

void counter_ones (DEFMCounters *counters, int covar_index=-1, std::string vname="", const std::vector< std::string > *x_names=nullptr)
 Prevalence of ones. More...
 
void counter_logit_intercept (DEFMCounters *counters, size_t n_y, std::vector< size_t > which={}, int covar_index=-1, std::string vname="", const std::vector< std::string > *x_names=nullptr, const std::vector< std::string > *y_names=nullptr)
 
void counter_transition (DEFMCounters *counters, std::vector< size_t > coords, std::vector< bool > signs, size_t m_order, size_t n_y, int covar_index=-1, std::string vname="", const std::vector< std::string > *x_names=nullptr, const std::vector< std::string > *y_names=nullptr)
 Prevalence of ones. More...
 
void counter_transition_formula (DEFMCounters *counters, std::string formula, size_t m_order, size_t n_y, int covar_index=-1, std::string vname="", const std::vector< std::string > *x_names=nullptr, const std::vector< std::string > *y_names=nullptr)
 Prevalence of ones. More...
 
void counter_fixed_effect (DEFMCounters *counters, int covar_index, double k, std::string vname="", const std::vector< std::string > *x_names=nullptr)
 Prevalence of ones. More...
 
Returns true if the cell is free
Parameters
rulesA pointer to a DEFMRules object (Rules<DEFMArray, bool>).
void rules_markov_fixed (DEFMRules *rules, size_t markov_order)
 Number of edges. More...
 
void rules_dont_become_zero (DEFMSupport *support, std::vector< size_t > ids)
 Blocks switching a one to zero. More...
 
void rule_constrain_support (DEFMSupport *support, size_t pos, double lb, double ub)
 Overall functional gains. More...
 

Macro Definition Documentation

◆ DEFM_COUNTER

#define DEFM_COUNTER (   a)    inline double (a) (const DEFMArray & Array, size_t i, size_t j, DEFMCounterData & data)

Function for definition of a network counter function

Definition at line 47 of file counters.hpp.

◆ DEFM_COUNTER_LAMBDA

#define DEFM_COUNTER_LAMBDA (   a)
Value:
barry::Counter_fun_type<DEFMArray, DEFMCounterData> a = \
[](const DEFMArray & Array, size_t i, size_t j, DEFMCounterData & data) -> double
Data class used to store arbitrary size_t or double vectors.
Definition: defm-types.hpp:66
Data_Type &&counter_ data(std::move(counter_.data))
size_t size_t j
size_t i
barry::BArrayDense< int, DEFMData > DEFMArray
Definition: defm-types.hpp:3

Lambda function for definition of a network counter function

Definition at line 51 of file counters.hpp.

◆ DEFM_RULE

#define DEFM_RULE (   a)    inline bool (a) (const DEFMArray & Array, size_t i, size_t j, bool & data)

Function for definition of a network counter function

Definition at line 61 of file counters.hpp.

◆ DEFM_RULE_LAMBDA

#define DEFM_RULE_LAMBDA (   a)
Value:
barry::Rule_fun_type<DEFMArray, DEFMRuleData> a = \
[](const DEFMArray & Array, size_t i, size_t j, DEFMRuleData & data) -> bool

Lambda function for definition of a network counter function

Definition at line 65 of file counters.hpp.

◆ DEFM_RULEDYN_LAMBDA

#define DEFM_RULEDYN_LAMBDA (   a)
Value:
barry::Rule_fun_type<DEFMArray, DEFMRuleDynData> a = \
[](const DEFMArray & Array, size_t i, size_t j, DEFMRuleDynData & data) -> bool

Lambda function for definition of a network counter function

Definition at line 71 of file counters.hpp.

◆ UNI_SUB

#define UNI_SUB (   a)
Value:
(\
((a) == 0) ? u8"\u2080" : (\
((a) == 1) ? u8"\u2081" : (\
((a) == 2) ? u8"\u2082" : (\
((a) == 3) ? u8"\u2083" : (\
((a) == 4) ? u8"\u2084" : (\
((a) == 5) ? u8"\u2085" : (\
((a) == 6) ? u8"\u2086" : (\
((a) == 7) ? u8"\u2087" : (\
((a) == 8) ? u8"\u2088" : \
u8"\u2089"))))))))\
)