SNAP Library 6.0, Developer Reference
2020-12-09 16:24:20
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 4098 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 2713 of file network.cpp.
References TStr::Fmt(), TNEANet::GetNode(), IAssertR, TNEANet::IsEdge(), and TNEANet::IsNode().
|
inline |
Definition at line 4211 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 2722 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 2622 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 4148 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 2646 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 2666 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 2633 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 2973 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 2981 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Int sparse attribute with name AttrName
to EdgeI
.
Definition at line 4393 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with id AttrId
to EdgeI
.
Definition at line 4397 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 2989 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 2997 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Flt sparse attribute with name AttrName
to EdgeI
.
Definition at line 4407 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Flt sparse attribute with id AttrId
to EdgeI
.
Definition at line 4411 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 3005 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 3013 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Str sparse attribute with name AttrName
to EdgeI
.
Definition at line 4421 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Str sparse attribute with id AttrId
to EdgeI
.
Definition at line 4425 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 2847 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 2854 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Int sparse attribute with name AttrName
to NodeI
.
Definition at line 4275 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Int sparse attribute with id AttrId
to NodeI
.
Definition at line 4279 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 2861 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 2868 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Flt sparse attribute with name AttrName
to NodeI
.
Definition at line 4289 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Flt sparse attribute with id AttrId
to NodeI
.
Definition at line 4293 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 2875 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 2882 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Str sparse attribute with name AttrName
to NodeI
.
Definition at line 4303 of file network.h.
References TDirNet::TNodeI::GetId().
Adds Str sparse attribute with id AttrId
to NodeI
.
Definition at line 4307 of file network.h.
References TDirNet::TNodeI::GetId().
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 3102 of file network.cpp.
References TAttr::AddSAttr(), and TNEANet::SAttrE.
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2961 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 4221 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 4181 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI().
|
inline |
Deletes all nodes and edges from the network.
Definition at line 4239 of file network.h.
References TAttr::Clr(), TAttrPair::Clr(), and THash< TKey, TDat, THashFunc >::Clr().
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 2767 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 2728 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 2684 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 4177 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 3069 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 3077 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Deletes sparse attribute with name AttrName
from EdgeI
.
Definition at line 4477 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with id AttrId
from EdgeI
.
Definition at line 4481 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 2931 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 2938 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Deletes sparse attribute with name AttrName
from NodeI
.
Definition at line 4359 of file network.h.
References TDirNet::TNodeI::GetId().
Deletes sparse attribute with id AttrId
from NodeI
.
Definition at line 4363 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 2822 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 4237 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 4223 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 4183 of file network.h.
References THash< TKey, TDat, THashFunc >::EndI().
int TDirNet::GetEdges | ( | ) | const |
Returns the number of edges in the network.
Definition at line 2705 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 2754 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 3094 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 3098 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 2953 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 2957 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 4189 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 4185 of file network.h.
References THash< TKey, TDat, THashFunc >::GetI().
void TDirNet::GetNIdV | ( | TIntV & | NIdV | ) | const |
Gets a vector IDs of all nodes in the network.
Definition at line 2761 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 4079 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat().
|
inlineprivate |
Definition at line 4080 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat().
|
inline |
Returns the number of nodes in the network.
Definition at line 4134 of file network.h.
References THash< TKey, TDat, THashFunc >::Len().
Returns an interator referring to a random node in the network.
Definition at line 4232 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 4230 of file network.h.
References THash< TKey, TDat, THashFunc >::GetKey(), and THash< TKey, TDat, THashFunc >::GetRndKeyId().
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 3021 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 3029 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Int sparse attribute with name AttrName
from EdgeI
.
Definition at line 4435 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with id AttrId
from EdgeI
.
Definition at line 4439 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 3037 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 3045 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Flt sparse attribute with name AttrName
from EdgeI
.
Definition at line 4449 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Flt sparse attribute with id AttrId
from EdgeI
.
Definition at line 4453 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 3053 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 3061 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Str sparse attribute with name AttrName
from EdgeI
.
Definition at line 4463 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Gets Str sparse attribute with id AttrId
from EdgeI
.
Definition at line 4467 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 2889 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 2896 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Int sparse attribute with name AttrName
from NodeI
.
Definition at line 4317 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Int sparse attribute with id AttrId
from NodeI
.
Definition at line 4321 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Flt sparse attribute with name AttrName
from node with id NId
.
Definition at line 2903 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 2910 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Flt sparse attribute with name AttrName
from NodeI
.
Definition at line 4331 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Flt sparse attribute with id AttrId
from NodeI
.
Definition at line 4335 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Str sparse attribute with name AttrName
from node with id NId
.
Definition at line 2917 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 2924 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Str sparse attribute with name AttrName
from NodeI
.
Definition at line 4345 of file network.h.
References TDirNet::TNodeI::GetId().
Gets Str sparse attribute with id AttrId
from NodeI
.
Definition at line 4349 of file network.h.
References TDirNet::TNodeI::GetId().
Gets id and type for attribute with name Name
.
Definition at line 3106 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrE.
Gets id and type for attribute with name Name
.
Definition at line 2965 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrN.
Gets name and type for attribute with id AttrId
.
Definition at line 3110 of file network.cpp.
References TAttr::GetSAttrName(), and TNEANet::SAttrE.
Gets name and type for attribute with id AttrId
.
Definition at line 2969 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 3085 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 4487 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 2945 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 4370 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 2839 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 2618 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 2748 of file network.cpp.
References TNEANet::GetNode(), and TNEANet::IsNode().
|
inline |
Tests whether ID NId is a node.
Definition at line 4179 of file network.h.
References THash< TKey, TDat, THashFunc >::IsKey().
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 2776 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 4088 of file network.h.
References TAttr::Load(), and THash< TKey, TDat, THashFunc >::LoadShM().
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 4123 of file network.h.
References LoadNetworkShM().
|
inlinestatic |
Static constructor that returns a pointer to the network. Call: PDirNet Graph = TDirNet::New().
Definition at line 4107 of file network.h.
Referenced by GetSmallGraph().
|
inlinestatic |
|
inline |
Reserves memory for a network of Nodes nodes and Edges edges.
Definition at line 4241 of file network.h.
References THash< TKey, TDat, THashFunc >::Gen().
|
inline |
Reserves memory for node ID NId having InDeg in-edges.
Definition at line 4243 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNode().
|
inline |
Reserves memory for node ID NId having OutDeg out-edges.
Definition at line 4245 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 4103 of file network.h.
References TAttr::Save(), TAttrPair::Save(), THash< TKey, TDat, THashFunc >::Save(), and TInt::Save().
|
inline |
Saves the network to a (binary) stream SOut. Available for backwards compatibility.
Definition at line 4105 of file network.h.
References THash< TKey, TDat, THashFunc >::Save(), and TInt::Save().
|
inline |
Sorts the adjacency lists of each node.
Definition at line 4247 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::BegNI(), and TNodeEdgeNet< TNodeData, TEdgeData >::EndNI().
|
private |
Definition at line 4074 of file network.h.
Referenced by operator=().
Definition at line 4075 of file network.h.
Referenced by operator=().