SNAP Library 2.4, Developer Reference
2015-05-11 19:40:56
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 &NodeI) |
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 &NodeI, 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 &NodeI, 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 &NodeI, 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 &EdgeI, 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 &EdgeI, 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 &EdgeI, 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 &NodeI, 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 &NodeI, 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 &NodeI, 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 attr (same as GetAttrIndN for compatibility reasons). More... | |
int | GetAttrIndN (const TStr &attr) |
Gets the index of the node attr value vector specified by attr . More... | |
TInt | GetIntAttrIndDatN (const TNodeI &NodeI, const int &index) |
Gets the value of an int node attr specified by node iterator NodeI and the attr index . More... | |
TInt | GetIntAttrIndDatN (const int &NId, const int &index) |
Gets the value of an int node attr specified by node ID NId and the attr index . More... | |
TStr | GetStrAttrIndDatN (const TNodeI &NodeI, const int &index) |
Gets the value of a string node attr specified by node iterator NodeI and the attr index . More... | |
TStr | GetStrAttrIndDatN (const int &NId, const int &index) |
Gets the value of a string node attr specified by node ID NId and the attr index . More... | |
TFlt | GetFltAttrIndDatN (const TNodeI &NodeI, const int &index) |
Gets the value of a float node attr specified by node iterator NodeI and the attr index . More... | |
TFlt | GetFltAttrIndDatN (const int &NId, const int &index) |
Gets the value of a float node attr specified by node ID NId and the attr index . More... | |
TInt | GetIntAttrDatE (const TEdgeI &EdgeI, 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 &EdgeI, 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 &EdgeI, 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 attr (same as GetAttrIndE for compatibility reasons). More... | |
int | GetAttrIndE (const TStr &attr) |
Gets the index of the edge attr value vector specified by attr . More... | |
TInt | GetIntAttrIndDatE (const TEdgeI &EdgeI, const int &index) |
Gets the value of an int edge attr specified by edge iterator EdgeI and the attr index . More... | |
TInt | GetIntAttrIndDatE (const int &EId, const int &index) |
Gets the value of an int edge attr specified by edge ID EId and the attr index . More... | |
TFlt | GetFltAttrIndDatE (const TEdgeI &EdgeI, const int &index) |
Gets the value of a float edge attr specified by edge iterator EdgeI and the attr index . More... | |
TFlt | GetFltAttrIndDatE (const int &EId, const int &index) |
Gets the value of an int edge attr specified by edge ID EId and the attr index . More... | |
TStr | GetStrAttrIndDatE (const TEdgeI &EdgeI, const int &index) |
Gets the value of a string edge attr specified by edge iterator EdgeI and the attr index . More... | |
TStr | GetStrAttrIndDatE (const int &EId, const int &index) |
Gets the value of an int edge attr specified by edge ID EId and the attr index . More... | |
int | DelAttrDatN (const TNodeI &NodeI, const TStr &attr) |
Deletes the node attribute for NodeI. More... | |
int | DelAttrDatN (const int &NId, const TStr &attr) |
int | DelAttrDatE (const TEdgeI &EdgeI, const TStr &attr) |
Deletes the edge attribute for NodeI. 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 | IsAttrDeletedN (const int &NId, const TStr &attr) const |
bool | IsIntAttrDeletedN (const int &NId, const TStr &attr) const |
bool | IsStrAttrDeletedN (const int &NId, const TStr &attr) const |
bool | IsFltAttrDeletedN (const int &NId, const TStr &attr) const |
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 | IsAttrDeletedE (const int &EId, const TStr &attr) const |
bool | IsIntAttrDeletedE (const int &EId, const TStr &attr) const |
bool | IsStrAttrDeletedE (const int &EId, const TStr &attr) const |
bool | IsFltAttrDeletedE (const int &EId, const TStr &attr) 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 |
void | GetAttrNNames (TStrV &IntAttrNames, TStrV &FltAttrNames, TStrV &StrAttrNames) const |
Fills each of the vectors with the names of node attributes of the given type. More... | |
void | GetAttrENames (TStrV &IntAttrNames, TStrV &FltAttrNames, TStrV &StrAttrNames) const |
Fills each of the vectors with the names of edge attributes of the given type. More... | |
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.
Referenced by Load(), and New().
|
inlineexplicit |
Constructor that reserves enough memory for a graph of nodes and edges.
Definition at line 1848 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::Reserve().
|
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 419 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::AddSorted(), EdgeH, FltDefaultsE, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultE(), GetIntAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), THash< TKey, TDat, THashFunc >::GetKeyV(), GetNode(), TStr::GetNullStr(), GetStrAttrDefaultE(), IAssertR, TNEANet::TNode::InEIdV, TVec< TVal, TSizeTy >::Ins(), IntDefaultsE, IsEdge(), IsNode(), KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), TInt::Mn, TFlt::Mn, TMath::Mx(), MxEId, NodeH, TNEANet::TNode::OutEIdV, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsE, VecOfIntVecsE, and VecOfStrVecsE.
|
inline |
Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the graph.
Definition at line 2058 of file network.h.
References AddEdge(), TNEANet::TEdgeI::GetDstNId(), TNEANet::TEdgeI::GetId(), and TNEANet::TEdgeI::GetSrcNId().
Referenced by AddEdge().
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.
References AddFltAttrDatE(), and TNEANet::TEdgeI::GetId().
Referenced by AddFltAttrDatE().
Definition at line 774 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), EdgeH, FltType, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), IsEdge(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsE.
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.
References AddFltAttrDatN(), and TNEANet::TNodeI::GetId().
Referenced by AddFltAttrDatN().
Definition at line 704 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), FltType, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), IsNode(), KeyToIndexTypeN, MxNId, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsN.
Adds a new Flt edge attribute to the hashmap.
Definition at line 988 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), FltDefaultsE, FltType, TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, VecOfFltVecsE, and VecOfStrVecsE.
Adds a new Flt node attribute to the hashmap.
Definition at line 929 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), FltDefaultsN, FltType, TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, MxNId, VecOfFltVecsN, and VecOfStrVecsN.
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.
References AddIntAttrDatE(), and TNEANet::TEdgeI::GetId().
Referenced by AddIntAttrDatE().
Definition at line 728 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), GetIntAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), IntType, IsEdge(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsE.
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.
References AddIntAttrDatN(), and TNEANet::TNodeI::GetId().
Referenced by AddIntAttrDatN().
Definition at line 658 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), THash< TKey, TDat, THashFunc >::GetDat(), GetIntAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), IntType, THash< TKey, TDat, THashFunc >::IsKey(), IsNode(), KeyToIndexTypeN, MxNId, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsN.
Adds a new Int edge attribute to the hashmap.
Definition at line 949 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), IntDefaultsE, IntType, THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, and VecOfIntVecsE.
Adds a new Int node attribute to the hashmap.
Definition at line 891 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), IntDefaultsN, IntType, THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, MxNId, and VecOfIntVecsN.
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 313 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), FltDefaultsN, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultN(), GetIntAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), THash< TKey, TDat, THashFunc >::GetKeyV(), TStr::GetNullStr(), GetStrAttrDefaultN(), IAssertR, TVec< TVal, TSizeTy >::Ins(), IntDefaultsN, IsNode(), KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), TInt::Mn, TFlt::Mn, TMath::Mx(), MxNId, NodeH, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsN, VecOfIntVecsN, and VecOfStrVecsN.
|
inline |
Adds a node of ID NodeI.GetId() to the graph.
Definition at line 1898 of file network.h.
References AddNode(), and TNEANet::TNodeI::GetId().
Referenced by AddNode().
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.
References AddStrAttrDatE(), and TNEANet::TEdgeI::GetId().
Referenced by AddStrAttrDatE().
Definition at line 751 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultE(), TVec< TVal, TSizeTy >::Ins(), IsEdge(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, StrType, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsE.
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.
References AddStrAttrDatN(), and TNEANet::TNodeI::GetId().
Referenced by AddStrAttrDatN().
Definition at line 681 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultN(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), IsNode(), KeyToIndexTypeN, MxNId, NodeH, StrType, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsN.
int TNEANet::AddStrAttrE | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str edge attribute to the hashmap.
Definition at line 969 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, StrDefaultsE, StrType, and VecOfStrVecsE.
int TNEANet::AddStrAttrN | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str node attribute to the hashmap.
Definition at line 910 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, MxNId, StrDefaultsN, StrType, and VecOfStrVecsN.
Returns a vector of attr names for edge EId.
Definition at line 1976 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
void TNEANet::AttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 172 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsDeleted(), THashKeyDatI< TKey, TDat >::GetKey(), and THashKeyDatI< TKey, TDat >::IsEnd().
Returns a vector of attr names for node NId.
Definition at line 1943 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
void TNEANet::AttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 25 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THashKeyDatI< TKey, TDat >::GetKey(), THashKeyDatI< TKey, TDat >::IsEnd(), and NodeAttrIsDeleted().
Returns a vector of attr values for edge EId.
Definition at line 1980 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
void TNEANet::AttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 182 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsDeleted(), GetEdgeAttrValue(), and THashKeyDatI< TKey, TDat >::IsEnd().
Returns a vector of attr values for node NId.
Definition at line 1947 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
void TNEANet::AttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 35 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), GetNodeAttrValue(), THashKeyDatI< TKey, TDat >::IsEnd(), and NodeAttrIsDeleted().
Returns an iterator referring to the first edge's flt attribute.
Definition at line 2032 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsE.
Returns an iterator referring to the first edge's int attribute.
Definition at line 2009 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsE.
Returns an iterator referring to the first edge's str attribute.
Definition at line 2021 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsE.
|
inline |
Returns an iterator referring to the first edge in the graph.
Definition at line 2076 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH.
Referenced by Dump().
Returns an iterator referring to the first node's flt attribute.
Definition at line 1933 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsN.
Returns an iterator referring to the first node's int attribute.
Definition at line 1914 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsN.
Returns an iterator referring to the first node's str attribute.
Definition at line 1923 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsN.
|
inline |
Returns an iterator referring to the first node in the graph.
Definition at line 1908 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Referenced by Dump().
|
inline |
Deletes all nodes and edges from the graph.
Definition at line 2100 of file network.h.
References THash< TKey, TDat, THashFunc >::Clr(), TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, FltDefaultsE, FltDefaultsN, IntDefaultsE, IntDefaultsN, KeyToIndexTypeE, KeyToIndexTypeN, TNodeEdgeNet< TNodeData, TEdgeData >::MxEId, TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, StrDefaultsE, StrDefaultsN, VecOfFltVecsE, VecOfFltVecsN, VecOfIntVecsE, VecOfIntVecsN, VecOfStrVecsE, and VecOfStrVecsN.
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 539 of file network.cpp.
References THash< TKey, TDat, THashFunc >::Defrag(), EdgeH, THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TNEANet::TNode::InEIdV, THash< TKey, TDat, THashFunc >::IsKeyIdEqKeyN(), NodeH, TNEANet::TNode::OutEIdV, and TVec< TVal, TSizeTy >::Pack().
Deletes the edge attribute for NodeI.
Definition at line 2220 of file network.h.
References DelAttrDatE(), and TNEANet::TEdgeI::GetId().
Referenced by DelAttrDatE().
int TNEANet::DelAttrDatE | ( | const int & | EId, |
const TStr & | attr | ||
) |
Definition at line 876 of file network.cpp.
References EdgeH, FltType, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultE(), GetIntAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultE(), IntType, KeyToIndexTypeE, StrType, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsE, VecOfIntVecsE, and VecOfStrVecsE.
Deletes the node attribute for NodeI.
Definition at line 2217 of file network.h.
References DelAttrDatN(), and TNEANet::TNodeI::GetId().
Referenced by DelAttrDatN().
int TNEANet::DelAttrDatN | ( | const int & | NId, |
const TStr & | attr | ||
) |
Definition at line 862 of file network.cpp.
References FltType, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultN(), GetIntAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultN(), IntType, KeyToIndexTypeN, NodeH, StrType, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsN, VecOfIntVecsN, and VecOfStrVecsN.
int TNEANet::DelAttrE | ( | const TStr & | attr | ) |
Removes all the values for edge attr.
Definition at line 1031 of file network.cpp.
References THash< TKey, TDat, THashFunc >::DelKey(), FltDefaultsE, FltType, THash< TKey, TDat, THashFunc >::GetDat(), IntDefaultsE, IntType, THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, StrDefaultsE, StrType, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsE, VecOfIntVecsE, and VecOfStrVecsE.
int TNEANet::DelAttrN | ( | const TStr & | attr | ) |
Removes all the values for node attr.
Definition at line 1007 of file network.cpp.
References THash< TKey, TDat, THashFunc >::DelKey(), FltDefaultsN, FltType, THash< TKey, TDat, THashFunc >::GetDat(), IntDefaultsN, IntType, THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, StrDefaultsN, StrType, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsN, VecOfIntVecsN, and VecOfStrVecsN.
void TNEANet::DelEdge | ( | const int & | EId | ) |
Deletes an edge with edge ID EId from the graph.
Definition at line 469 of file network.cpp.
References TVec< TVal, TSizeTy >::DelIfIn(), THash< TKey, TDat, THashFunc >::DelKey(), EdgeH, TNEANet::TEdge::GetDstNId(), GetEdge(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetNode(), TStr::GetNullStr(), TNEANet::TEdge::GetSrcNId(), IAssert, TNEANet::TNode::InEIdV, TVec< TVal, TSizeTy >::Ins(), IsEdge(), TInt::Mn, TFlt::Mn, TNEANet::TNode::OutEIdV, VecOfFltVecsE, VecOfIntVecsE, and VecOfStrVecsE.
Referenced by DelEdge().
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 494 of file network.cpp.
References DelEdge(), IAssert, and IsEdge().
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 359 of file network.cpp.
References THash< TKey, TDat, THashFunc >::DelKey(), EdgeH, TNEANet::TEdge::GetDstNId(), GetEdge(), TNEANet::TNode::GetInDeg(), TNEANet::TNode::GetInEId(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetNode(), TStr::GetNullStr(), TNEANet::TNode::GetOutDeg(), TNEANet::TNode::GetOutEId(), TNEANet::TEdge::GetSrcNId(), IAssert, TInt::Mn, TFlt::Mn, NodeH, VecOfFltVecsE, VecOfFltVecsN, VecOfIntVecsE, VecOfIntVecsN, VecOfStrVecsE, and VecOfStrVecsN.
|
inline |
Deletes node of ID NodeI.GetId() from the graph.
Definition at line 1904 of file network.h.
References DelNode(), and TNEANet::TNode::GetId().
Referenced by DelNode().
void TNEANet::Dump | ( | FILE * | OutF = stdout | ) | const |
Print the graph in a human readable form to an output stream OutF.
Definition at line 601 of file network.cpp.
References BegEI(), BegNI(), EndEI(), EndNI(), FltAttrValueEI(), FltAttrValueNI(), GetEdges(), GetNodes(), IntAttrValueEI(), IntAttrValueNI(), TVec< TVal, TSizeTy >::Len(), StrAttrValueEI(), and StrAttrValueNI().
bool TNEANet::EdgeAttrIsDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 274 of file network.cpp.
References EdgeAttrIsFltDeleted(), EdgeAttrIsIntDeleted(), and EdgeAttrIsStrDeleted().
Referenced by AttrNameEI(), and AttrValueEI().
bool TNEANet::EdgeAttrIsFltDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 293 of file network.cpp.
References EdgeH, FltType, THashKeyDatI< TKey, TDat >::GetDat(), GetFltAttrDefaultE(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), and VecOfFltVecsE.
Referenced by EdgeAttrIsDeleted(), FltAttrNameEI(), FltAttrValueEI(), and IsFltAttrDeletedE().
bool TNEANet::EdgeAttrIsIntDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 281 of file network.cpp.
References EdgeH, THashKeyDatI< TKey, TDat >::GetDat(), GetIntAttrDefaultE(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), IntType, and VecOfIntVecsE.
Referenced by EdgeAttrIsDeleted(), IntAttrNameEI(), IntAttrValueEI(), and IsIntAttrDeletedE().
bool TNEANet::EdgeAttrIsStrDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 287 of file network.cpp.
References EdgeH, THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultE(), StrType, and VecOfStrVecsE.
Referenced by EdgeAttrIsDeleted(), IsStrAttrDeletedE(), StrAttrNameEI(), and StrAttrValueEI().
|
inline |
Tests whether the graph is empty (has zero nodes).
Definition at line 2098 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNodes().
Returns an iterator referring to the past-the-end edge's attribute.
Definition at line 2036 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsE.
Returns an iterator referring to the past-the-end edge's attribute.
Definition at line 2013 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsE.
Returns an iterator referring to the past-the-end edge's attribute.
Definition at line 2024 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsE.
|
inline |
Returns an iterator referring to the past-the-end edge in the graph.
Definition at line 2078 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, and THash< TKey, TDat, THashFunc >::EndI().
Referenced by Dump().
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 1936 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsN.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 1917 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsN.
Returns an iterator referring to the past-the-end node's attribute.
Definition at line 1927 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsN.
|
inline |
Returns an iterator referring to the past-the-end node in the graph.
Definition at line 1910 of file network.h.
References THash< TKey, TDat, THashFunc >::EndI(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Referenced by Dump().
Returns a vector of int attr names for node NId.
Definition at line 2000 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
void TNEANet::FltAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 234 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsFltDeleted(), FltType, THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), and THashKeyDatI< TKey, TDat >::IsEnd().
Returns a vector of int attr names for node NId.
Definition at line 1967 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
void TNEANet::FltAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 87 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), FltType, THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THashKeyDatI< TKey, TDat >::IsEnd(), and NodeAttrIsFltDeleted().
Returns a vector of attr values for node NId.
Definition at line 2004 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
Referenced by Dump().
void TNEANet::FltAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 244 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsFltDeleted(), FltType, THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::IsEnd(), and VecOfFltVecsE.
Returns a vector of attr values for node NId.
Definition at line 1971 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
Referenced by Dump().
void TNEANet::FltAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 97 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), FltType, THashKeyDatI< TKey, TDat >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), THashKeyDatI< TKey, TDat >::IsEnd(), NodeAttrIsFltDeleted(), NodeH, and VecOfFltVecsN.
void TNEANet::GetAttrENames | ( | TStrV & | IntAttrNames, |
TStrV & | FltAttrNames, | ||
TStrV & | StrAttrNames | ||
) | const |
Fills each of the vectors with the names of edge attributes of the given type.
Definition at line 1079 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::BegI(), THash< TKey, TDat, THashFunc >::EndI(), FltType, IntType, KeyToIndexTypeE, and StrType.
int TNEANet::GetAttrIndE | ( | const TStr & | attr | ) |
Gets the index of the edge attr value vector specified by attr
.
Definition at line 858 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, and TPair< TVal1, TVal2 >::Val2.
int TNEANet::GetAttrIndN | ( | const TStr & | attr | ) |
Gets the index of the node attr value vector specified by attr
.
Definition at line 826 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, and TPair< TVal1, TVal2 >::Val2.
void TNEANet::GetAttrNNames | ( | TStrV & | IntAttrNames, |
TStrV & | FltAttrNames, | ||
TStrV & | StrAttrNames | ||
) | const |
Fills each of the vectors with the names of node attributes of the given type.
Definition at line 1065 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::BegI(), THash< TKey, TDat, THashFunc >::EndI(), FltType, IntType, KeyToIndexTypeN, and StrType.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 2040 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsE.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 2017 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsE.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 2028 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsE.
|
inlineprivate |
Definition at line 1810 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, and THash< TKey, TDat, THashFunc >::GetDat().
Referenced by DelEdge(), DelNode(), IsEdge(), and TNEANet::TNodeI::IsInNId().
|
inlineprivate |
Definition at line 1811 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, and THash< TKey, TDat, THashFunc >::GetDat().
TStr TNEANet::GetEdgeAttrValue | ( | const int & | EId, |
const TStrIntPrH::TIter & | EdgeHI | ||
) | const |
Definition at line 299 of file network.cpp.
References EdgeH, FltType, THashKeyDatI< TKey, TDat >::GetDat(), THash< TKey, TDat, THashFunc >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), TStr::GetNullStr(), TStr::GetStr(), IntType, KeyToIndexTypeE, StrType, VecOfFltVecsE, VecOfIntVecsE, and VecOfStrVecsE.
Referenced by AttrValueEI().
|
inline |
Returns the number of edges in the graph.
Definition at line 2049 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, and THash< TKey, TDat, THashFunc >::Len().
Referenced by Dump(), and GetEIdV().
|
inline |
Returns an iterator referring to edge with edge ID EId.
Definition at line 2080 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, and THash< TKey, TDat, THashFunc >::GetI().
|
inline |
Returns an iterator referring to edge (SrcNId, DstNId) in the graph.
Definition at line 2082 of file network.h.
References GetEI(), and TNodeEdgeNet< TNodeData, TEdgeData >::GetEId().
Referenced by GetEI().
|
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.
References TNodeEdgeNet< TNodeData, TEdgeData >::IsEdge().
void TNEANet::GetEIdV | ( | TIntV & | EIdV | ) | const |
Gets a vector IDs of all edges in the graph.
Definition at line 532 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeH, THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TVec< TVal, TSizeTy >::Gen(), GetEdges(), and THash< TKey, TDat, THashFunc >::GetKey().
Gets the value of flt attr from the edge attr value vector.
Definition at line 2193 of file network.h.
References GetFltAttrDatE(), and TNEANet::TEdgeI::GetId().
Referenced by GetFltAttrDatE().
Definition at line 838 of file network.cpp.
References EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsE.
Gets the value of flt attr from the node attr value vector.
Definition at line 2163 of file network.h.
References GetFltAttrDatN(), and TNEANet::TNodeI::GetId().
Referenced by GetFltAttrDatN().
Definition at line 806 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsN.
Get Flt edge attribute val. If not a proper attr, return default.
Definition at line 1824 of file network.h.
References FltDefaultsE, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::IsKey(), and TFlt::Mn.
Referenced by AddEdge(), AddFltAttrDatE(), DelAttrDatE(), and EdgeAttrIsFltDeleted().
Get Flt node attribute val. If not a proper attr, return default.
Definition at line 1818 of file network.h.
References FltDefaultsN, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::IsKey(), and TFlt::Mn.
Referenced by AddFltAttrDatN(), AddNode(), DelAttrDatN(), and NodeAttrIsFltDeleted().
Gets the value of a float edge attr specified by edge iterator EdgeI
and the attr index
.
Definition at line 2207 of file network.h.
References GetFltAttrIndDatE(), and TNEANet::TEdgeI::GetId().
Referenced by GetFltAttrIndDatE().
TFlt TNEANet::GetFltAttrIndDatE | ( | const int & | EId, |
const int & | index | ||
) |
Gets the value of an int edge attr specified by edge ID EId
and the attr index
.
Definition at line 850 of file network.cpp.
References EdgeH, THash< TKey, TDat, THashFunc >::GetKeyId(), and VecOfFltVecsE.
Gets the value of a float node attr specified by node iterator NodeI
and the attr index
.
Definition at line 2182 of file network.h.
References GetFltAttrIndDatN(), and TNEANet::TNodeI::GetId().
Referenced by GetFltAttrIndDatN().
TFlt TNEANet::GetFltAttrIndDatN | ( | const int & | NId, |
const int & | index | ||
) |
Gets the value of a float node attr specified by node ID NId
and the attr index
.
Definition at line 818 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetKeyId(), NodeH, and VecOfFltVecsN.
Gets the value of int attr from the edge attr value vector.
Definition at line 2187 of file network.h.
References TNEANet::TEdgeI::GetId(), and GetIntAttrDatE().
Referenced by GetIntAttrDatE().
Definition at line 830 of file network.cpp.
References EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsE.
Gets the value of int attr from the node attr value vector.
Definition at line 2156 of file network.h.
References TNEANet::TNodeI::GetId(), and GetIntAttrDatN().
Referenced by GetIntAttrDatN().
Definition at line 798 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsN.
Get Int edge attribute val. If not a proper attr, return default.
Definition at line 1820 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), IntDefaultsE, THash< TKey, TDat, THashFunc >::IsKey(), and TInt::Mn.
Referenced by AddEdge(), AddIntAttrDatE(), DelAttrDatE(), and EdgeAttrIsIntDeleted().
Get Int node attribute val. If not a proper attr, return default.
Definition at line 1814 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), IntDefaultsN, THash< TKey, TDat, THashFunc >::IsKey(), and TInt::Mn.
Referenced by AddIntAttrDatN(), AddNode(), DelAttrDatN(), and NodeAttrIsIntDeleted().
Gets the value of an int edge attr specified by edge iterator EdgeI
and the attr index
.
Definition at line 2202 of file network.h.
References TNEANet::TEdgeI::GetId(), and GetIntAttrIndDatE().
Referenced by GetIntAttrIndDatE().
TInt TNEANet::GetIntAttrIndDatE | ( | const int & | EId, |
const int & | index | ||
) |
Gets the value of an int edge attr specified by edge ID EId
and the attr index
.
Definition at line 842 of file network.cpp.
References EdgeH, THash< TKey, TDat, THashFunc >::GetKeyId(), and VecOfIntVecsE.
Gets the value of an int node attr specified by node iterator NodeI
and the attr index
.
Definition at line 2172 of file network.h.
References TNEANet::TNodeI::GetId(), and GetIntAttrIndDatN().
Referenced by GetIntAttrIndDatN().
TInt TNEANet::GetIntAttrIndDatN | ( | const int & | NId, |
const int & | index | ||
) |
Gets the value of an int node attr specified by node ID NId
and the attr index
.
Definition at line 810 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetKeyId(), NodeH, and VecOfIntVecsN.
int TNEANet::GetIntAttrIndE | ( | const TStr & | attr | ) |
Gets the index of the edge attr value vector specified by attr
(same as GetAttrIndE for compatibility reasons).
Definition at line 854 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeE, and TPair< TVal1, TVal2 >::Val2.
int TNEANet::GetIntAttrIndN | ( | const TStr & | attr | ) |
Gets the index of the node attr value vector specified by attr
(same as GetAttrIndN for compatibility reasons).
Definition at line 822 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), KeyToIndexTypeN, and TPair< TVal1, TVal2 >::Val2.
|
inline |
Returns an ID that is larger than any edge ID in the network.
Definition at line 2046 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxEId.
|
inline |
Returns an ID that is larger than any node ID in the network.
Definition at line 2044 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1939 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeN, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsN.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1920 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeN, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsN.
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1930 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeN, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsN.
|
inline |
Returns an iterator referring to the node of ID NId in the graph.
Definition at line 1912 of file network.h.
References THash< TKey, TDat, THashFunc >::GetI(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
void TNEANet::GetNIdV | ( | TIntV & | NIdV | ) | const |
Gets a vector IDs of all nodes in the graph.
Definition at line 525 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TVec< TVal, TSizeTy >::Gen(), THash< TKey, TDat, THashFunc >::GetKey(), GetNodes(), and NodeH.
|
inlineprivate |
Definition at line 1808 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Referenced by AddEdge(), DelEdge(), DelNode(), and IsEdge().
|
inlineprivate |
Definition at line 1809 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
TStr TNEANet::GetNodeAttrValue | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 158 of file network.cpp.
References FltType, THashKeyDatI< TKey, TDat >::GetDat(), THash< TKey, TDat, THashFunc >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), TStr::GetNullStr(), TStr::GetStr(), IntType, KeyToIndexTypeN, NodeH, StrType, VecOfFltVecsN, VecOfIntVecsN, and VecOfStrVecsN.
Referenced by AttrValueNI().
|
inline |
Returns the number of nodes in the graph.
Definition at line 1890 of file network.h.
References THash< TKey, TDat, THashFunc >::Len(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Referenced by Dump(), and GetNIdV().
Returns an interator referring to a random edge in the graph.
Definition at line 2091 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetEI(), and TNodeEdgeNet< TNodeData, TEdgeData >::GetRndEId().
Returns an ID of a random edge in the graph.
Definition at line 2089 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, THash< TKey, TDat, THashFunc >::GetKey(), and THash< TKey, TDat, THashFunc >::GetRndKeyId().
Returns an interator referring to a random node in the graph.
Definition at line 2087 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNI(), and TNodeEdgeNet< TNodeData, TEdgeData >::GetRndNId().
Returns an ID of a random node in the graph.
Definition at line 2085 of file network.h.
References THash< TKey, TDat, THashFunc >::GetKey(), THash< TKey, TDat, THashFunc >::GetRndKeyId(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
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 1056 of file network.cpp.
References New().
Gets the value of str attr from the edge attr value vector.
Definition at line 2190 of file network.h.
References TNEANet::TEdgeI::GetId(), and GetStrAttrDatE().
Referenced by GetStrAttrDatE().
Definition at line 834 of file network.cpp.
References EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsE.
Gets the value of str attr from the node attr value vector.
Definition at line 2160 of file network.h.
References TNEANet::TNodeI::GetId(), and GetStrAttrDatN().
Referenced by GetStrAttrDatN().
Definition at line 802 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsN.
Get Str edge attribute val. If not a proper attr, return default.
Definition at line 1822 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), TStr::GetNullStr(), THash< TKey, TDat, THashFunc >::IsKey(), and StrDefaultsE.
Referenced by AddEdge(), AddStrAttrDatE(), DelAttrDatE(), and EdgeAttrIsStrDeleted().
Get Str node attribute val. If not a proper attr, return default.
Definition at line 1816 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), TStr::GetNullStr(), THash< TKey, TDat, THashFunc >::IsKey(), and StrDefaultsN.
Referenced by AddNode(), AddStrAttrDatN(), DelAttrDatN(), and NodeAttrIsStrDeleted().
Gets the value of a string edge attr specified by edge iterator EdgeI
and the attr index
.
Definition at line 2212 of file network.h.
References TNEANet::TEdgeI::GetId(), and GetStrAttrIndDatE().
Referenced by GetStrAttrIndDatE().
TStr TNEANet::GetStrAttrIndDatE | ( | const int & | EId, |
const int & | index | ||
) |
Gets the value of an int edge attr specified by edge ID EId
and the attr index
.
Definition at line 846 of file network.cpp.
References EdgeH, THash< TKey, TDat, THashFunc >::GetKeyId(), and VecOfStrVecsE.
Gets the value of a string node attr specified by node iterator NodeI
and the attr index
.
Definition at line 2177 of file network.h.
References TNEANet::TNodeI::GetId(), and GetStrAttrIndDatN().
Referenced by GetStrAttrIndDatN().
TStr TNEANet::GetStrAttrIndDatN | ( | const int & | NId, |
const int & | index | ||
) |
Gets the value of a string node attr specified by node ID NId
and the attr index
.
Definition at line 814 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetKeyId(), NodeH, and VecOfStrVecsN.
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.
References HasGraphFlag.
Returns a vector of int attr names for edge EId.
Definition at line 1984 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
void TNEANet::IntAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 192 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsIntDeleted(), THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), IntType, and THashKeyDatI< TKey, TDat >::IsEnd().
Returns a vector of int attr names for node NId.
Definition at line 1951 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
void TNEANet::IntAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 45 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), IntType, THashKeyDatI< TKey, TDat >::IsEnd(), and NodeAttrIsIntDeleted().
Returns a vector of attr values for edge EId.
Definition at line 1988 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
Referenced by Dump().
void TNEANet::IntAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 202 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsIntDeleted(), THashKeyDatI< TKey, TDat >::GetDat(), IntType, THashKeyDatI< TKey, TDat >::IsEnd(), and VecOfIntVecsE.
Returns a vector of attr values for node NId.
Definition at line 1955 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
Referenced by Dump().
void TNEANet::IntAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 55 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THashKeyDatI< TKey, TDat >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IntType, THashKeyDatI< TKey, TDat >::IsEnd(), NodeAttrIsIntDeleted(), NodeH, and VecOfIntVecsN.
bool TNEANet::IsAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 255 of file network.cpp.
References IsFltAttrDeletedE(), IsIntAttrDeletedE(), and IsStrAttrDeletedE().
bool TNEANet::IsAttrDeletedN | ( | const int & | NId, |
const TStr & | attr | ||
) | const |
Definition at line 108 of file network.cpp.
References IsFltAttrDeletedN(), IsIntAttrDeletedN(), and IsStrAttrDeletedN().
|
inline |
Tests whether an edge with edge ID EId exists in the graph.
Definition at line 2068 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, and THash< TKey, TDat, THashFunc >::IsKey().
Referenced by AddEdge(), AddFltAttrDatE(), AddIntAttrDatE(), AddStrAttrDatE(), DelEdge(), and IsOk().
|
inline |
Tests whether an edge between node IDs SrcNId and DstNId exists in the graph.
Definition at line 2070 of file network.h.
References IsEdge().
Referenced by IsEdge().
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 504 of file network.cpp.
References TNEANet::TEdge::GetDstNId(), GetEdge(), TNEANet::TEdge::GetId(), TNEANet::TNode::GetInDeg(), TNEANet::TNode::GetInEId(), GetNode(), TNEANet::TNode::GetOutDeg(), TNEANet::TNode::GetOutEId(), and TNEANet::TEdge::GetSrcNId().
bool TNEANet::IsFltAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 270 of file network.cpp.
References EdgeAttrIsFltDeleted(), THash< TKey, TDat, THashFunc >::GetI(), and KeyToIndexTypeE.
Referenced by IsAttrDeletedE().
bool TNEANet::IsFltAttrDeletedN | ( | const int & | NId, |
const TStr & | attr | ||
) | const |
Definition at line 123 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetI(), KeyToIndexTypeN, and NodeAttrIsFltDeleted().
Referenced by IsAttrDeletedN().
bool TNEANet::IsIntAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 262 of file network.cpp.
References EdgeAttrIsIntDeleted(), THash< TKey, TDat, THashFunc >::GetI(), and KeyToIndexTypeE.
Referenced by IsAttrDeletedE().
bool TNEANet::IsIntAttrDeletedN | ( | const int & | NId, |
const TStr & | attr | ||
) | const |
Definition at line 115 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetI(), KeyToIndexTypeN, and NodeAttrIsIntDeleted().
Referenced by IsAttrDeletedN().
|
inline |
Tests whether ID NId is a node.
Definition at line 1906 of file network.h.
References THash< TKey, TDat, THashFunc >::IsKey(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Referenced by AddEdge(), AddFltAttrDatN(), AddIntAttrDatN(), AddNode(), AddStrAttrDatN(), and IsOk().
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 548 of file network.cpp.
References TStr::CStr(), EAssertR, EdgeH, ErrNotify(), THash< TKey, TDat, THashFunc >::FFirstKeyId(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TNEANet::TEdge::GetDstNId(), TNEANet::TNode::GetId(), TNEANet::TEdge::GetId(), TNEANet::TNode::GetInDeg(), TNEANet::TNode::GetInEId(), TNEANet::TNode::GetOutDeg(), TNEANet::TNode::GetOutEId(), TNEANet::TEdge::GetSrcNId(), TNEANet::TNode::InEIdV, IsEdge(), IsNode(), TVec< TVal, TSizeTy >::IsSorted(), NodeH, and TNEANet::TNode::OutEIdV.
bool TNEANet::IsStrAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 266 of file network.cpp.
References EdgeAttrIsStrDeleted(), THash< TKey, TDat, THashFunc >::GetI(), and KeyToIndexTypeE.
Referenced by IsAttrDeletedE().
bool TNEANet::IsStrAttrDeletedN | ( | const int & | NId, |
const TStr & | attr | ||
) | const |
Definition at line 119 of file network.cpp.
References THash< TKey, TDat, THashFunc >::GetI(), KeyToIndexTypeN, and NodeAttrIsStrDeleted().
Referenced by IsAttrDeletedN().
Static constructor that loads the graph from a stream SIn and returns a pointer to it.
Definition at line 1882 of file network.h.
References TNEANet().
|
inlinestatic |
Static cons returns pointer to graph. Ex: PNEANet Graph=TNEANet::New().
Definition at line 1876 of file network.h.
References TNEANet().
Referenced by GetSmallGraph().
|
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.
References TNEANet().
bool TNEANet::NodeAttrIsDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 127 of file network.cpp.
References NodeAttrIsFltDeleted(), NodeAttrIsIntDeleted(), and NodeAttrIsStrDeleted().
Referenced by AttrNameNI(), and AttrValueNI().
bool TNEANet::NodeAttrIsFltDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 150 of file network.cpp.
References FltType, THashKeyDatI< TKey, TDat >::GetDat(), GetFltAttrDefaultN(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), NodeH, and VecOfFltVecsN.
Referenced by FltAttrNameNI(), FltAttrValueNI(), IsFltAttrDeletedN(), and NodeAttrIsDeleted().
bool TNEANet::NodeAttrIsIntDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 134 of file network.cpp.
References THashKeyDatI< TKey, TDat >::GetDat(), GetIntAttrDefaultN(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), IntType, NodeH, and VecOfIntVecsN.
Referenced by IntAttrNameNI(), IntAttrValueNI(), IsIntAttrDeletedN(), and NodeAttrIsDeleted().
bool TNEANet::NodeAttrIsStrDeleted | ( | const int & | NId, |
const TStrIntPrH::TIter & | NodeHI | ||
) | const |
Definition at line 142 of file network.cpp.
References THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultN(), NodeH, StrType, and VecOfStrVecsN.
Referenced by IsStrAttrDeletedN(), NodeAttrIsDeleted(), StrAttrNameNI(), and StrAttrValueNI().
Definition at line 1885 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, EdgeH, TNodeEdgeNet< TNodeData, TEdgeData >::MxEId, MxEId, TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, and NodeH.
|
inline |
Reserves memory for a graph of Nodes nodes and Edges edges.
Definition at line 2106 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, THash< TKey, TDat, THashFunc >::Gen(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
inline |
Saves the graph to a (binary) stream SOut.
Definition at line 1866 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EdgeH, FltDefaultsE, FltDefaultsN, IntDefaultsE, IntDefaultsN, KeyToIndexTypeE, KeyToIndexTypeN, TNodeEdgeNet< TNodeData, TEdgeData >::MxEId, TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, THash< TKey, TDat, THashFunc >::Save(), TInt::Save(), StrDefaultsE, StrDefaultsN, VecOfFltVecsE, VecOfFltVecsN, VecOfIntVecsE, VecOfIntVecsN, VecOfStrVecsE, and VecOfStrVecsN.
Returns a vector of str attr names for node NId.
Definition at line 1992 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
void TNEANet::StrAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 213 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsStrDeleted(), THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THashKeyDatI< TKey, TDat >::IsEnd(), and StrType.
Returns a vector of str attr names for node NId.
Definition at line 1959 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
void TNEANet::StrAttrNameNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 66 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::GetKey(), THashKeyDatI< TKey, TDat >::IsEnd(), NodeAttrIsStrDeleted(), and StrType.
Returns a vector of attr values for node NId.
Definition at line 1996 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeE.
Referenced by Dump().
void TNEANet::StrAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | EdgeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 223 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsStrDeleted(), THashKeyDatI< TKey, TDat >::GetDat(), THashKeyDatI< TKey, TDat >::IsEnd(), StrType, and VecOfStrVecsE.
Returns a vector of attr values for node NId.
Definition at line 1963 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and KeyToIndexTypeN.
Referenced by Dump().
void TNEANet::StrAttrValueNI | ( | const TInt & | NId, |
TStrIntPrH::TIter | NodeHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 76 of file network.cpp.
References TVec< TVal, TSizeTy >::Add(), THashKeyDatI< TKey, TDat >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), THashKeyDatI< TKey, TDat >::IsEnd(), NodeAttrIsStrDeleted(), NodeH, StrType, and VecOfStrVecsN.
Definition at line 1830 of file network.h.
Referenced by AddEdge(), AddFltAttrDatE(), AddIntAttrDatE(), AddStrAttrDatE(), Defrag(), DelAttrDatE(), DelEdge(), DelNode(), EdgeAttrIsFltDeleted(), EdgeAttrIsIntDeleted(), EdgeAttrIsStrDeleted(), GetEdgeAttrValue(), GetEIdV(), GetFltAttrDatE(), GetFltAttrIndDatE(), GetIntAttrDatE(), GetIntAttrIndDatE(), GetStrAttrDatE(), GetStrAttrIndDatE(), IsOk(), and operator=().
Definition at line 1836 of file network.h.
Referenced by AddEdge(), AddFltAttrE(), Clr(), DelAttrE(), GetFltAttrDefaultE(), and Save().
Definition at line 1836 of file network.h.
Referenced by AddFltAttrN(), AddNode(), Clr(), DelAttrN(), GetFltAttrDefaultN(), and Save().
Definition at line 1834 of file network.h.
Referenced by AddEdge(), AddIntAttrE(), Clr(), DelAttrE(), GetIntAttrDefaultE(), and Save().
Definition at line 1834 of file network.h.
Referenced by AddIntAttrN(), AddNode(), Clr(), DelAttrN(), GetIntAttrDefaultN(), and Save().
|
private |
Definition at line 1832 of file network.h.
Referenced by AddEdge(), AddFltAttrDatE(), AddFltAttrE(), AddIntAttrDatE(), AddIntAttrE(), AddStrAttrDatE(), AddStrAttrE(), AttrNameEI(), AttrValueEI(), BegEAFltI(), BegEAIntI(), BegEAStrI(), Clr(), DelAttrDatE(), DelAttrE(), EndEAFltI(), EndEAIntI(), EndEAStrI(), FltAttrNameEI(), FltAttrValueEI(), GetAttrENames(), GetAttrIndE(), GetEAFltI(), GetEAIntI(), GetEAStrI(), GetEdgeAttrValue(), GetFltAttrDatE(), GetIntAttrDatE(), GetIntAttrIndE(), GetStrAttrDatE(), IntAttrNameEI(), IntAttrValueEI(), IsFltAttrDeletedE(), IsIntAttrDeletedE(), IsStrAttrDeletedE(), Save(), StrAttrNameEI(), and StrAttrValueEI().
|
private |
KeyToIndexType[N|E]: Key->(Type,Index).
Definition at line 1832 of file network.h.
Referenced by AddFltAttrDatN(), AddFltAttrN(), AddIntAttrDatN(), AddIntAttrN(), AddNode(), AddStrAttrDatN(), AddStrAttrN(), AttrNameNI(), AttrValueNI(), BegNAFltI(), BegNAIntI(), BegNAStrI(), Clr(), DelAttrDatN(), DelAttrN(), EndNAFltI(), EndNAIntI(), EndNAStrI(), FltAttrNameNI(), FltAttrValueNI(), GetAttrIndN(), GetAttrNNames(), GetFltAttrDatN(), GetIntAttrDatN(), GetIntAttrIndN(), GetNAFltI(), GetNAIntI(), GetNAStrI(), GetNodeAttrValue(), GetStrAttrDatN(), IntAttrNameNI(), IntAttrValueNI(), IsFltAttrDeletedN(), IsIntAttrDeletedN(), IsStrAttrDeletedN(), Save(), StrAttrNameNI(), and StrAttrValueNI().
|
private |
Definition at line 1828 of file network.h.
Referenced by AddEdge(), AddFltAttrDatE(), AddFltAttrE(), AddIntAttrDatE(), AddIntAttrE(), AddStrAttrDatE(), AddStrAttrE(), and operator=().
|
private |
Definition at line 1828 of file network.h.
Referenced by AddFltAttrDatN(), AddFltAttrN(), AddIntAttrDatN(), AddIntAttrN(), AddNode(), AddStrAttrDatN(), AddStrAttrN(), and operator=().
Definition at line 1829 of file network.h.
Referenced by AddEdge(), AddFltAttrDatN(), AddIntAttrDatN(), AddNode(), AddStrAttrDatN(), Defrag(), DelAttrDatN(), DelNode(), FltAttrValueNI(), GetFltAttrDatN(), GetFltAttrIndDatN(), GetIntAttrDatN(), GetIntAttrIndDatN(), GetNIdV(), GetNodeAttrValue(), GetStrAttrDatN(), GetStrAttrIndDatN(), IntAttrValueNI(), IsOk(), NodeAttrIsFltDeleted(), NodeAttrIsIntDeleted(), NodeAttrIsStrDeleted(), operator=(), and StrAttrValueNI().
Definition at line 1835 of file network.h.
Referenced by AddStrAttrE(), Clr(), DelAttrE(), GetStrAttrDefaultE(), and Save().
Definition at line 1835 of file network.h.
Referenced by AddStrAttrN(), Clr(), DelAttrN(), GetStrAttrDefaultN(), and Save().
Definition at line 1839 of file network.h.
Referenced by AddEdge(), AddFltAttrDatE(), AddFltAttrE(), BegEAFltI(), Clr(), DelAttrDatE(), DelAttrE(), DelEdge(), DelNode(), EdgeAttrIsFltDeleted(), EndEAFltI(), FltAttrValueEI(), GetEAFltI(), GetEdgeAttrValue(), GetFltAttrDatE(), GetFltAttrIndDatE(), and Save().
Definition at line 1839 of file network.h.
Referenced by AddFltAttrDatN(), AddFltAttrN(), AddNode(), BegNAFltI(), Clr(), DelAttrDatN(), DelAttrN(), DelNode(), EndNAFltI(), FltAttrValueNI(), GetFltAttrDatN(), GetFltAttrIndDatN(), GetNAFltI(), GetNodeAttrValue(), NodeAttrIsFltDeleted(), and Save().
Definition at line 1837 of file network.h.
Referenced by AddEdge(), AddIntAttrDatE(), AddIntAttrE(), BegEAIntI(), Clr(), DelAttrDatE(), DelAttrE(), DelEdge(), DelNode(), EdgeAttrIsIntDeleted(), EndEAIntI(), GetEAIntI(), GetEdgeAttrValue(), GetIntAttrDatE(), GetIntAttrIndDatE(), IntAttrValueEI(), and Save().
Definition at line 1837 of file network.h.
Referenced by AddIntAttrDatN(), AddIntAttrN(), AddNode(), BegNAIntI(), Clr(), DelAttrDatN(), DelAttrN(), DelNode(), EndNAIntI(), GetIntAttrDatN(), GetIntAttrIndDatN(), GetNAIntI(), GetNodeAttrValue(), IntAttrValueNI(), NodeAttrIsIntDeleted(), and Save().
Definition at line 1838 of file network.h.
Referenced by AddEdge(), AddFltAttrE(), AddStrAttrDatE(), AddStrAttrE(), BegEAStrI(), Clr(), DelAttrDatE(), DelAttrE(), DelEdge(), DelNode(), EdgeAttrIsStrDeleted(), EndEAStrI(), GetEAStrI(), GetEdgeAttrValue(), GetStrAttrDatE(), GetStrAttrIndDatE(), Save(), and StrAttrValueEI().
Definition at line 1838 of file network.h.
Referenced by AddFltAttrN(), AddNode(), AddStrAttrDatN(), AddStrAttrN(), BegNAStrI(), Clr(), DelAttrDatN(), DelAttrN(), DelNode(), EndNAStrI(), GetNAStrI(), GetNodeAttrValue(), GetStrAttrDatN(), GetStrAttrIndDatN(), NodeAttrIsStrDeleted(), Save(), and StrAttrValueNI().