Multivariate Point Process Package  0.1
Classes | Public Member Functions | Public Attributes | List of all members
Graph Class Reference

Graph represents a given diffusion network structure. More...

#include "include/Graph.h"

Classes

struct  Node
 Defines a single node object. More...
 
struct  Parameter
 The parameter of the pairwise Weibull distribution for the respective diffusion time. More...
 

Public Member Functions

 Graph (const std::string &graph_filename, unsigned num_nodes, bool reverse)
 The constructor. More...
 
 ~Graph ()
 
void PrintWeibullFormatNetwork ()
 Prints the edges of the loaded diffusion network structure. More...
 
void SampleEdgeWeightWbl ()
 Samples the pairwise diffusion time from the corresponding Weibull distribution. More...
 
std::pair< unsigned, unsigned > MaximumOutDegree ()
 Gets the node with the maximum degree. More...
 

Public Attributes

unsigned N
 The total number of nodes of a diffusion network. More...
 
std::vector< Nodenodes
 The set of nodes of the given diffusion network. More...
 
std::map< unsigned, std::map< unsigned, float > > edge_weight
 edge_weight[i][j] stores a sampled diffusion time from node \(i\) to node \(j\). More...
 
std::map< unsigned, std::map< unsigned, Parameter > > edge_parameter
 edge_parameter[i][j] stores the parameter of the Weibull distribution along the edge from node \(i\) to node \(j\). More...
 

Detailed Description

Graph represents a given diffusion network structure.

Definition at line 17 of file Graph.h.

Constructor & Destructor Documentation

Graph::Graph ( const std::string &  graph_filename,
unsigned  num_nodes,
bool  reverse 
)
inline

The constructor.

Parameters
[in]graph_filenamethe filename of the input diffusion network.
[in]num_nodesthe total number of nodes in a diffusion network.
[in]reversewhether the edge direction should be reversed or not.

Definition at line 61 of file Graph.h.

Graph::~Graph ( )
inline

Definition at line 66 of file Graph.h.

Member Function Documentation

std::pair< unsigned, unsigned > Graph::MaximumOutDegree ( )

Gets the node with the maximum degree.

Returns
the node with the maximum degree and the degree value.

Definition at line 139 of file Graph.cc.

void Graph::PrintWeibullFormatNetwork ( )

Prints the edges of the loaded diffusion network structure.

The output format is defined as: node index \(i\),node index \(j\),edge_parameter[i][j].scale,edge_parameter[i][j].shape

Definition at line 16 of file Graph.cc.

void Graph::SampleEdgeWeightWbl ( )

Samples the pairwise diffusion time from the corresponding Weibull distribution.

Definition at line 124 of file Graph.cc.

Member Data Documentation

std::map<unsigned, std::map<unsigned, Parameter> > Graph::edge_parameter

edge_parameter[i][j] stores the parameter of the Weibull distribution along the edge from node \(i\) to node \(j\).

Definition at line 79 of file Graph.h.

std::map<unsigned, std::map<unsigned, float> > Graph::edge_weight

edge_weight[i][j] stores a sampled diffusion time from node \(i\) to node \(j\).

Definition at line 75 of file Graph.h.

unsigned Graph::N

The total number of nodes of a diffusion network.

Definition at line 52 of file Graph.h.

std::vector<Node> Graph::nodes

The set of nodes of the given diffusion network.

Definition at line 71 of file Graph.h.


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