SNAP Library 3.0, Developer Reference
2016-07-20 17:56:49
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 | 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 | 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 IDs SrcNId to node DstNId to the network. More... | |
int | AddEdge (const TEdgeI &EdgeI) |
Adds an edge from EdgeI.GetSrcNId() to EdgeI.GetDstNId() to the network. More... | |
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 | 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 | 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 |
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 |
|
inline |
|
inlineexplicit |
Constructor that reserves enough memory for a network of Nodes nodes and Edges edges.
Definition at line 3377 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::Reserve().
|
inline |
int TDirNet::AddEdge | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Adds an edge from node IDs 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 2222 of file network.cpp.
References TStr::Fmt(), TNEANet::GetNode(), IAssertR, TNEANet::IsEdge(), and TNEANet::IsNode().
|
inline |
Adds an edge from EdgeI.GetSrcNId() to EdgeI.GetDstNId() to the network.
Definition at line 3465 of file network.h.
References AddEdge(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Referenced by AddEdge().
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 2142 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 3411 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 2155 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 2175 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::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 2476 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Referenced by AddSAttrDatE().
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 2484 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Int sparse attribute with name AttrName
to EdgeI
.
Definition at line 3645 of file network.h.
References AddSAttrDatE(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with id AttrId
to EdgeI
.
Definition at line 3649 of file network.h.
References AddSAttrDatE(), 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 2492 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 2500 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Flt sparse attribute with name AttrName
to EdgeI
.
Definition at line 3659 of file network.h.
References AddSAttrDatE(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Flt sparse attribute with id AttrId
to EdgeI
.
Definition at line 3663 of file network.h.
References AddSAttrDatE(), 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 2508 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 2516 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Adds Str sparse attribute with name AttrName
to EdgeI
.
Definition at line 3673 of file network.h.
References AddSAttrDatE(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Str sparse attribute with id AttrId
to EdgeI
.
Definition at line 3677 of file network.h.
References AddSAttrDatE(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2350 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Referenced by AddSAttrDatN().
Adds Int sparse attribute with id AttrId
to the given node with id NId
.
Definition at line 2357 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Int sparse attribute with name AttrName
to NodeI
.
Definition at line 3527 of file network.h.
References AddSAttrDatN(), and TDirNet::TNodeI::GetId().
Adds Int sparse attribute with id AttrId
to NodeI
.
Definition at line 3531 of file network.h.
References AddSAttrDatN(), and TDirNet::TNodeI::GetId().
Adds Flt sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2364 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 2371 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Flt sparse attribute with name AttrName
to NodeI
.
Definition at line 3541 of file network.h.
References AddSAttrDatN(), and TDirNet::TNodeI::GetId().
Adds Flt sparse attribute with id AttrId
to NodeI
.
Definition at line 3545 of file network.h.
References AddSAttrDatN(), and TDirNet::TNodeI::GetId().
Adds Str sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2378 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 2385 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Adds Str sparse attribute with name AttrName
to NodeI
.
Definition at line 3555 of file network.h.
References AddSAttrDatN(), and TDirNet::TNodeI::GetId().
Adds Str sparse attribute with id AttrId
to NodeI
.
Definition at line 3559 of file network.h.
References AddSAttrDatN(), and TDirNet::TNodeI::GetId().
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2605 of file network.cpp.
References TAttr::AddSAttr(), and TNEANet::SAttrE.
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2464 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 3475 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 3444 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 3493 of file network.h.
References TAttr::Clr(), TAttrPair::Clr(), THash< TKey, TDat, THashFunc >::Clr(), TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, SAttrE, and SAttrN.
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 2270 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 2231 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 2193 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 3440 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 2572 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Referenced by DelSAttrDatE().
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 2580 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Deletes sparse attribute with name AttrName
from EdgeI
.
Definition at line 3729 of file network.h.
References DelSAttrDatE(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with id AttrId
from EdgeI
.
Definition at line 3733 of file network.h.
References DelSAttrDatE(), TDirNet::TEdgeI::GetDstNId(), and TDirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with name AttrName
from node with id NId
.
Definition at line 2434 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Referenced by DelSAttrDatN().
Deletes sparse attribute with id AttrId
from node with id NId
.
Definition at line 2441 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Deletes sparse attribute with name AttrName
from NodeI
.
Definition at line 3611 of file network.h.
References DelSAttrDatN(), and TDirNet::TNodeI::GetId().
Deletes sparse attribute with id AttrId
from NodeI
.
Definition at line 3615 of file network.h.
References DelSAttrDatN(), and 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 2325 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 3491 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 3477 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 3446 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 2214 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 2257 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 2597 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 2601 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 2456 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 2460 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 3452 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 3448 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 2264 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 3372 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat(), and TNodeEdgeNet< TNodeData, TEdgeData >::NodeH.
|
inlineprivate |
Definition at line 3373 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 3403 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 3486 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 3484 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 2524 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Referenced by GetSAttrDatE().
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 2532 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Int sparse attribute with name AttrName
from EdgeI
.
Definition at line 3687 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrDatE(), and TDirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with id AttrId
from EdgeI
.
Definition at line 3691 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrDatE(), 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 2540 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 2548 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Flt sparse attribute with name AttrName
from EdgeI
.
Definition at line 3701 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrDatE(), and TDirNet::TEdgeI::GetSrcNId().
Gets Flt sparse attribute with id AttrId
from EdgeI
.
Definition at line 3705 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrDatE(), 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 2556 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 2564 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Gets Str sparse attribute with name AttrName
from EdgeI
.
Definition at line 3715 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrDatE(), and TDirNet::TEdgeI::GetSrcNId().
Gets Str sparse attribute with id AttrId
from EdgeI
.
Definition at line 3719 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrDatE(), and TDirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with name AttrName
from node with id NId
.
Definition at line 2392 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Referenced by GetSAttrDatN().
Gets Int sparse attribute with id AttrId
from node with id NId
.
Definition at line 2399 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Int sparse attribute with name AttrName
from NodeI
.
Definition at line 3569 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrDatN().
Gets Int sparse attribute with id AttrId
from NodeI
.
Definition at line 3573 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrDatN().
Gets Flt sparse attribute with name AttrName
from node with id NId
.
Definition at line 2406 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 2413 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Flt sparse attribute with name AttrName
from NodeI
.
Definition at line 3583 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrDatN().
Gets Flt sparse attribute with id AttrId
from NodeI
.
Definition at line 3587 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrDatN().
Gets Str sparse attribute with name AttrName
from node with id NId
.
Definition at line 2420 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 2427 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Gets Str sparse attribute with name AttrName
from NodeI
.
Definition at line 3597 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrDatN().
Gets Str sparse attribute with id AttrId
from NodeI
.
Definition at line 3601 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrDatN().
Gets id and type for attribute with name Name
.
Definition at line 2609 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrE.
Gets id and type for attribute with name Name
.
Definition at line 2468 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrN.
Gets name and type for attribute with id AttrId
.
Definition at line 2613 of file network.cpp.
References TAttr::GetSAttrName(), and TNEANet::SAttrE.
Gets name and type for attribute with id AttrId
.
Definition at line 2472 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 2588 of file network.cpp.
References TAttr::GetSAttrV(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Referenced by GetSAttrVE().
|
inline |
Gets a list of all sparse attributes of type AttrType
for EdgeI
.
Definition at line 3739 of file network.h.
References TDirNet::TEdgeI::GetDstNId(), GetSAttrVE(), and TDirNet::TEdgeI::GetSrcNId().
Gets a list of all sparse attributes of type AttrType
for node with id NId
.
Definition at line 2448 of file network.cpp.
References TAttr::GetSAttrV(), TNEANet::IsNode(), and TNEANet::SAttrN.
Referenced by GetSAttrVN().
|
inline |
Gets a list of all sparse attributes of type AttrType
for NodeI
.
Definition at line 3622 of file network.h.
References TDirNet::TNodeI::GetId(), and GetSAttrVN().
|
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 2342 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 2138 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 2251 of file network.cpp.
References TNEANet::GetNode(), and TNEANet::IsNode().
|
inline |
Tests whether ID NId is a node.
Definition at line 3442 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 2279 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.
|
inlinestatic |
Static constructor that returns a pointer to the network. Call: PDirNet Graph = TDirNet::New().
Definition at line 3386 of file network.h.
References TDirNet().
Referenced by GetSmallGraph().
|
inlinestatic |
Definition at line 3399 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 3495 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 3497 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::GetNode().
|
inline |
Reserves memory for node ID NId having OutDeg out-edges.
Definition at line 3499 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 3382 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, SAttrE, SAttrN, 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 3384 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::MxNId, TNodeEdgeNet< TNodeData, TEdgeData >::NodeH, THash< TKey, TDat, THashFunc >::Save(), and TInt::Save().
|
private |
Definition at line 3367 of file network.h.
Referenced by operator=().
Definition at line 3368 of file network.h.
Referenced by operator=().
|
private |
|
private |