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

Go to the source code of this file.

Classes

class  NetworkData
 Data class for Networks. More...
 
class  NetCounterData
 Data class used to store arbitrary size_t or double vectors. More...
 

Macros

#define NET_C_DATA_IDX(i)   (data.indices[i])
 
#define NET_C_DATA_NUM(i)   (data.numbers[i])
 
Macros for defining counters
#define NETWORK_COUNTER(a)
 
#define NETWORK_COUNTER_LAMBDA(a)
 
#define NETWORKDENSE_COUNTER_LAMBDA(a)
 
Macros for defining rules
#define NETWORK_RULE(a)
 
#define NETWORK_RULE_LAMBDA(a)
 

Functions

template<typename Tnet = Network>
void counter_edges (NetCounters< Tnet > *counters)
 Number of edges. More...
 
template<typename Tnet = Network>
void counter_isolates (NetCounters< Tnet > *counters)
 Number of isolated vertices. More...
 
template<>
void counter_isolates (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_mutual (NetCounters< Tnet > *counters)
 Number of mutual ties. More...
 
template<typename Tnet = Network>
void counter_istar2 (NetCounters< Tnet > *counters)
 
template<>
void counter_istar2 (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_ostar2 (NetCounters< Tnet > *counters)
 
template<>
void counter_ostar2 (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_ttriads (NetCounters< Tnet > *counters)
 
template<>
void counter_ttriads (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_ctriads (NetCounters< Tnet > *counters)
 
template<>
void counter_ctriads (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_density (NetCounters< Tnet > *counters)
 
template<typename Tnet = Network>
void counter_idegree15 (NetCounters< Tnet > *counters)
 
template<>
void counter_idegree15 (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_odegree15 (NetCounters< Tnet > *counters)
 
template<>
void counter_odegree15 (NetCounters< NetworkDense > *counters)
 
template<typename Tnet = Network>
void counter_absdiff (NetCounters< Tnet > *counters, size_t attr_id, double alpha=1.0)
 Sum of absolute attribute difference between ego and alter. More...
 
template<typename Tnet = Network>
void counter_diff (NetCounters< Tnet > *counters, size_t attr_id, double alpha=1.0, double tail_head=true)
 Sum of attribute difference between ego and alter to pow(alpha) More...
 
 NETWORK_COUNTER (init_single_attr)
 
template<typename Tnet = Network>
void counter_nodeicov (NetCounters< Tnet > *counters, size_t attr_id)
 
template<typename Tnet = Network>
void counter_nodeocov (NetCounters< Tnet > *counters, size_t attr_id)
 
template<typename Tnet = Network>
void counter_nodecov (NetCounters< Tnet > *counters, size_t attr_id)
 
template<typename Tnet = Network>
void counter_nodematch (NetCounters< Tnet > *counters, size_t attr_id)
 
template<typename Tnet = Network>
void counter_idegree (NetCounters< Tnet > *counters, std::vector< size_t > d)
 Counts number of vertices with a given in-degree. More...
 
template<>
void counter_idegree (NetCounters< NetworkDense > *counters, std::vector< size_t > d)
 
template<typename Tnet = Network>
void counter_odegree (NetCounters< Tnet > *counters, std::vector< size_t > d)
 Counts number of vertices with a given out-degree. More...
 
template<>
void counter_odegree (NetCounters< NetworkDense > *counters, std::vector< size_t > d)
 
template<typename Tnet = Network>
void counter_degree (NetCounters< Tnet > *counters, std::vector< size_t > d)
 Counts number of vertices with a given out-degree. More...
 
Rules for network models
Parameters
rulesA pointer to a NetRules object (Rules<Network, bool>).
template<typename Tnet = Network>
void rules_zerodiag (NetRules< Tnet > *rules)
 Number of edges. More...
 

Convenient typedefs for network objects.

#define BARRY_ZERO_NETWORK   0.0
 
#define BARRY_ZERO_NETWORK_DENSE   0
 
typedef BArray< double, NetworkDataNetwork
 
typedef BArrayDense< int, NetworkDataNetworkDense
 
template<typename Tnet = Network>
using NetCounter = Counter< Tnet, NetCounterData >
 
template<typename Tnet = Network>
using NetCounters = Counters< Tnet, NetCounterData >
 
template<typename Tnet = Network>
using NetSupport = Support< Tnet, NetCounterData >
 
template<typename Tnet = Network>
using NetStatsCounter = StatsCounter< Tnet, NetCounterData >
 
template<typename Tnet >
using NetModel = Model< Tnet, NetCounterData >
 
template<typename Tnet = Network>
using NetRule = Rule< Tnet, bool >
 
template<typename Tnet = Network>
using NetRules = Rules< Tnet, bool >
 

Macro Definition Documentation

◆ BARRY_ZERO_NETWORK

#define BARRY_ZERO_NETWORK   0.0

Definition at line 85 of file network.hpp.

◆ BARRY_ZERO_NETWORK_DENSE

#define BARRY_ZERO_NETWORK_DENSE   0

Definition at line 86 of file network.hpp.

◆ NET_C_DATA_IDX

#define NET_C_DATA_IDX (   i)    (data.indices[i])

Definition at line 74 of file network.hpp.

◆ NET_C_DATA_NUM

#define NET_C_DATA_NUM (   i)    (data.numbers[i])

Definition at line 75 of file network.hpp.

◆ NETWORK_COUNTER

#define NETWORK_COUNTER (   a)
Value:
template<typename Tnet = Network>\
inline double (a) (const Tnet & Array, size_t i, size_t j, NetCounterData & data)
Data class used to store arbitrary size_t or double vectors.
Definition: network.hpp:56
Data_Type &&counter_ data(std::move(counter_.data))
size_t size_t j
size_t i

Function for definition of a network counter function

Definition at line 114 of file network.hpp.

◆ NETWORK_COUNTER_LAMBDA

#define NETWORK_COUNTER_LAMBDA (   a)
Value:
[](const Tnet & Array, size_t i, size_t j, NetCounterData & data)
std::function< double(const Array_Type &, size_t, size_t, Data_Type &)> Counter_fun_type
Counter and rule functions.
Definition: typedefs.hpp:187

Lambda function for definition of a network counter function

Definition at line 119 of file network.hpp.

◆ NETWORK_RULE

#define NETWORK_RULE (   a)
Value:
template<typename Tnet = Network>\
inline bool (a) (const Tnet & Array, size_t i, size_t j, bool & data)

Function for definition of a network counter function

Definition at line 133 of file network.hpp.

◆ NETWORK_RULE_LAMBDA

#define NETWORK_RULE_LAMBDA (   a)
Value:
[](const Tnet & Array, size_t i, size_t j, bool & data)
std::function< bool(const Array_Type &, size_t, size_t, Data_Type &)> Rule_fun_type
Definition: typedefs.hpp:190

Lambda function for definition of a network counter function

Definition at line 138 of file network.hpp.

◆ NETWORKDENSE_COUNTER_LAMBDA

#define NETWORKDENSE_COUNTER_LAMBDA (   a)
Value:
[](const NetworkDense & Array, size_t i, size_t j, NetCounterData & data)
Baseline class for binary arrays.

Definition at line 123 of file network.hpp.

Typedef Documentation

◆ NetCounter

template<typename Tnet = Network>
using NetCounter = Counter<Tnet, NetCounterData >

Definition at line 89 of file network.hpp.

◆ NetCounters

template<typename Tnet = Network>
using NetCounters = Counters<Tnet, NetCounterData>

Definition at line 92 of file network.hpp.

◆ NetModel

template<typename Tnet >
using NetModel = Model<Tnet, NetCounterData>

Definition at line 101 of file network.hpp.

◆ NetRule

template<typename Tnet = Network>
using NetRule = Rule<Tnet, bool>

Definition at line 104 of file network.hpp.

◆ NetRules

template<typename Tnet = Network>
using NetRules = Rules<Tnet, bool>

Definition at line 107 of file network.hpp.

◆ NetStatsCounter

template<typename Tnet = Network>
using NetStatsCounter = StatsCounter<Tnet, NetCounterData>

Definition at line 98 of file network.hpp.

◆ NetSupport

template<typename Tnet = Network>
using NetSupport = Support<Tnet, NetCounterData >

Definition at line 95 of file network.hpp.

◆ Network

typedef BArray<double, NetworkData> Network

Definition at line 82 of file network.hpp.

◆ NetworkDense

Definition at line 83 of file network.hpp.

Function Documentation

◆ rules_zerodiag()

template<typename Tnet = Network>
void rules_zerodiag ( NetRules< Tnet > *  rules)
inline

Number of edges.

Definition at line 1381 of file network.hpp.