SNAP Library 2.3, User Reference
2014-06-16 11:58:46
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Directed multigraph with node edge attributes. More...
#include <network.h>
Classes | |
class | TAFltI |
Node/edge float attribute iterator. Iterates through all nodes/edges for one float attribute. More... | |
class | TAIntI |
Node/edge integer attribute iterator. Iterates through all nodes/edges for one integer attribute. More... | |
class | TAStrI |
Node/edge string attribute iterator. Iterates through all nodes/edges for one string attribute. More... | |
class | TEdge |
class | TEdgeI |
Edge iterator. Only forward iteration (operator++) is supported. More... | |
class | TNode |
class | TNodeI |
Node iterator. Only forward iteration (operator++) is supported. More... | |
Public Types | |
typedef TNEANet | TNet |
typedef TPt< TNEANet > | PNet |
Public Member Functions | |
TNEANet () | |
TNEANet (const int &Nodes, const int &Edges) | |
Constructor that reserves enough memory for a graph of nodes and edges. More... | |
TNEANet (const TNEANet &Graph) | |
TNEANet (TSIn &SIn) | |
Constructor for loading the graph from a (binary) stream SIn. More... | |
void | Save (TSOut &SOut) const |
Saves the graph to a (binary) stream SOut. More... | |
bool | HasFlag (const TGraphFlag &Flag) const |
Allows for run-time checking the type of the graph (see the TGraphFlag for flags). More... | |
TNEANet & | operator= (const TNEANet &Graph) |
int | GetNodes () const |
Returns the number of nodes in the graph. More... | |
int | AddNode (int NId=-1) |
Adds a node of ID NId to the graph. More... | |
int | AddNode (const TNodeI &NodeId) |
Adds a node of ID NodeI.GetId() to the graph. More... | |
void | DelNode (const int &NId) |
Deletes node of ID NId from the graph. More... | |
void | DelNode (const TNode &NodeI) |
Deletes node of ID NodeI.GetId() from the graph. More... | |
bool | IsNode (const int &NId) const |
Tests whether ID NId is a node. More... | |
TNodeI | BegNI () const |
Returns an iterator referring to the first node in the graph. More... | |
TNodeI | EndNI () const |
Returns an iterator referring to the past-the-end node in the graph. More... | |
TNodeI | GetNI (const int &NId) const |
Returns an iterator referring to the node of ID NId in the graph. More... | |
TAIntI | BegNAIntI (const TStr &attr) const |
Returns an iterator referring to the first node's int attribute. More... | |
TAIntI | EndNAIntI (const TStr &attr) const |
Returns an iterator referring to the past-the-end node's attribute. More... | |
TAIntI | GetNAIntI (const TStr &attr, const int &NId) const |
Returns an iterator referring to the node of ID NId in the graph. More... | |
TAStrI | BegNAStrI (const TStr &attr) const |
Returns an iterator referring to the first node's str attribute. More... | |
TAStrI | EndNAStrI (const TStr &attr) const |
Returns an iterator referring to the past-the-end node's attribute. More... | |
TAStrI | GetNAStrI (const TStr &attr, const int &NId) const |
Returns an iterator referring to the node of ID NId in the graph. More... | |
TAFltI | BegNAFltI (const TStr &attr) const |
Returns an iterator referring to the first node's flt attribute. More... | |
TAFltI | EndNAFltI (const TStr &attr) const |
Returns an iterator referring to the past-the-end node's attribute. More... | |
TAFltI | GetNAFltI (const TStr &attr, const int &NId) const |
Returns an iterator referring to the node of ID NId in the graph. More... | |
void | AttrNameNI (const TInt &NId, TStrV &Names) const |
Returns a vector of attr names for node NId. More... | |
void | AttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const |
void | AttrValueNI (const TInt &NId, TStrV &Values) const |
Returns a vector of attr values for node NId. More... | |
void | AttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Values) const |
void | IntAttrNameNI (const TInt &NId, TStrV &Names) const |
Returns a vector of int attr names for node NId. More... | |
void | IntAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const |
void | IntAttrValueNI (const TInt &NId, TIntV &Values) const |
Returns a vector of attr values for node NId. More... | |
void | IntAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TIntV &Values) const |
void | StrAttrNameNI (const TInt &NId, TStrV &Names) const |
Returns a vector of str attr names for node NId. More... | |
void | StrAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const |
void | StrAttrValueNI (const TInt &NId, TStrV &Values) const |
Returns a vector of attr values for node NId. More... | |
void | StrAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Values) const |
void | FltAttrNameNI (const TInt &NId, TStrV &Names) const |
Returns a vector of int attr names for node NId. More... | |
void | FltAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const |
void | FltAttrValueNI (const TInt &NId, TFltV &Values) const |
Returns a vector of attr values for node NId. More... | |
void | FltAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TFltV &Values) const |
void | AttrNameEI (const TInt &EId, TStrV &Names) const |
Returns a vector of attr names for edge EId. More... | |
void | AttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const |
void | AttrValueEI (const TInt &EId, TStrV &Values) const |
Returns a vector of attr values for edge EId. More... | |
void | AttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Values) const |
void | IntAttrNameEI (const TInt &EId, TStrV &Names) const |
Returns a vector of int attr names for edge EId. More... | |
void | IntAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const |
void | IntAttrValueEI (const TInt &EId, TIntV &Values) const |
Returns a vector of attr values for edge EId. More... | |
void | IntAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TIntV &Values) const |
void | StrAttrNameEI (const TInt &EId, TStrV &Names) const |
Returns a vector of str attr names for node NId. More... | |
void | StrAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const |
void | StrAttrValueEI (const TInt &EId, TStrV &Values) const |
Returns a vector of attr values for node NId. More... | |
void | StrAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Values) const |
void | FltAttrNameEI (const TInt &EId, TStrV &Names) const |
Returns a vector of int attr names for node NId. More... | |
void | FltAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const |
void | FltAttrValueEI (const TInt &EId, TFltV &Values) const |
Returns a vector of attr values for node NId. More... | |
void | FltAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TFltV &Values) const |
TAIntI | BegEAIntI (const TStr &attr) const |
Returns an iterator referring to the first edge's int attribute. More... | |
TAIntI | EndEAIntI (const TStr &attr) const |
Returns an iterator referring to the past-the-end edge's attribute. More... | |
TAIntI | GetEAIntI (const TStr &attr, const int &EId) const |
Returns an iterator referring to the edge of ID EId in the graph. More... | |
TAStrI | BegEAStrI (const TStr &attr) const |
Returns an iterator referring to the first edge's str attribute. More... | |
TAStrI | EndEAStrI (const TStr &attr) const |
Returns an iterator referring to the past-the-end edge's attribute. More... | |
TAStrI | GetEAStrI (const TStr &attr, const int &EId) const |
Returns an iterator referring to the edge of ID EId in the graph. More... | |
TAFltI | BegEAFltI (const TStr &attr) const |
Returns an iterator referring to the first edge's flt attribute. More... | |
TAFltI | EndEAFltI (const TStr &attr) const |
Returns an iterator referring to the past-the-end edge's attribute. More... | |
TAFltI | GetEAFltI (const TStr &attr, const int &EId) const |
Returns an iterator referring to the edge of ID EId in the graph. More... | |
int | GetMxNId () const |
Returns an ID that is larger than any node ID in the network. More... | |
int | GetMxEId () const |
Returns an ID that is larger than any edge ID in the network. More... | |
int | GetEdges () const |
Returns the number of edges in the graph. More... | |
int | AddEdge (const int &SrcNId, const int &DstNId, int EId=-1) |
Adds an edge with ID EId between node IDs SrcNId and DstNId to the graph. More... | |
int | AddEdge (const TEdgeI &EdgeI) |
Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the graph. More... | |
void | DelEdge (const int &EId) |
Deletes an edge with edge ID EId from the graph. More... | |
void | DelEdge (const int &SrcNId, const int &DstNId, const bool &IsDir=true) |
Deletes all edges between node IDs SrcNId and DstNId from the graph. More... | |
bool | IsEdge (const int &EId) const |
Tests whether an edge with edge ID EId exists in the graph. More... | |
bool | IsEdge (const int &SrcNId, const int &DstNId, const bool &IsDir=true) const |
Tests whether an edge between node IDs SrcNId and DstNId exists in the graph. More... | |
bool | IsEdge (const int &SrcNId, const int &DstNId, int &EId, const bool &IsDir=true) const |
Tests whether an edge between node IDs SrcNId and DstNId exists in the graph. if an edge exists, return its edge ID in EId. More... | |
int | GetEId (const int &SrcNId, const int &DstNId) const |
Returns an edge ID between node IDs SrcNId and DstNId, if such an edge exists. Otherwise, return -1. More... | |
TEdgeI | BegEI () const |
Returns an iterator referring to the first edge in the graph. More... | |
TEdgeI | EndEI () const |
Returns an iterator referring to the past-the-end edge in the graph. More... | |
TEdgeI | GetEI (const int &EId) const |
Returns an iterator referring to edge with edge ID EId. More... | |
TEdgeI | GetEI (const int &SrcNId, const int &DstNId) const |
Returns an iterator referring to edge (SrcNId, DstNId) in the graph. More... | |
int | GetRndNId (TRnd &Rnd=TInt::Rnd) |
Returns an ID of a random node in the graph. More... | |
TNodeI | GetRndNI (TRnd &Rnd=TInt::Rnd) |
Returns an interator referring to a random node in the graph. More... | |
int | GetRndEId (TRnd &Rnd=TInt::Rnd) |
Returns an ID of a random edge in the graph. More... | |
TEdgeI | GetRndEI (TRnd &Rnd=TInt::Rnd) |
Returns an interator referring to a random edge in the graph. More... | |
void | GetNIdV (TIntV &NIdV) const |
Gets a vector IDs of all nodes in the graph. More... | |
void | GetEIdV (TIntV &EIdV) const |
Gets a vector IDs of all edges in the graph. More... | |
bool | Empty () const |
Tests whether the graph is empty (has zero nodes). More... | |
void | Clr () |
Deletes all nodes and edges from the graph. More... | |
void | Reserve (const int &Nodes, const int &Edges) |
Reserves memory for a graph of Nodes nodes and Edges edges. More... | |
void | Defrag (const bool &OnlyNodeLinks=false) |
Defragments the graph. More... | |
bool | IsOk (const bool &ThrowExcept=true) const |
Checks the graph data structure for internal consistency. More... | |
void | Dump (FILE *OutF=stdout) const |
Print the graph in a human readable form to an output stream OutF. More... | |
int | AddIntAttrDatN (const TNodeI &NodeId, const TInt &value, const TStr &attr) |
Attribute based add function for attr to Int value. More... | |
int | AddIntAttrDatN (const int &NId, const TInt &value, const TStr &attr) |
int | AddStrAttrDatN (const TNodeI &NodeId, const TStr &value, const TStr &attr) |
Attribute based add function for attr to Str value. More... | |
int | AddStrAttrDatN (const int &NId, const TStr &value, const TStr &attr) |
int | AddFltAttrDatN (const TNodeI &NodeId, const TFlt &value, const TStr &attr) |
Attribute based add function for attr to Flt value. More... | |
int | AddFltAttrDatN (const int &NId, const TFlt &value, const TStr &attr) |
int | AddIntAttrDatE (const TEdgeI &EdgeId, const TInt &value, const TStr &attr) |
Attribute based add function for attr to Int value. More... | |
int | AddIntAttrDatE (const int &EId, const TInt &value, const TStr &attr) |
int | AddStrAttrDatE (const TEdgeI &EdgeId, const TStr &value, const TStr &attr) |
Attribute based add function for attr to Str value. More... | |
int | AddStrAttrDatE (const int &EId, const TStr &value, const TStr &attr) |
int | AddFltAttrDatE (const TEdgeI &EdgeId, const TFlt &value, const TStr &attr) |
Attribute based add function for attr to Flt value. More... | |
int | AddFltAttrDatE (const int &EId, const TFlt &value, const TStr &attr) |
TInt | GetIntAttrDatN (const TNodeI &NodeId, const TStr &attr) |
Gets the value of int attr from the node attr value vector. More... | |
TInt | GetIntAttrDatN (const int &NId, const TStr &attr) |
TStr | GetStrAttrDatN (const TNodeI &NodeId, const TStr &attr) |
Gets the value of str attr from the node attr value vector. More... | |
TStr | GetStrAttrDatN (const int &NId, const TStr &attr) |
TFlt | GetFltAttrDatN (const TNodeI &NodeId, const TStr &attr) |
Gets the value of flt attr from the node attr value vector. More... | |
TFlt | GetFltAttrDatN (const int &NId, const TStr &attr) |
int | GetIntAttrIndN (const TStr &attr) |
Gets the index of the node attr value vector specified by str attr. More... | |
TInt | GetIntAttrIndDatN (const TNodeI &NodeId, const int &index) |
Gets the value of node int attr specified by the attr index. More... | |
TInt | GetIntAttrIndDatN (const int &NId, const int &index) |
TInt | GetIntAttrDatE (const TEdgeI &EdgeId, const TStr &attr) |
Gets the value of int attr from the edge attr value vector. More... | |
TInt | GetIntAttrDatE (const int &EId, const TStr &attr) |
TStr | GetStrAttrDatE (const TEdgeI &EdgeId, const TStr &attr) |
Gets the value of str attr from the edge attr value vector. More... | |
TStr | GetStrAttrDatE (const int &EId, const TStr &attr) |
TFlt | GetFltAttrDatE (const TEdgeI &EdgeId, const TStr &attr) |
Gets the value of flt attr from the edge attr value vector. More... | |
TFlt | GetFltAttrDatE (const int &EId, const TStr &attr) |
int | GetIntAttrIndE (const TStr &attr) |
Gets the index of the edge attr value vector specified by str attr. More... | |
TInt | GetIntAttrIndDatE (const TEdgeI &EdgeId, const int &index) |
Gets the value of edge int attr specified by the attr index. More... | |
TInt | GetIntAttrIndDatE (const int &EId, const int &index) |
int | DelAttrDatN (const TNodeI &NodeId, const TStr &attr) |
Deletes the node attribute for NodeId. More... | |
int | DelAttrDatN (const int &NId, const TStr &attr) |
int | DelAttrDatE (const TEdgeI &EdgeId, const TStr &attr) |
Deletes the edge attribute for NodeId. More... | |
int | DelAttrDatE (const int &EId, const TStr &attr) |
int | AddIntAttrN (const TStr &attr, TInt defaultValue=TInt::Mn) |
Adds a new Int node attribute to the hashmap. More... | |
int | AddStrAttrN (const TStr &attr, TStr defaultValue=TStr::GetNullStr()) |
Adds a new Str node attribute to the hashmap. More... | |
int | AddFltAttrN (const TStr &attr, TFlt defaultValue=TFlt::Mn) |
Adds a new Flt node attribute to the hashmap. More... | |
int | AddIntAttrE (const TStr &attr, TInt defaultValue=TInt::Mn) |
Adds a new Int edge attribute to the hashmap. More... | |
int | AddStrAttrE (const TStr &attr, TStr defaultValue=TStr::GetNullStr()) |
Adds a new Str edge attribute to the hashmap. More... | |
int | AddFltAttrE (const TStr &attr, TFlt defaultValue=TFlt::Mn) |
Adds a new Flt edge attribute to the hashmap. More... | |
int | DelAttrN (const TStr &attr) |
Removes all the values for node attr. More... | |
int | DelAttrE (const TStr &attr) |
Removes all the values for edge attr. More... | |
bool | NodeAttrIsDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const |
bool | NodeAttrIsIntDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const |
bool | NodeAttrIsStrDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const |
bool | NodeAttrIsFltDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const |
bool | EdgeAttrIsDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const |
bool | EdgeAttrIsIntDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const |
bool | EdgeAttrIsStrDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const |
bool | EdgeAttrIsFltDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const |
TStr | GetNodeAttrValue (const int &NId, const TStrIntPrH::TIter &NodeHI) const |
TStr | GetEdgeAttrValue (const int &EId, const TStrIntPrH::TIter &EdgeHI) const |
Static Public Member Functions | |
static PNEANet | New () |
Static cons returns pointer to graph. Ex: PNEANet Graph=TNEANet::New(). More... | |
static PNEANet | New (const int &Nodes, const int &Edges) |
Static constructor that returns a pointer to the graph and reserves enough memory for Nodes nodes and Edges edges. More... | |
static PNEANet | Load (TSIn &SIn) |
Static constructor that loads the graph from a stream SIn and returns a pointer to it. More... | |
static PNEANet | GetSmallGraph () |
Returns a small multigraph on 5 nodes and 6 edges. More... | |
Private Types | |
enum | { IntType, StrType, FltType } |
Private Member Functions | |
TNode & | GetNode (const int &NId) |
const TNode & | GetNode (const int &NId) const |
TEdge & | GetEdge (const int &EId) |
const TEdge & | GetEdge (const int &EId) const |
TInt | GetIntAttrDefaultN (const TStr &attribute) const |
Get Int node attribute val. If not a proper attr, return default. More... | |
TStr | GetStrAttrDefaultN (const TStr &attribute) const |
Get Str node attribute val. If not a proper attr, return default. More... | |
TFlt | GetFltAttrDefaultN (const TStr &attribute) const |
Get Flt node attribute val. If not a proper attr, return default. More... | |
TInt | GetIntAttrDefaultE (const TStr &attribute) const |
Get Int edge attribute val. If not a proper attr, return default. More... | |
TStr | GetStrAttrDefaultE (const TStr &attribute) const |
Get Str edge attribute val. If not a proper attr, return default. More... | |
TFlt | GetFltAttrDefaultE (const TStr &attribute) const |
Get Flt edge attribute val. If not a proper attr, return default. More... | |
Private Attributes | |
TCRef | CRef |
TInt | MxNId |
TInt | MxEId |
THash< TInt, TNode > | NodeH |
THash< TInt, TEdge > | EdgeH |
TStrIntPrH | KeyToIndexTypeN |
KeyToIndexType[N|E]: Key->(Type,Index). More... | |
TStrIntPrH | KeyToIndexTypeE |
THash< TStr, TInt > | IntDefaultsN |
THash< TStr, TInt > | IntDefaultsE |
THash< TStr, TStr > | StrDefaultsN |
THash< TStr, TStr > | StrDefaultsE |
THash< TStr, TFlt > | FltDefaultsN |
THash< TStr, TFlt > | FltDefaultsE |
TVec< TIntV > | VecOfIntVecsN |
TVec< TIntV > | VecOfIntVecsE |
TVec< TStrV > | VecOfStrVecsN |
TVec< TStrV > | VecOfStrVecsE |
TVec< TFltV > | VecOfFltVecsN |
TVec< TFltV > | VecOfFltVecsE |
Friends | |
class | TPt< TNEANet > |
Directed multigraph with node edge attributes.
Node IDs can be arbitrary non-negative integers. Edges have IDs. There can be more than one directed edge from one source node to a destination node. Self loops (one per node) are allowed as well as multiple (parallel) edges. Nodes and edges can have attributes/data associated with them. The attributes can be added dynamically at runtime. The directed multigraph data structure is implemented using sorted adjacency lists. This means adding a node takes constant time, while adding an edge takes linear time (since adjacency list is kept sorted) in the node degree. Accessing arbitrary node takes constant time and accessing any edge takes logarithmic time in the node degree. The attributes are organized in a columnar store, where each attribute column is defined for all the nodes or edges in the network.
typedef TPt<TNEANet> TNEANet::PNet |
typedef TNEANet TNEANet::TNet |
|
private |
Enumerator | |
---|---|
IntType | |
StrType | |
FltType |
|
inline |
Definition at line 1842 of file network.h.
|
inlineexplicit |
Constructor that reserves enough memory for a graph of nodes and edges.
Definition at line 1848 of file network.h.
|
inline |
Definition at line 1854 of file network.h.
|
inline |
Constructor for loading the graph from a (binary) stream SIn.
Definition at line 1860 of file network.h.
int TNEANet::AddEdge | ( | const int & | SrcNId, |
const int & | DstNId, | ||
int | EId = -1 |
||
) |
Adds an edge with ID EId between node IDs SrcNId and DstNId to the graph.
Returns the ID of the edge being added. If EId is -1, edge ID is automatically assigned. Aborts, if an edge with ID EId already exists. Aborts, if SrcNId or DstNId are not nodes in the graph.
Definition at line 375 of file network.cpp.
|
inline |
Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the graph.
Definition at line 2058 of file network.h.
Attribute based add function for attr to Flt value.
Adds the key flt value pair to the corresponding edge attribute value vector.
Definition at line 2152 of file network.h.
Definition at line 730 of file network.cpp.
Attribute based add function for attr to Flt value.
Adds the key flt value pair to the corresponding node attribute value vector.
Definition at line 2136 of file network.h.
Definition at line 660 of file network.cpp.
Adds a new Flt edge attribute to the hashmap.
Definition at line 920 of file network.cpp.
Adds a new Flt node attribute to the hashmap.
Definition at line 861 of file network.cpp.
Attribute based add function for attr to Int value.
Adds the key int value pair to the corresponding edge attribute value vector.
Definition at line 2142 of file network.h.
Definition at line 684 of file network.cpp.
Attribute based add function for attr to Int value.
Adds the key int value pair to the corresponding node attribute value vector.
Definition at line 2126 of file network.h.
Definition at line 614 of file network.cpp.
Adds a new Int edge attribute to the hashmap.
Definition at line 881 of file network.cpp.
Adds a new Int node attribute to the hashmap.
Definition at line 823 of file network.cpp.
int TNEANet::AddNode | ( | int | NId = -1 | ) |
Adds a node of ID NId to the graph.
Returns the ID of the node being added. If NId is -1, node ID is automatically assigned. Aborts, if a node with ID NId already exists.
Definition at line 269 of file network.cpp.
|
inline |
Adds a node of ID NodeI.GetId() to the graph.
Definition at line 1898 of file network.h.
Attribute based add function for attr to Str value.
Adds the key str value pair to the corresponding edge attribute value vector.
Definition at line 2147 of file network.h.
Definition at line 707 of file network.cpp.
Attribute based add function for attr to Str value.
Adds the key str value pair to the corresponding node attribute value vector.
Definition at line 2131 of file network.h.
Definition at line 637 of file network.cpp.
int TNEANet::AddStrAttrE | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str edge attribute to the hashmap.
Definition at line 901 of file network.cpp.
int TNEANet::AddStrAttrN | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str node attribute to the hashmap.
Definition at line 842 of file network.cpp.
Returns a vector of attr names for edge EId.
Definition at line 1976 of file network.h.
void TNEANet::AttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 147 of file network.cpp.
Returns a vector of attr names for node NId.
Definition at line 1943 of file network.h.
void TNEANet::AttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 25 of file network.cpp.
Returns a vector of attr values for edge EId.
Definition at line 1980 of file network.h.
void TNEANet::AttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 157 of file network.cpp.
Returns a vector of attr values for node NId.
Definition at line 1947 of file network.h.
void TNEANet::AttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 35 of file network.cpp.
|
inline |
Returns an iterator referring to the first node's flt attribute.
Definition at line 1933 of file network.h.
Returns an iterator referring to the first node's int attribute.
Definition at line 1914 of file network.h.
Returns an iterator referring to the first node's str attribute.
Definition at line 1923 of file network.h.
|
inline |
|
inline |
Deletes all nodes and edges from the graph.
Definition at line 2100 of file network.h.
void TNEANet::Defrag | ( | const bool & | OnlyNodeLinks = false | ) |
Defragments the graph.
After performing many node and edge insertions and deletions to a graph, the graph data structure will be fragmented in memory. This function compacts down the graph data structure and frees unneeded memory.
Definition at line 495 of file network.cpp.
Deletes the edge attribute for NodeId.
Definition at line 2192 of file network.h.
int TNEANet::DelAttrDatE | ( | const int & | EId, |
const TStr & | attr | ||
) |
Definition at line 808 of file network.cpp.
Deletes the node attribute for NodeId.
Definition at line 2189 of file network.h.
int TNEANet::DelAttrDatN | ( | const int & | NId, |
const TStr & | attr | ||
) |
Definition at line 794 of file network.cpp.
int TNEANet::DelAttrE | ( | const TStr & | attr | ) |
Removes all the values for edge attr.
Definition at line 963 of file network.cpp.
int TNEANet::DelAttrN | ( | const TStr & | attr | ) |
Removes all the values for node attr.
Definition at line 939 of file network.cpp.
void TNEANet::DelEdge | ( | const int & | EId | ) |
Deletes an edge with edge ID EId from the graph.
Definition at line 425 of file network.cpp.
void TNEANet::DelEdge | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const bool & | IsDir = true |
||
) |
Deletes all edges between node IDs SrcNId and DstNId from the graph.
If the edge (SrcNId, DstNId) does not exist in the graph function still completes. But the function aborts if SrcNId or DstNId are not nodes in the graph.
Definition at line 450 of file network.cpp.
void TNEANet::DelNode | ( | const int & | NId | ) |
Deletes node of ID NId from the graph.
If the node of ID NId does not exist the function aborts.
Definition at line 315 of file network.cpp.
|
inline |
Deletes node of ID NodeI.GetId() from the graph.
Definition at line 1904 of file network.h.
void TNEANet::Dump | ( | FILE * | OutF = stdout | ) | const |
Print the graph in a human readable form to an output stream OutF.
Definition at line 557 of file network.cpp.
bool TNEANet::EdgeAttrIsDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 230 of file network.cpp.
bool TNEANet::EdgeAttrIsFltDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 249 of file network.cpp.
bool TNEANet::EdgeAttrIsIntDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 237 of file network.cpp.
bool TNEANet::EdgeAttrIsStrDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 243 of file network.cpp.
|
inline |
Tests whether the graph is empty (has zero nodes).
Definition at line 2098 of file network.h.
|
inline |
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 1936 of file network.h.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 1917 of file network.h.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 1927 of file network.h.
|
inline |
Returns a vector of int attr names for node NId.
Definition at line 2000 of file network.h.
void TNEANet::FltAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 209 of file network.cpp.
Returns a vector of int attr names for node NId.
Definition at line 1967 of file network.h.
void TNEANet::FltAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 87 of file network.cpp.
Returns a vector of attr values for node NId.
Definition at line 2004 of file network.h.
void TNEANet::FltAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 219 of file network.cpp.
Returns a vector of attr values for node NId.
Definition at line 1971 of file network.h.
void TNEANet::FltAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 97 of file network.cpp.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 2040 of file network.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 2017 of file network.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 2028 of file network.h.
|
inlineprivate |
TStr TNEANet::GetEdgeAttrValue | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 255 of file network.cpp.
|
inline |
|
inline |
|
inline |
Returns an iterator referring to edge (SrcNId, DstNId) in the graph.
Definition at line 2082 of file network.h.
|
inline |
Returns an edge ID between node IDs SrcNId and DstNId, if such an edge exists. Otherwise, return -1.
Definition at line 2074 of file network.h.
void TNEANet::GetEIdV | ( | TIntV & | EIdV | ) | const |
Gets a vector IDs of all edges in the graph.
Definition at line 488 of file network.cpp.
Gets the value of flt attr from the edge attr value vector.
Definition at line 2179 of file network.h.
Definition at line 790 of file network.cpp.
Gets the value of flt attr from the node attr value vector.
Definition at line 2163 of file network.h.
Definition at line 770 of file network.cpp.
Gets the value of int attr from the edge attr value vector.
Definition at line 2173 of file network.h.
Definition at line 774 of file network.cpp.
Gets the value of int attr from the node attr value vector.
Definition at line 2156 of file network.h.
Definition at line 754 of file network.cpp.
Gets the value of edge int attr specified by the attr index.
Definition at line 2185 of file network.h.
TInt TNEANet::GetIntAttrIndDatE | ( | const int & | EId, |
const int & | index | ||
) |
Definition at line 778 of file network.cpp.
Gets the value of node int attr specified by the attr index.
Definition at line 2169 of file network.h.
TInt TNEANet::GetIntAttrIndDatN | ( | const int & | NId, |
const int & | index | ||
) |
Definition at line 758 of file network.cpp.
int TNEANet::GetIntAttrIndE | ( | const TStr & | attr | ) |
Gets the index of the edge attr value vector specified by str attr.
Definition at line 782 of file network.cpp.
int TNEANet::GetIntAttrIndN | ( | const TStr & | attr | ) |
Gets the index of the node attr value vector specified by str attr.
Definition at line 762 of file network.cpp.
|
inline |
|
inline |
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1939 of file network.h.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1920 of file network.h.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1930 of file network.h.
|
inline |
void TNEANet::GetNIdV | ( | TIntV & | NIdV | ) | const |
Gets a vector IDs of all nodes in the graph.
Definition at line 481 of file network.cpp.
|
inlineprivate |
TStr TNEANet::GetNodeAttrValue | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 133 of file network.cpp.
|
inline |
Returns an interator referring to a random edge in the graph.
Definition at line 2091 of file network.h.
Returns an ID of a random edge in the graph.
Definition at line 2089 of file network.h.
Returns an interator referring to a random node in the graph.
Definition at line 2087 of file network.h.
Returns an ID of a random node in the graph.
Definition at line 2085 of file network.h.
|
static |
Returns a small multigraph on 5 nodes and 6 edges.
/// Edges: 0 -> 1, 0 -> 2, 0 -> 3, 0 -> 4, 1 -> 2, 1 -> 2 ///
Definition at line 988 of file network.cpp.
Gets the value of str attr from the edge attr value vector.
Definition at line 2176 of file network.h.
Definition at line 786 of file network.cpp.
Gets the value of str attr from the node attr value vector.
Definition at line 2160 of file network.h.
Definition at line 766 of file network.cpp.
Get Str edge attribute val. If not a proper attr, return default.
Definition at line 1822 of file network.h.
Get Str node attribute val. If not a proper attr, return default.
Definition at line 1816 of file network.h.
bool TNEANet::HasFlag | ( | const TGraphFlag & | Flag | ) | const |
Allows for run-time checking the type of the graph (see the TGraphFlag for flags).
Definition at line 3 of file network.cpp.
Returns a vector of int attr names for edge EId.
Definition at line 1984 of file network.h.
void TNEANet::IntAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 167 of file network.cpp.
Returns a vector of int attr names for node NId.
Definition at line 1951 of file network.h.
void TNEANet::IntAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 45 of file network.cpp.
Returns a vector of attr values for edge EId.
Definition at line 1988 of file network.h.
void TNEANet::IntAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 177 of file network.cpp.
Returns a vector of attr values for node NId.
Definition at line 1955 of file network.h.
void TNEANet::IntAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 55 of file network.cpp.
|
inline |
|
inline |
Tests whether an edge between node IDs SrcNId and DstNId exists in the graph.
Definition at line 2070 of file network.h.
bool TNEANet::IsEdge | ( | const int & | SrcNId, |
const int & | DstNId, | ||
int & | EId, | ||
const bool & | IsDir = true |
||
) | const |
Tests whether an edge between node IDs SrcNId and DstNId exists in the graph. if an edge exists, return its edge ID in EId.
Definition at line 460 of file network.cpp.
|
inline |
bool TNEANet::IsOk | ( | const bool & | ThrowExcept = true | ) | const |
Checks the graph data structure for internal consistency.
For each node in the graph check that its neighbors are also nodes in the graph.
Definition at line 504 of file network.cpp.
Static constructor that loads the graph from a stream SIn and returns a pointer to it.
Definition at line 1882 of file network.h.
|
inlinestatic |
Static cons returns pointer to graph. Ex: PNEANet Graph=TNEANet::New().
Definition at line 1876 of file network.h.
|
inlinestatic |
Static constructor that returns a pointer to the graph and reserves enough memory for Nodes nodes and Edges edges.
Call: PNEANet Graph = TNEANet::New(Nodes, Edges).
Definition at line 1880 of file network.h.
bool TNEANet::NodeAttrIsDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 108 of file network.cpp.
bool TNEANet::NodeAttrIsFltDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 127 of file network.cpp.
bool TNEANet::NodeAttrIsIntDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 115 of file network.cpp.
bool TNEANet::NodeAttrIsStrDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 121 of file network.cpp.
|
inline |
|
inline |
Saves the graph to a (binary) stream SOut.
Definition at line 1866 of file network.h.
Returns a vector of str attr names for node NId.
Definition at line 1992 of file network.h.
void TNEANet::StrAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 188 of file network.cpp.
Returns a vector of str attr names for node NId.
Definition at line 1959 of file network.h.
void TNEANet::StrAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 66 of file network.cpp.
Returns a vector of attr values for node NId.
Definition at line 1996 of file network.h.
void TNEANet::StrAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 198 of file network.cpp.
Returns a vector of attr values for node NId.
Definition at line 1963 of file network.h.
void TNEANet::StrAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 76 of file network.cpp.
|
private |
|
private |