SNAP Library 4.0, Developer Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Directed network. More...
#include <network.h>
Classes | |
class | TEdgeI |
Edge iterator. Only forward iteration (operator++) is supported. More... | |
class | TNode |
class | TNodeFunctor |
class | TNodeI |
Node iterator. Only forward iteration (operator++) is supported. More... | |
Public Types | |
typedef TDirNet | TNet |
typedef TPt< TDirNet > | PNet |
Public Member Functions | |
TDirNet () | |
TDirNet (const int &Nodes, const int &Edges) | |
Constructor that reserves enough memory for a network of Nodes nodes and Edges edges. More... | |
TDirNet (const TDirNet &Graph) | |
TDirNet (TSIn &SIn) | |
Constructor that loads the network from a (binary) stream SIn. More... | |
void | Save (TSOut &SOut) const |
Saves the network to a (binary) stream SOut. Expects data structures for sparse attributes. More... | |
void | Save_V1 (TSOut &SOut) const |
Saves the network to a (binary) stream SOut. Available for backwards compatibility. More... | |
bool | HasFlag (const TGraphFlag &Flag) const |
Allows for run-time checking the type of the network (see the TGraphFlag for flags). More... | |
TDirNet & | operator= (const TDirNet &Graph) |
int | GetNodes () const |
Returns the number of nodes in the network. More... | |
int | AddNode (int NId=-1) |
Adds a node of ID NId to the network. More... | |
int | AddNodeUnchecked (int NId=-1) |
Adds a node of ID NId to the network, noop if the node already exists. More... | |
int | AddNode (const TNodeI &NodeId) |
Adds a node of ID NodeI.GetId() to the network. More... | |
int | AddNode (const int &NId, const TIntV &InNIdV, const TIntV &OutNIdV) |
Adds a node of ID NId to the network, creates edges to the node from all nodes in vector InNIdV, creates edges from the node to all nodes in vector OutNIdV. More... | |
int | AddNode (const int &NId, const TVecPool< TInt > &Pool, const int &SrcVId, const int &DstVId) |
Adds a node of ID NId to the network, creates edges to the node from all nodes in vector InNIdV in the vector pool Pool, creates edges from the node to all nodes in vector OutNIdVin the vector pool Pool . More... | |
void | DelNode (const int &NId) |
Deletes node of ID NId from the network. More... | |
void | DelNode (const TNode &NodeI) |
Deletes node of ID NodeI.GetId() from the network. 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 network. More... | |
TNodeI | EndNI () const |
Returns an iterator referring to the past-the-end node in the network. More... | |
TNodeI | GetNI (const int &NId) const |
Returns an iterator referring to the node of ID NId in the network. More... | |
int | GetMxNId () const |
Returns an ID that is larger than any node ID in the network. More... | |
int | GetEdges () const |
Returns the number of edges in the network. More... | |
int | AddEdge (const int &SrcNId, const int &DstNId) |
Adds an edge from node SrcNId to node DstNId to the network. More... | |
int | AddEdgeUnchecked (const int &SrcNId, const int &DstNId) |
Adds an edge from node SrcNId to node DstNId to the network. More... | |
int | AddEdge (const TEdgeI &EdgeI) |
void | DelEdge (const int &SrcNId, const int &DstNId, const bool &IsDir=true) |
Deletes an edge from node IDs SrcNId to DstNId from the network. More... | |
bool | IsEdge (const int &SrcNId, const int &DstNId, const bool &IsDir=true) const |
Tests whether an edge from node IDs SrcNId to DstNId exists in the network. More... | |
TEdgeI | BegEI () const |
Returns an iterator referring to the first edge in the network. More... | |
TEdgeI | EndEI () const |
Returns an iterator referring to the past-the-end edge in the network. More... | |
TEdgeI | GetEI (const int &EId) const |
Not supported/implemented! More... | |
TEdgeI | GetEI (const int &SrcNId, const int &DstNId) const |
Returns an iterator referring to edge (SrcNId, DstNId) in the network. More... | |
int | GetRndNId (TRnd &Rnd=TInt::Rnd) |
Returns an ID of a random node in the network. More... | |
TNodeI | GetRndNI (TRnd &Rnd=TInt::Rnd) |
Returns an interator referring to a random node in the network. More... | |
void | GetNIdV (TIntV &NIdV) const |
Gets a vector IDs of all nodes in the network. More... | |
bool | Empty () const |
Tests whether the network is empty (has zero nodes). More... | |
void | Clr () |
Deletes all nodes and edges from the network. More... | |
void | Reserve (const int &Nodes, const int &Edges) |
Reserves memory for a network of Nodes nodes and Edges edges. More... | |
void | ReserveNIdInDeg (const int &NId, const int &InDeg) |
Reserves memory for node ID NId having InDeg in-edges. More... | |
void | ReserveNIdOutDeg (const int &NId, const int &OutDeg) |
Reserves memory for node ID NId having OutDeg out-edges. More... | |
void | SortNodeAdjV () |
Sorts the adjacency lists of each node. More... | |
void | Defrag (const bool &OnlyNodeLinks=false) |
Defragments the network. More... | |
bool | IsOk (const bool &ThrowExcept=true) const |
Checks the network data structure for internal consistency. More... | |
void | Dump (FILE *OutF=stdout) const |
Print the network in a human readable form to an output stream OutF. More... | |
int | AddSAttrDatN (const TInt &NId, const TStr &AttrName, const TInt &Val) |
Adds Int sparse attribute with name AttrName to the given node with id NId . More... | |
int | AddSAttrDatN (const TInt &NId, const TInt &AttrId, const TInt &Val) |
Adds Int sparse attribute with id AttrId to the given node with id NId . More... | |
int | AddSAttrDatN (const TNodeI &NodeI, const TStr &AttrName, const TInt &Val) |
Adds Int sparse attribute with name AttrName to NodeI . More... | |
int | AddSAttrDatN (const TNodeI &NodeI, const TInt &AttrId, const TInt &Val) |
Adds Int sparse attribute with id AttrId to NodeI . More... | |
int | AddSAttrDatN (const TInt &NId, const TStr &AttrName, const TFlt &Val) |
Adds Flt sparse attribute with name AttrName to the given node with id NId . More... | |
int | AddSAttrDatN (const TInt &NId, const TInt &AttrId, const TFlt &Val) |
Adds Flt sparse attribute with id AttrId to the given node with id NId . More... | |
int | AddSAttrDatN (const TNodeI &NodeI, const TStr &AttrName, const TFlt &Val) |
Adds Flt sparse attribute with name AttrName to NodeI . More... | |
int | AddSAttrDatN (const TNodeI &NodeI, const TInt &AttrId, const TFlt &Val) |
Adds Flt sparse attribute with id AttrId to NodeI . More... | |
int | AddSAttrDatN (const TInt &NId, const TStr &AttrName, const TStr &Val) |
Adds Str sparse attribute with name AttrName to the given node with id NId . More... | |
int | AddSAttrDatN (const TInt &NId, const TInt &AttrId, const TStr &Val) |
Adds Str sparse attribute with id AttrId to the given node with id NId . More... | |
int | AddSAttrDatN (const TNodeI &NodeI, const TStr &AttrName, const TStr &Val) |
Adds Str sparse attribute with name AttrName to NodeI . More... | |
int | AddSAttrDatN (const TNodeI &NodeI, const TInt &AttrId, const TStr &Val) |
Adds Str sparse attribute with id AttrId to NodeI . More... | |
int | GetSAttrDatN (const TInt &NId, const TStr &AttrName, TInt &ValX) const |
Gets Int sparse attribute with name AttrName from node with id NId . More... | |
int | GetSAttrDatN (const TInt &NId, const TInt &AttrId, TInt &ValX) const |
Gets Int sparse attribute with id AttrId from node with id NId . More... | |
int | GetSAttrDatN (const TNodeI &NodeI, const TStr &AttrName, TInt &ValX) const |
Gets Int sparse attribute with name AttrName from NodeI . More... | |
int | GetSAttrDatN (const TNodeI &NodeI, const TInt &AttrId, TInt &ValX) const |
Gets Int sparse attribute with id AttrId from NodeI . More... | |
int | GetSAttrDatN (const TInt &NId, const TStr &AttrName, TFlt &ValX) const |
Gets Flt sparse attribute with name AttrName from node with id NId . More... | |
int | GetSAttrDatN (const TInt &NId, const TInt &AttrId, TFlt &ValX) const |
Gets Flt sparse attribute with id AttrId from node with id NId . More... | |
int | GetSAttrDatN (const TNodeI &NodeI, const TStr &AttrName, TFlt &ValX) const |
Gets Flt sparse attribute with name AttrName from NodeI . More... | |
int | GetSAttrDatN (const TNodeI &NodeI, const TInt &AttrId, TFlt &ValX) const |
Gets Flt sparse attribute with id AttrId from NodeI . More... | |
int | GetSAttrDatN (const TInt &NId, const TStr &AttrName, TStr &ValX) const |
Gets Str sparse attribute with name AttrName from node with id NId . More... | |
int | GetSAttrDatN (const TInt &NId, const TInt &AttrId, TStr &ValX) const |
Gets Str sparse attribute with id AttrId from node with id NId . More... | |
int | GetSAttrDatN (const TNodeI &NodeI, const TStr &AttrName, TStr &ValX) const |
Gets Str sparse attribute with name AttrName from NodeI . More... | |
int | GetSAttrDatN (const TNodeI &NodeI, const TInt &AttrId, TStr &ValX) const |
Gets Str sparse attribute with id AttrId from NodeI . More... | |
int | DelSAttrDatN (const TInt &NId, const TStr &AttrName) |
Deletes sparse attribute with name AttrName from node with id NId . More... | |
int | DelSAttrDatN (const TInt &NId, const TInt &AttrId) |
Deletes sparse attribute with id AttrId from node with id NId . More... | |
int | DelSAttrDatN (const TNodeI &NodeI, const TStr &AttrName) |
Deletes sparse attribute with name AttrName from NodeI . More... | |
int | DelSAttrDatN (const TNodeI &NodeI, const TInt &AttrId) |
Deletes sparse attribute with id AttrId from NodeI . More... | |
int | GetSAttrVN (const TInt &NId, const TAttrType AttrType, TAttrPrV &AttrV) const |
Gets a list of all sparse attributes of type AttrType for node with id NId . More... | |
int | GetSAttrVN (const TNodeI &NodeI, const TAttrType AttrType, TAttrPrV &AttrV) const |
Gets a list of all sparse attributes of type AttrType for NodeI . More... | |
int | GetIdVSAttrN (const TStr &AttrName, TIntV &IdV) const |
Gets a list of all nodes that have a sparse attribute with name AttrName . More... | |
int | GetIdVSAttrN (const TInt &AttrId, TIntV &IdV) const |
Gets a list of all nodes that have a sparse attribute with id AttrId . More... | |
int | AddSAttrN (const TStr &Name, const TAttrType &AttrType, TInt &AttrId) |
Adds mapping for sparse attribute with name Name and type AttrType . More... | |
int | GetSAttrIdN (const TStr &Name, TInt &AttrIdX, TAttrType &AttrTypeX) const |
Gets id and type for attribute with name Name . More... | |
int | GetSAttrNameN (const TInt &AttrId, TStr &NameX, TAttrType &AttrTypeX) const |
Gets name and type for attribute with id AttrId . More... | |
int | AddSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName, const TInt &Val) |
Adds Int sparse attribute with name AttrName to the given edge with ids SrcId and DstId . More... | |
int | AddSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId, const TInt &Val) |
Adds Int sparse attribute with id AttrId to the given edge with ids SrcId and DstId . More... | |
int | AddSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName, const TInt &Val) |
Adds Int sparse attribute with name AttrName to EdgeI . More... | |
int | AddSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId, const TInt &Val) |
Adds Int sparse attribute with id AttrId to EdgeI . More... | |
int | AddSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName, const TFlt &Val) |
Adds Flt sparse attribute with name AttrName to the given edge with ids SrcId and DstId . More... | |
int | AddSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId, const TFlt &Val) |
Adds Flt sparse attribute with id AttrId to the given edge with ids SrcId and DstId . More... | |
int | AddSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName, const TFlt &Val) |
Adds Flt sparse attribute with name AttrName to EdgeI . More... | |
int | AddSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId, const TFlt &Val) |
Adds Flt sparse attribute with id AttrId to EdgeI . More... | |
int | AddSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName, const TStr &Val) |
Adds Str sparse attribute with name AttrName to the given edge with ids SrcId and DstId . More... | |
int | AddSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId, const TStr &Val) |
Adds Str sparse attribute with id AttrId to the given edge with ids SrcId and DstId . More... | |
int | AddSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName, const TStr &Val) |
Adds Str sparse attribute with name AttrName to EdgeI . More... | |
int | AddSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId, const TStr &Val) |
Adds Str sparse attribute with id AttrId to EdgeI . More... | |
int | GetSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName, TInt &ValX) const |
Gets Int sparse attribute with name AttrName from edge with ids SrcId and DstId . More... | |
int | GetSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId, TInt &ValX) const |
Gets Int sparse attribute with id AttrId from edge with ids SrcId and DstId . More... | |
int | GetSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName, TInt &ValX) const |
Gets Int sparse attribute with name AttrName from EdgeI . More... | |
int | GetSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId, TInt &ValX) const |
Gets Int sparse attribute with id AttrId from EdgeI . More... | |
int | GetSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName, TFlt &ValX) const |
Gets Flt sparse attribute with name AttrName from edge with ids SrcId and DstId . More... | |
int | GetSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId, TFlt &ValX) const |
Gets Flt sparse attribute with id AttrId from edge with ids SrcId and DstId . More... | |
int | GetSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName, TFlt &ValX) const |
Gets Flt sparse attribute with name AttrName from EdgeI . More... | |
int | GetSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId, TFlt &ValX) const |
Gets Flt sparse attribute with id AttrId from EdgeI . More... | |
int | GetSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName, TStr &ValX) const |
Gets Str sparse attribute with name AttrName from edge with ids SrcId and DstId . More... | |
int | GetSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId, TStr &ValX) const |
Gets Str sparse attribute with id AttrId from edge with ids SrcId and DstId . More... | |
int | GetSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName, TStr &ValX) const |
Gets Str sparse attribute with name AttrName from EdgeI . More... | |
int | GetSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId, TStr &ValX) const |
Gets Str sparse attribute with id AttrId from EdgeI . More... | |
int | DelSAttrDatE (const int &SrcNId, const int &DstNId, const TStr &AttrName) |
Deletes sparse attribute with name AttrName from edge with ids SrcId and DstId . More... | |
int | DelSAttrDatE (const int &SrcNId, const int &DstNId, const TInt &AttrId) |
Deletes sparse attribute with id AttrId from edge with ids SrcId and DstId . More... | |
int | DelSAttrDatE (const TEdgeI &EdgeI, const TStr &AttrName) |
Deletes sparse attribute with name AttrName from EdgeI . More... | |
int | DelSAttrDatE (const TEdgeI &EdgeI, const TInt &AttrId) |
Deletes sparse attribute with id AttrId from EdgeI . More... | |
int | GetSAttrVE (const int &SrcNId, const int &DstNId, const TAttrType AttrType, TAttrPrV &AttrV) const |
Gets a list of all sparse attributes of type AttrType for edge with ids SrcId and DstId . More... | |
int | GetSAttrVE (const TEdgeI &EdgeI, const TAttrType AttrType, TAttrPrV &AttrV) const |
Gets a list of all sparse attributes of type AttrType for EdgeI . More... | |
int | GetIdVSAttrE (const TStr &AttrName, TIntPrV &IdV) const |
Gets a list of all edges that have a sparse attribute with name AttrName . More... | |
int | GetIdVSAttrE (const TInt &AttrId, TIntPrV &IdV) const |
Gets a list of all edges that have a sparse attribute with id AttrId . More... | |
int | AddSAttrE (const TStr &Name, const TAttrType &AttrType, TInt &AttrId) |
Adds mapping for sparse attribute with name Name and type AttrType . More... | |
int | GetSAttrIdE (const TStr &Name, TInt &AttrIdX, TAttrType &AttrTypeX) const |
Gets id and type for attribute with name Name . More... | |
int | GetSAttrNameE (const TInt &AttrId, TStr &NameX, TAttrType &AttrTypeX) const |
Gets name and type for attribute with id AttrId . More... | |
Static Public Member Functions | |
static PDirNet | New () |
Static constructor that returns a pointer to the network. Call: PDirNet Graph = TDirNet::New(). More... | |
static PDirNet | New (const int &Nodes, const int &Edges) |
Static constructor that returns a pointer to the network and reserves enough memory for Nodes nodes and Edges edges. More... | |
static PDirNet | Load (TSIn &SIn) |
Static constructor that loads the network from a stream SIn and returns a pointer to it. More... | |
static PDirNet | Load_V1 (TSIn &SIn) |
Static constructor that loads the network from a stream SIn and returns a pointer to it. Backwards compatible. More... | |
static PDirNet | LoadShM (TShMIn &ShMIn) |
Static constructor that loads the network from memory. More... | |
static PDirNet | GetSmallGraph () |
Returns a small network on 5 nodes and 6 edges. More... | |
Private Member Functions | |
TNode & | GetNode (const int &NId) |
const TNode & | GetNode (const int &NId) const |
void | LoadNetworkShM (TShMIn &ShMIn) |
Private Attributes | |
TCRef | CRef |
TInt | MxNId |
THash< TInt, TNode > | NodeH |
TAttr | SAttrN |
TAttrPair | SAttrE |
Friends | |
class | TPt< TDirNet > |
class | TDirNetMtx |
Directed network.
Node IDs can be arbitrary non-negative integers. Nodes and edges can have sparse attributes/data associated with them. There is at most one directed edge from one source node to a destination node. There can be an edge between the same pair of nodes in the opposite direction. Self loops (one per node) are allowed but multiple (parallel) edges are not. The directed graph 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.
typedef TPt<TDirNet> TDirNet::PNet |
typedef TDirNet TDirNet::TNet |
|
inlineexplicit |
Constructor that reserves enough memory for a network of Nodes nodes and Edges edges.
Definition at line 3846 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::Reserve().
|
inline |
int TDirNet::AddEdge | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Adds an edge from node SrcNId to node DstNId to the network.
If the edge already exists return -2. If the edge was successfully added return -1. Normally the function should return an ID of the edge added but since edges in TDirNet have no IDs we return -1. Function aborts if SrcNId or DstNId are not nodes in the graph.
Definition at line 2391 of file network.cpp.
References TStr::Fmt(), TNEANet::GetNode(), IAssertR, TNEANet::IsEdge(), and TNEANet::IsNode().
|
inline |
Definition at line 3959 of file network.h.
References AddEdge(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Referenced by AddEdge().
int TDirNet::AddEdgeUnchecked | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Adds an edge from node SrcNId to node DstNId to the network.
Returns -1. The method assumes that SrcNId and DstNId are existing nodes in the graph and adds new neighbor values at the end of their adjacency vectors. No checks are performed to verify these assumptions. Adjacency vectors must be sorted and have duplicates removed after a sequence of these operations to assure consistency of data structures.
Definition at line 2400 of file network.cpp.
References TNEANet::GetNode().
int TDirNet::AddNode | ( | int | NId = -1 | ) |
Adds a node of ID NId to the network.
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 2300 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TStr::Fmt(), IAssertR, TNEANet::IsNode(), TMath::Mx(), TNEANet::MxNId, and TNEANet::NodeH.
|
inline |
Adds a node of ID NodeI.GetId() to the network.
Definition at line 3896 of file network.h.
References AddNode(), and TDirNet::TNodeI::GetId().
Referenced by AddNode().
Adds a node of ID NId to the network, creates edges to the node from all nodes in vector InNIdV, creates edges from the node to all nodes in vector OutNIdV.
//OutNIdV) 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.
The operation can create inconsistent graphs when the neighboring nodes in vectors InNIdV and OutNIdV do not exist. Use TDirNet::IsOk to check that the resulting graph is consistent after the operation.
Definition at line 2324 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TStr::Fmt(), IAssertR, TDirNet::TNode::Id, TDirNet::TNode::InNIdV, TNEANet::IsNode(), TMath::Mx(), TNEANet::MxNId, TNEANet::NodeH, TDirNet::TNode::OutNIdV, and TVec< TVal, TSizeTy >::Sort().
int TDirNet::AddNode | ( | const int & | NId, |
const TVecPool< TInt > & | Pool, | ||
const int & | SrcVId, | ||
const int & | DstVId | ||
) |
Adds a node of ID NId to the network, creates edges to the node from all nodes in vector InNIdV in the vector pool Pool, creates edges from the node to all nodes in vector OutNIdVin the vector pool Pool .
//NIdVId) 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.
The operation can create inconsistent graphs when the neighboring nodes stored in the Pool vector are not explicitly added to the graph. Use TDirNet::IsOk to check that the resulting graph is consistent.
Definition at line 2344 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TStr::Fmt(), TVec< TVal, TSizeTy >::GenExt(), TVecPool< TVal, TSizeTy >::GetValVPt(), TVecPool< TVal, TSizeTy >::GetVLen(), IAssertR, TDirNet::TNode::Id, TDirNet::TNode::InNIdV, TNEANet::IsNode(), TMath::Mx(), TNEANet::MxNId, TNEANet::NodeH, TDirNet::TNode::OutNIdV, and TVec< TVal, TSizeTy >::Sort().
int TDirNet::AddNodeUnchecked | ( | int | NId = -1 | ) |
Adds a node of ID NId to the network, noop if the node already exists.
Returns -1, if the node NId already exists. Otherwise, it returns the ID of the node being added. If NId is -1, node ID is automatically assigned.
Definition at line 2311 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TNEANet::IsNode(), TMath::Mx(), TNEANet::MxNId, and TNEANet::NodeH.
int TDirNet::AddSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName, | ||
const TInt & | Val | ||
) |
Adds Int sparse attribute with name AttrName
to the given edge with ids SrcId
and DstId
.
Definition at line 2651 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::AddSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId, | ||
const TInt & | Val | ||
) |
Adds Int sparse attribute with id AttrId
to the given edge with ids SrcId
and DstId
.
Definition at line 2659 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Int sparse attribute with name AttrName
to EdgeI
.
Definition at line 4141 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with id AttrId
to EdgeI
.
Definition at line 4145 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
int TDirNet::AddSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName, | ||
const TFlt & | Val | ||
) |
Adds Flt sparse attribute with name AttrName
to the given edge with ids SrcId
and DstId
.
Definition at line 2667 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::AddSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId, | ||
const TFlt & | Val | ||
) |
Adds Flt sparse attribute with id AttrId
to the given edge with ids SrcId
and DstId
.
Definition at line 2675 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Flt sparse attribute with name AttrName
to EdgeI
.
Definition at line 4155 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Flt sparse attribute with id AttrId
to EdgeI
.
Definition at line 4159 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
int TDirNet::AddSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName, | ||
const TStr & | Val | ||
) |
Adds Str sparse attribute with name AttrName
to the given edge with ids SrcId
and DstId
.
Definition at line 2683 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::AddSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId, | ||
const TStr & | Val | ||
) |
Adds Str sparse attribute with id AttrId
to the given edge with ids SrcId
and DstId
.
Definition at line 2691 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Str sparse attribute with name AttrName
to EdgeI
.
Definition at line 4169 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Str sparse attribute with id AttrId
to EdgeI
.
Definition at line 4173 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2525 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Int sparse attribute with id AttrId
to the given node with id NId
.
Definition at line 2532 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Int sparse attribute with name AttrName
to NodeI
.
Definition at line 4023 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Int sparse attribute with id AttrId
to NodeI
.
Definition at line 4027 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Flt sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2539 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Flt sparse attribute with id AttrId
to the given node with id NId
.
Definition at line 2546 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Flt sparse attribute with name AttrName
to NodeI
.
Definition at line 4037 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Flt sparse attribute with id AttrId
to NodeI
.
Definition at line 4041 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Str sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2553 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Str sparse attribute with id AttrId
to the given node with id NId
.
Definition at line 2560 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Str sparse attribute with name AttrName
to NodeI
.
Definition at line 4051 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Str sparse attribute with id AttrId
to NodeI
.
Definition at line 4055 of file network.h.
References TDirNet::TNodeI::GetId().
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2780 of file network.cpp.
References TAttr::AddSAttr(), and TNEANet::SAttrE.
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2639 of file network.cpp.
References TAttr::AddSAttr(), and TNEANet::SAttrN.
|
inline |
Returns an iterator referring to the first edge in the network.
Definition at line 3969 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::BegNI(), TNodeEdgeNet< TNodeData, TEdgeData >::EndNI(), and TDirNet::TNodeI::GetOutDeg().
|
inline |
Returns an iterator referring to the first node in the network.
Definition at line 3929 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
inline |
Deletes all nodes and edges from the network.
Definition at line 3987 of file network.h.
References THash< TKey, TDat, THashFunc >::Clr(), TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
void TDirNet::Defrag | ( | const bool & | OnlyNodeLinks = false | ) |
Defragments the network.
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 2445 of file network.cpp.
References THash< TKey, TDat, THashFunc >::Defrag(), THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TDirNet::TNode::InNIdV, THash< TKey, TDat, THashFunc >::IsKeyIdEqKeyN(), TNEANet::NodeH, TDirNet::TNode::OutNIdV, and TVec< TVal, TSizeTy >::Pack().
void TDirNet::DelEdge | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const bool & | IsDir = true |
||
) |
Deletes an edge from node IDs SrcNId to DstNId from the network.
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 2406 of file network.cpp.
References TVec< TVal, TSizeTy >::Del(), TAttr::DelSAttrId(), TStr::Fmt(), TNEANet::GetNode(), IAssertR, TDirNet::TNode::InNIdV, TNEANet::IsNode(), TDirNet::TNode::OutNIdV, TNEANet::SAttrE, and TVec< TVal, TSizeTy >::SearchBin().
void TDirNet::DelNode | ( | const int & | NId | ) |
Deletes node of ID NId from the network.
If the node of ID NId does not exist the function aborts.
Definition at line 2362 of file network.cpp.
References TVec< TVal, TSizeTy >::Del(), THash< TKey, TDat, THashFunc >::DelKey(), TAttr::DelSAttrId(), TDirNet::TNode::GetInDeg(), TDirNet::TNode::GetInNId(), TNEANet::GetNode(), TDirNet::TNode::GetOutDeg(), TDirNet::TNode::GetOutNId(), TDirNet::TNode::InNIdV, TNEANet::NodeH, TDirNet::TNode::OutNIdV, TNEANet::SAttrN, and TVec< TVal, TSizeTy >::SearchBin().
|
inline |
Deletes node of ID NodeI.GetId() from the network.
Definition at line 3925 of file network.h.
References DelNode(), and TDirNet::TNode::GetId().
Referenced by DelNode().
int TDirNet::DelSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName | ||
) |
Deletes sparse attribute with name AttrName
from edge with ids SrcId
and DstId
.
Definition at line 2747 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::DelSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId | ||
) |
Deletes sparse attribute with id AttrId
from edge with ids SrcId
and DstId
.
Definition at line 2755 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Deletes sparse attribute with name AttrName
from EdgeI
.
Definition at line 4225 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with id AttrId
from EdgeI
.
Definition at line 4229 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with name AttrName
from node with id NId
.
Definition at line 2609 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Deletes sparse attribute with id AttrId
from node with id NId
.
Definition at line 2616 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Deletes sparse attribute with name AttrName
from NodeI
.
Definition at line 4107 of file network.h.
References TDirNet::TNodeI::GetId().
Deletes sparse attribute with id AttrId
from NodeI
.
Definition at line 4111 of file network.h.
References TDirNet::TNodeI::GetId().
void TDirNet::Dump | ( | FILE * | OutF = stdout | ) | const |
Print the network in a human readable form to an output stream OutF.
Definition at line 2500 of file network.cpp.
References edge, THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TNEANet::GetEdges(), TDirNet::TNode::GetId(), TDirNet::TNode::GetInDeg(), TDirNet::TNode::GetInNId(), TNEANet::GetNodes(), TDirNet::TNode::GetOutDeg(), TDirNet::TNode::GetOutNId(), and TNEANet::NodeH.
|
inline |
Tests whether the network is empty (has zero nodes).
Definition at line 3985 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNodes().
|
inline |
Returns an iterator referring to the past-the-end edge in the network.
Definition at line 3971 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::EndNI().
|
inline |
Returns an iterator referring to the past-the-end node in the network.
Definition at line 3931 of file network.h.
References THash< TKey, TDat, THashFunc >::EndI(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
int TDirNet::GetEdges | ( | ) | const |
Returns the number of edges in the network.
Definition at line 2383 of file network.cpp.
References THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), and TNEANet::NodeH.
TEdgeI TDirNet::GetEI | ( | const int & | EId | ) | const |
Not supported/implemented!
TDirNet::TEdgeI TDirNet::GetEI | ( | const int & | SrcNId, |
const int & | DstNId | ||
) | const |
Returns an iterator referring to edge (SrcNId, DstNId) in the network.
Definition at line 2432 of file network.cpp.
References TNEANet::EndNI(), TNEANet::GetNI(), IAssert, and TDirNet::TNodeI::NodeHI.
Gets a list of all edges that have a sparse attribute with name AttrName
.
Definition at line 2772 of file network.cpp.
References TAttr::GetIdVSAttr(), and TNEANet::SAttrE.
Gets a list of all edges that have a sparse attribute with id AttrId
.
Definition at line 2776 of file network.cpp.
References TAttr::GetIdVSAttr(), and TNEANet::SAttrE.
Gets a list of all nodes that have a sparse attribute with name AttrName
.
Definition at line 2631 of file network.cpp.
References TAttr::GetIdVSAttr(), and TNEANet::SAttrN.
Gets a list of all nodes that have a sparse attribute with id AttrId
.
Definition at line 2635 of file network.cpp.
References TAttr::GetIdVSAttr(), and TNEANet::SAttrN.
|
inline |
Returns an ID that is larger than any node ID in the network.
Definition at line 3937 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId.
|
inline |
Returns an iterator referring to the node of ID NId in the network.
Definition at line 3933 of file network.h.
References THash< TKey, TDat, THashFunc >::GetI(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
void TDirNet::GetNIdV | ( | TIntV & | NIdV | ) | const |
Gets a vector IDs of all nodes in the network.
Definition at line 2439 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(), TNEANet::GetNodes(), and TNEANet::NodeH.
|
inlineprivate |
Definition at line 3827 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
inlineprivate |
Definition at line 3828 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
inline |
Returns the number of nodes in the network.
Definition at line 3882 of file network.h.
References THash< TKey, TDat, THashFunc >::Len(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Returns an interator referring to a random node in the network.
Definition at line 3980 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNI(), and TNodeEdgeNet< TNodeData, TEdgeData >::GetRndNId().
Returns an ID of a random node in the network.
Definition at line 3978 of file network.h.
References THash< TKey, TDat, THashFunc >::GetKey(), THash< TKey, TDat, THashFunc >::GetRndKeyId(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
int TDirNet::GetSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName, | ||
TInt & | ValX | ||
) | const |
Gets Int sparse attribute with name AttrName
from edge with ids SrcId
and DstId
.
Definition at line 2699 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::GetSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId, | ||
TInt & | ValX | ||
) | const |
Gets Int sparse attribute with id AttrId
from edge with ids SrcId
and DstId
.
Definition at line 2707 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Int sparse attribute with name AttrName
from EdgeI
.
Definition at line 4183 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with id AttrId
from EdgeI
.
Definition at line 4187 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
int TDirNet::GetSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName, | ||
TFlt & | ValX | ||
) | const |
Gets Flt sparse attribute with name AttrName
from edge with ids SrcId
and DstId
.
Definition at line 2715 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::GetSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId, | ||
TFlt & | ValX | ||
) | const |
Gets Flt sparse attribute with id AttrId
from edge with ids SrcId
and DstId
.
Definition at line 2723 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Flt sparse attribute with name AttrName
from EdgeI
.
Definition at line 4197 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Flt sparse attribute with id AttrId
from EdgeI
.
Definition at line 4201 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
int TDirNet::GetSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TStr & | AttrName, | ||
TStr & | ValX | ||
) | const |
Gets Str sparse attribute with name AttrName
from edge with ids SrcId
and DstId
.
Definition at line 2731 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TDirNet::GetSAttrDatE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TInt & | AttrId, | ||
TStr & | ValX | ||
) | const |
Gets Str sparse attribute with id AttrId
from edge with ids SrcId
and DstId
.
Definition at line 2739 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Str sparse attribute with name AttrName
from EdgeI
.
Definition at line 4211 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Str sparse attribute with id AttrId
from EdgeI
.
Definition at line 4215 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with name AttrName
from node with id NId
.
Definition at line 2567 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Int sparse attribute with id AttrId
from node with id NId
.
Definition at line 2574 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Int sparse attribute with name AttrName
from NodeI
.
Definition at line 4065 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Int sparse attribute with id AttrId
from NodeI
.
Definition at line 4069 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Flt sparse attribute with name AttrName
from node with id NId
.
Definition at line 2581 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Flt sparse attribute with id AttrId
from node with id NId
.
Definition at line 2588 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Flt sparse attribute with name AttrName
from NodeI
.
Definition at line 4079 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Flt sparse attribute with id AttrId
from NodeI
.
Definition at line 4083 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Str sparse attribute with name AttrName
from node with id NId
.
Definition at line 2595 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Str sparse attribute with id AttrId
from node with id NId
.
Definition at line 2602 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Str sparse attribute with name AttrName
from NodeI
.
Definition at line 4093 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Str sparse attribute with id AttrId
from NodeI
.
Definition at line 4097 of file network.h.
References TDirNet::TNodeI::GetId().
Gets id and type for attribute with name Name
.
Definition at line 2784 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrE.
Gets id and type for attribute with name Name
.
Definition at line 2643 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrN.
Gets name and type for attribute with id AttrId
.
Definition at line 2788 of file network.cpp.
References TAttr::GetSAttrName(), and TNEANet::SAttrE.
Gets name and type for attribute with id AttrId
.
Definition at line 2647 of file network.cpp.
References TAttr::GetSAttrName(), and TNEANet::SAttrN.
int TDirNet::GetSAttrVE | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const TAttrType | AttrType, | ||
TAttrPrV & | AttrV | ||
) | const |
Gets a list of all sparse attributes of type AttrType
for edge with ids SrcId
and DstId
.
Definition at line 2763 of file network.cpp.
References TAttr::GetSAttrV(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Gets a list of all sparse attributes of type AttrType
for EdgeI
.
Definition at line 4235 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets a list of all sparse attributes of type AttrType
for node with id NId
.
Definition at line 2623 of file network.cpp.
References TAttr::GetSAttrV(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Gets a list of all sparse attributes of type AttrType
for NodeI
.
Definition at line 4118 of file network.h.
References TDirNet::TNodeI::GetId().
|
static |
Returns a small network on 5 nodes and 6 edges.
/// Edges: 0 -> 1, 1 -> 2, 0 -> 2, 1 -> 3, 3 -> 4, 2 -> 3 ///
Definition at line 2517 of file network.cpp.
References New().
bool TDirNet::HasFlag | ( | const TGraphFlag & | Flag | ) | const |
Allows for run-time checking the type of the network (see the TGraphFlag for flags).
Definition at line 2296 of file network.cpp.
References HasGraphFlag.
bool TDirNet::IsEdge | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const bool & | IsDir = true |
||
) | const |
Tests whether an edge from node IDs SrcNId to DstNId exists in the network.
Definition at line 2426 of file network.cpp.
References TNEANet::GetNode(), and TNEANet::IsNode().
|
inline |
Tests whether ID NId is a node.
Definition at line 3927 of file network.h.
References THash< TKey, TDat, THashFunc >::IsKey(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
bool TDirNet::IsOk | ( | const bool & | ThrowExcept = true | ) | const |
Checks the network data structure for internal consistency.
For each node in the graph check that its neighbors are also nodes in the graph.
Definition at line 2454 of file network.cpp.
References TStr::CStr(), EAssertR, ErrNotify(), THash< TKey, TDat, THashFunc >::FFirstKeyId(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TDirNet::TNode::GetId(), TDirNet::TNode::GetInDeg(), TDirNet::TNode::GetInNId(), TDirNet::TNode::GetOutDeg(), TDirNet::TNode::GetOutNId(), TDirNet::TNode::InNIdV, TNEANet::IsNode(), TVec< TVal, TSizeTy >::IsSorted(), TNEANet::NodeH, and TDirNet::TNode::OutNIdV.
|
inlineprivate |
Definition at line 3836 of file network.h.
References THash< TKey, TDat, THashFunc >::LoadShM(), TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
Referenced by LoadShM().
Static constructor that loads the network from memory.
The object is read-only. It does not support operations that edit the edge vectors of nodes or perform illegal operations on the NodeH, EdgeH (deletion or swapping keys).
Definition at line 3871 of file network.h.
References LoadNetworkShM().
|
inlinestatic |
Static constructor that returns a pointer to the network. Call: PDirNet Graph = TDirNet::New().
Definition at line 3855 of file network.h.
Referenced by GetSmallGraph().
|
inlinestatic |
Definition at line 3878 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, and NodeH.
|
inline |
Reserves memory for a network of Nodes nodes and Edges edges.
Definition at line 3989 of file network.h.
References THash< TKey, TDat, THashFunc >::Gen(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
inline |
Reserves memory for node ID NId having InDeg in-edges.
Definition at line 3991 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNode().
|
inline |
Reserves memory for node ID NId having OutDeg out-edges.
Definition at line 3993 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNode().
|
inline |
Saves the network to a (binary) stream SOut. Expects data structures for sparse attributes.
Definition at line 3851 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, THash< TKey, TDat, THashFunc >::Save(), and TInt::Save().
|
inline |
Saves the network to a (binary) stream SOut. Available for backwards compatibility.
Definition at line 3853 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, THash< TKey, TDat, THashFunc >::Save(), and TInt::Save().
|
inline |
Sorts the adjacency lists of each node.
Definition at line 3995 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::BegNI(), and TNodeEdgeNet< TNodeData, TEdgeData >::EndNI().
|
private |
Definition at line 3822 of file network.h.
Referenced by operator=().
Definition at line 3823 of file network.h.
Referenced by operator=().