SNAP Library 3.0, User Reference
2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Directed multigraph with node edge attributes. More...
#include <networkmp.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 TNEANetMP | TNet |
typedef TPt< TNEANetMP > | PNet |
Public Member Functions | |
TNEANetMP () | |
TNEANetMP (const int &Nodes, const int &Edges) | |
Constructor that reserves enough memory for a graph of nodes and edges. More... | |
TNEANetMP (const TNEANetMP &Graph) | |
TNEANetMP (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... | |
TNEANetMP & | operator= (const TNEANetMP &Graph) |
int | GetNodes () const |
Returns the number of nodes in the graph. More... | |
void | SetNodes (const int &Length) |
Sets 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 | AddNodeWithEdges (const TInt &NId, TIntV &InEIdV, TIntV &OutEIdV) |
Adds a node along with its neighbor edges. More... | |
bool | IsNode (const int &NId) const |
If the node of ID NId does not exist the function aborts. 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 | Reserved () const |
Returns the number of nodes reserved in the network. More... | |
int | ReservedE () const |
Returns the number of edges reserved in the network. More... | |
int | GetEdges () const |
Returns the number of edges in the graph. More... | |
void | SetEdges (const int &Length) |
Sets the number of edges in the graph. More... | |
void | SetMxEId (const TInt &Id) |
Sets the MaxEId. Used since AddEdgeUnchecked doesn't affect EId for efficiency. 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 | AddEdgeUnchecked (const TInt &EId, const int SrcNId, const int DstNId) |
Adds an edge without checking its adjacent nodes' neighborhood. 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 | ReserveAttr (const int &NIntAttr, const int &NFltAttr, const int &NStrAttr, const int &EIntAttr, const int &EFltAttr, const int &EStrAttr) |
Reserves memory for dense attributes. More... | |
void | Defrag (const bool &OnlyNodeLinks=false) |
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... | |
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 |
TFlt | GetWeightOutEdges (const TNodeI &NI, const TStr &attr) |
bool | IsFltAttrE (const TStr &attr) |
bool | IsIntAttrE (const TStr &attr) |
bool | IsStrAttrE (const TStr &attr) |
TVec< TFlt > & | GetFltAttrVecE (const TStr &attr) |
int | GetFltKeyIdE (const int &EId) |
void | GetWeightOutEdgesV (TFltV &OutWeights, const TFltV &AttrVal) |
Static Public Member Functions | |
static PNEANetMP | New () |
Static cons returns pointer to graph. Ex: PNEANetMP Graph=TNEANetMP::New(). More... | |
static PNEANetMP | 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 PNEANetMP | Load (TSIn &SIn) |
Static constructor that loads the graph from a stream SIn and returns a pointer to it. 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 |
THashMP< TInt, TNode > | NodeH |
THashMP< TInt, TEdge > | EdgeH |
TStrIntPrH | KeyToIndexTypeN |
KeyToIndexType[N|E]: Key->(Type,Index). More... | |
TStrIntPrH | KeyToIndexTypeE |
THashMP< TStr, TInt > | IntDefaultsN |
THashMP< TStr, TInt > | IntDefaultsE |
THashMP< TStr, TStr > | StrDefaultsN |
THashMP< TStr, TStr > | StrDefaultsE |
THashMP< TStr, TFlt > | FltDefaultsN |
THashMP< TStr, TFlt > | FltDefaultsE |
TVec< TIntV > | VecOfIntVecsN |
TVec< TIntV > | VecOfIntVecsE |
TVec< TStrV > | VecOfStrVecsN |
TVec< TStrV > | VecOfStrVecsE |
TVec< TFltV > | VecOfFltVecsN |
TVec< TFltV > | VecOfFltVecsE |
Friends | |
class | TPt< TNEANetMP > |
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.
Definition at line 27 of file networkmp.h.
typedef TPt<TNEANetMP> TNEANetMP::PNet |
Definition at line 30 of file networkmp.h.
typedef TNEANetMP TNEANetMP::TNet |
Definition at line 29 of file networkmp.h.
|
private |
Enumerator | |
---|---|
IntType | |
StrType | |
FltType |
Definition at line 280 of file networkmp.h.
|
inline |
Definition at line 282 of file networkmp.h.
|
inlineexplicit |
Constructor that reserves enough memory for a graph of nodes and edges.
Definition at line 288 of file networkmp.h.
|
inline |
Definition at line 294 of file networkmp.h.
|
inline |
Constructor for loading the graph from a (binary) stream SIn.
Definition at line 300 of file networkmp.h.
int TNEANetMP::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 388 of file networkmp.cpp.
|
inline |
Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the graph.
Definition at line 510 of file networkmp.h.
void TNEANetMP::AddEdgeUnchecked | ( | const TInt & | EId, |
const int | SrcNId, | ||
const int | DstNId | ||
) |
Adds an edge without checking its adjacent nodes' neighborhood.
Definition at line 438 of file networkmp.cpp.
|
inline |
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 616 of file networkmp.h.
Definition at line 758 of file networkmp.cpp.
|
inline |
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 600 of file networkmp.h.
Definition at line 686 of file networkmp.cpp.
Adds a new Flt edge attribute to the hashmap.
Definition at line 956 of file networkmp.cpp.
Adds a new Flt node attribute to the hashmap.
Definition at line 897 of file networkmp.cpp.
|
inline |
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 606 of file networkmp.h.
Definition at line 711 of file networkmp.cpp.
|
inline |
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 590 of file networkmp.h.
Definition at line 640 of file networkmp.cpp.
Adds a new Int edge attribute to the hashmap.
Definition at line 917 of file networkmp.cpp.
Adds a new Int node attribute to the hashmap.
Definition at line 859 of file networkmp.cpp.
int TNEANetMP::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 271 of file networkmp.cpp.
|
inline |
Adds a node of ID NodeI.GetId() to the graph.
Definition at line 340 of file networkmp.h.
Adds a node along with its neighbor edges.
Definition at line 319 of file networkmp.cpp.
|
inline |
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 611 of file networkmp.h.
Definition at line 735 of file networkmp.cpp.
|
inline |
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 595 of file networkmp.h.
Definition at line 663 of file networkmp.cpp.
int TNEANetMP::AddStrAttrE | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str edge attribute to the hashmap.
Definition at line 937 of file networkmp.cpp.
int TNEANetMP::AddStrAttrN | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str node attribute to the hashmap.
Definition at line 878 of file networkmp.cpp.
Returns a vector of attr names for edge EId.
Definition at line 419 of file networkmp.h.
void TNEANetMP::AttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 149 of file networkmp.cpp.
Returns a vector of attr names for node NId.
Definition at line 386 of file networkmp.h.
void TNEANetMP::AttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 27 of file networkmp.cpp.
Returns a vector of attr values for edge EId.
Definition at line 423 of file networkmp.h.
void TNEANetMP::AttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 159 of file networkmp.cpp.
Returns a vector of attr values for node NId.
Definition at line 390 of file networkmp.h.
void TNEANetMP::AttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 37 of file networkmp.cpp.
Returns an iterator referring to the first edge's flt attribute.
Definition at line 475 of file networkmp.h.
Returns an iterator referring to the first edge's int attribute.
Definition at line 452 of file networkmp.h.
Returns an iterator referring to the first edge's str attribute.
Definition at line 464 of file networkmp.h.
|
inline |
Returns an iterator referring to the first edge in the graph.
Definition at line 530 of file networkmp.h.
Returns an iterator referring to the first node's flt attribute.
Definition at line 376 of file networkmp.h.
Returns an iterator referring to the first node's int attribute.
Definition at line 358 of file networkmp.h.
Returns an iterator referring to the first node's str attribute.
Definition at line 367 of file networkmp.h.
|
inline |
Returns an iterator referring to the first node in the graph.
Definition at line 352 of file networkmp.h.
|
inline |
Deletes all nodes and edges from the graph.
Definition at line 554 of file networkmp.h.
void TNEANetMP::Defrag | ( | const bool & | OnlyNodeLinks = false | ) |
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 515 of file networkmp.cpp.
Deletes the edge attribute for NodeId.
Definition at line 656 of file networkmp.h.
int TNEANetMP::DelAttrDatE | ( | const int & | EId, |
const TStr & | attr | ||
) |
Definition at line 844 of file networkmp.cpp.
Deletes the node attribute for NodeId.
Definition at line 653 of file networkmp.h.
int TNEANetMP::DelAttrDatN | ( | const int & | NId, |
const TStr & | attr | ||
) |
Definition at line 830 of file networkmp.cpp.
void TNEANetMP::Dump | ( | FILE * | OutF = stdout | ) | const |
Print the graph in a human readable form to an output stream OutF.
Definition at line 579 of file networkmp.cpp.
bool TNEANetMP::EdgeAttrIsDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 232 of file networkmp.cpp.
bool TNEANetMP::EdgeAttrIsFltDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 251 of file networkmp.cpp.
bool TNEANetMP::EdgeAttrIsIntDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 239 of file networkmp.cpp.
bool TNEANetMP::EdgeAttrIsStrDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 245 of file networkmp.cpp.
|
inline |
Tests whether the graph is empty (has zero nodes).
Definition at line 552 of file networkmp.h.
Returns an iterator referring to the past-the-end edge's attribute.
Definition at line 479 of file networkmp.h.
Returns an iterator referring to the past-the-end edge's attribute.
Definition at line 456 of file networkmp.h.
Returns an iterator referring to the past-the-end edge's attribute.
Definition at line 467 of file networkmp.h.
|
inline |
Returns an iterator referring to the past-the-end edge in the graph.
Definition at line 532 of file networkmp.h.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 379 of file networkmp.h.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 361 of file networkmp.h.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 370 of file networkmp.h.
|
inline |
Returns an iterator referring to the past-the-end node in the graph.
Definition at line 354 of file networkmp.h.
Returns a vector of int attr names for node NId.
Definition at line 443 of file networkmp.h.
void TNEANetMP::FltAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 211 of file networkmp.cpp.
Returns a vector of int attr names for node NId.
Definition at line 410 of file networkmp.h.
void TNEANetMP::FltAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 89 of file networkmp.cpp.
Returns a vector of attr values for node NId.
Definition at line 447 of file networkmp.h.
void TNEANetMP::FltAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 221 of file networkmp.cpp.
Returns a vector of attr values for node NId.
Definition at line 414 of file networkmp.h.
void TNEANetMP::FltAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 99 of file networkmp.cpp.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 483 of file networkmp.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 460 of file networkmp.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 471 of file networkmp.h.
|
inlineprivate |
Definition at line 250 of file networkmp.h.
|
inlineprivate |
Definition at line 251 of file networkmp.h.
TStr TNEANetMP::GetEdgeAttrValue | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 257 of file networkmp.cpp.
|
inline |
|
inline |
|
inline |
Returns an iterator referring to edge (SrcNId, DstNId) in the graph.
Definition at line 536 of file networkmp.h.
|
inline |
Returns an edge ID between node IDs SrcNId and DstNId, if such an edge exists. Otherwise, return -1.
Definition at line 528 of file networkmp.h.
void TNEANetMP::GetEIdV | ( | TIntV & | EIdV | ) | const |
Gets a vector IDs of all edges in the graph.
Definition at line 508 of file networkmp.cpp.
Gets the value of flt attr from the edge attr value vector.
Definition at line 643 of file networkmp.h.
Definition at line 826 of file networkmp.cpp.
Gets the value of flt attr from the node attr value vector.
Definition at line 627 of file networkmp.h.
Definition at line 806 of file networkmp.cpp.
Get Flt edge attribute val. If not a proper attr, return default.
Definition at line 264 of file networkmp.h.
Get Flt node attribute val. If not a proper attr, return default.
Definition at line 258 of file networkmp.h.
Definition at line 782 of file networkmp.cpp.
int TNEANetMP::GetFltKeyIdE | ( | const int & | EId | ) |
Definition at line 786 of file networkmp.cpp.
Gets the value of int attr from the edge attr value vector.
Definition at line 637 of file networkmp.h.
Definition at line 810 of file networkmp.cpp.
Gets the value of int attr from the node attr value vector.
Definition at line 620 of file networkmp.h.
Definition at line 790 of file networkmp.cpp.
Get Int edge attribute val. If not a proper attr, return default.
Definition at line 260 of file networkmp.h.
Get Int node attribute val. If not a proper attr, return default.
Definition at line 254 of file networkmp.h.
Gets the value of edge int attr specified by the attr index.
Definition at line 649 of file networkmp.h.
TInt TNEANetMP::GetIntAttrIndDatE | ( | const int & | EId, |
const int & | index | ||
) |
Definition at line 814 of file networkmp.cpp.
Gets the value of node int attr specified by the attr index.
Definition at line 633 of file networkmp.h.
TInt TNEANetMP::GetIntAttrIndDatN | ( | const int & | NId, |
const int & | index | ||
) |
Definition at line 794 of file networkmp.cpp.
int TNEANetMP::GetIntAttrIndE | ( | const TStr & | attr | ) |
Gets the index of the edge attr value vector specified by str attr.
Definition at line 818 of file networkmp.cpp.
int TNEANetMP::GetIntAttrIndN | ( | const TStr & | attr | ) |
Gets the index of the node attr value vector specified by str attr.
Definition at line 798 of file networkmp.cpp.
|
inline |
Returns an ID that is larger than any edge ID in the network.
Definition at line 489 of file networkmp.h.
|
inline |
Returns an ID that is larger than any node ID in the network.
Definition at line 487 of file networkmp.h.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 382 of file networkmp.h.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 364 of file networkmp.h.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 373 of file networkmp.h.
|
inline |
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 356 of file networkmp.h.
void TNEANetMP::GetNIdV | ( | TIntV & | NIdV | ) | const |
Gets a vector IDs of all nodes in the graph.
Definition at line 501 of file networkmp.cpp.
|
inlineprivate |
Definition at line 248 of file networkmp.h.
|
inlineprivate |
Definition at line 249 of file networkmp.h.
TStr TNEANetMP::GetNodeAttrValue | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 135 of file networkmp.cpp.
|
inline |
Returns an interator referring to a random edge in the graph.
Definition at line 545 of file networkmp.h.
Returns an ID of a random edge in the graph.
Definition at line 543 of file networkmp.h.
Returns an interator referring to a random node in the graph.
Definition at line 541 of file networkmp.h.
Returns an ID of a random node in the graph.
Definition at line 539 of file networkmp.h.
Gets the value of str attr from the edge attr value vector.
Definition at line 640 of file networkmp.h.
Definition at line 822 of file networkmp.cpp.
Gets the value of str attr from the node attr value vector.
Definition at line 624 of file networkmp.h.
Definition at line 802 of file networkmp.cpp.
Get Str edge attribute val. If not a proper attr, return default.
Definition at line 262 of file networkmp.h.
Get Str node attribute val. If not a proper attr, return default.
Definition at line 256 of file networkmp.h.
Definition at line 1023 of file networkmp.cpp.
Definition at line 1034 of file networkmp.cpp.
bool TNEANetMP::HasFlag | ( | const TGraphFlag & | Flag | ) | const |
Allows for run-time checking the type of the graph (see the TGraphFlag for flags).
Definition at line 5 of file networkmp.cpp.
Returns a vector of int attr names for edge EId.
Definition at line 427 of file networkmp.h.
void TNEANetMP::IntAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 169 of file networkmp.cpp.
Returns a vector of int attr names for node NId.
Definition at line 394 of file networkmp.h.
void TNEANetMP::IntAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 47 of file networkmp.cpp.
Returns a vector of attr values for edge EId.
Definition at line 431 of file networkmp.h.
void TNEANetMP::IntAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 179 of file networkmp.cpp.
Returns a vector of attr values for node NId.
Definition at line 398 of file networkmp.h.
void TNEANetMP::IntAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 57 of file networkmp.cpp.
|
inline |
Tests whether an edge with edge ID EId exists in 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 522 of file networkmp.h.
|
inline |
Tests whether an edge between node IDs SrcNId and DstNId exists in the graph.
Definition at line 524 of file networkmp.h.
bool TNEANetMP::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 480 of file networkmp.cpp.
bool TNEANetMP::IsFltAttrE | ( | const TStr & | attr | ) |
Definition at line 1042 of file networkmp.cpp.
bool TNEANetMP::IsIntAttrE | ( | const TStr & | attr | ) |
Definition at line 1047 of file networkmp.cpp.
|
inline |
If the node of ID NId does not exist the function aborts.
Tests whether ID NId is a node.
Definition at line 350 of file networkmp.h.
bool TNEANetMP::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 526 of file networkmp.cpp.
bool TNEANetMP::IsStrAttrE | ( | const TStr & | attr | ) |
Definition at line 1052 of file networkmp.cpp.
Static constructor that loads the graph from a stream SIn and returns a pointer to it.
Definition at line 322 of file networkmp.h.
|
inlinestatic |
Static cons returns pointer to graph. Ex: PNEANetMP Graph=TNEANetMP::New().
Definition at line 316 of file networkmp.h.
|
inlinestatic |
Static constructor that returns a pointer to the graph and reserves enough memory for Nodes nodes and Edges edges.
Call: PNEANetMP Graph = TNEANetMP::New(Nodes, Edges).
Definition at line 320 of file networkmp.h.
bool TNEANetMP::NodeAttrIsDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 110 of file networkmp.cpp.
bool TNEANetMP::NodeAttrIsFltDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 129 of file networkmp.cpp.
bool TNEANetMP::NodeAttrIsIntDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 117 of file networkmp.cpp.
bool TNEANetMP::NodeAttrIsStrDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 123 of file networkmp.cpp.
Definition at line 325 of file networkmp.h.
|
inline |
Reserves memory for a graph of Nodes nodes and Edges edges.
Definition at line 560 of file networkmp.h.
|
inline |
|
inline |
|
inline |
|
inline |
Saves the graph to a (binary) stream SOut.
Definition at line 306 of file networkmp.h.
|
inline |
|
inline |
Sets the MaxEId. Used since AddEdgeUnchecked doesn't affect EId for efficiency.
Definition at line 501 of file networkmp.h.
|
inline |
Returns a vector of str attr names for node NId.
Definition at line 435 of file networkmp.h.
void TNEANetMP::StrAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 190 of file networkmp.cpp.
Returns a vector of str attr names for node NId.
Definition at line 402 of file networkmp.h.
void TNEANetMP::StrAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 68 of file networkmp.cpp.
Returns a vector of attr values for node NId.
Definition at line 439 of file networkmp.h.
void TNEANetMP::StrAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 200 of file networkmp.cpp.
Returns a vector of attr values for node NId.
Definition at line 406 of file networkmp.h.
void TNEANetMP::StrAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 78 of file networkmp.cpp.
Definition at line 716 of file networkmp.h.
|
private |
Definition at line 267 of file networkmp.h.
Definition at line 270 of file networkmp.h.
Definition at line 276 of file networkmp.h.
Definition at line 276 of file networkmp.h.
Definition at line 274 of file networkmp.h.
Definition at line 274 of file networkmp.h.
|
private |
Definition at line 272 of file networkmp.h.
|
private |
KeyToIndexType[N|E]: Key->(Type,Index).
Definition at line 272 of file networkmp.h.
|
private |
Definition at line 268 of file networkmp.h.
|
private |
Definition at line 268 of file networkmp.h.
Definition at line 269 of file networkmp.h.
Definition at line 275 of file networkmp.h.
Definition at line 275 of file networkmp.h.
Definition at line 279 of file networkmp.h.
Definition at line 279 of file networkmp.h.
Definition at line 277 of file networkmp.h.
Definition at line 277 of file networkmp.h.
Definition at line 278 of file networkmp.h.
Definition at line 278 of file networkmp.h.