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
|
Undirected network. More...
#include <network.h>
Classes | |
class | LoadTNodeFunctor |
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 TUndirNet | TNet |
typedef TPt< TUndirNet > | PNet |
Public Member Functions | |
TUndirNet () | |
TUndirNet (const int &Nodes, const int &Edges) | |
Constructor that reserves enough memory for a network of Nodes nodes and Edges edges. More... | |
TUndirNet (const TUndirNet &Graph) | |
TUndirNet (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... | |
TUndirNet & | operator= (const TUndirNet &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 &NodeI) |
Adds a node of ID NodeI.GetId() to the network. More... | |
int | AddNode (const int &NId, const TIntV &NbrNIdV) |
Adds a node of ID NId to the network and create edges to all nodes in vector NbrNIdV. More... | |
int | AddNode (const int &NId, const TVecPool< TInt > &Pool, const int &NIdVId) |
Adds a node of ID NId to the network and create edges to all nodes in vector NIdVId in 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 between node IDs SrcNId and DstNId to the network. More... | |
int | AddEdgeUnchecked (const int &SrcNId, const int &DstNId) |
Adds an edge between node IDs SrcNId and DstNId to the network. More... | |
int | AddEdge (const TEdgeI &EdgeI) |
Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the network. More... | |
void | DelEdge (const int &SrcNId, const int &DstNId) |
Deletes an edge between node IDs SrcNId and DstNId from the network. More... | |
bool | IsEdge (const int &SrcNId, const int &DstNId) const |
Tests whether an edge between node IDs SrcNId and 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 | ReserveNIdDeg (const int &NId, const int &Deg) |
Reserves memory for node ID NId having Deg 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 PUndirNet | New () |
Static constructor that returns a pointer to the network. Call: PUndirNet Graph = TUndirNet::New(). More... | |
static PUndirNet | 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 PUndirNet | Load (TSIn &SIn) |
Static constructor that loads the network from a stream SIn and returns a pointer to it. More... | |
static PUndirNet | Load_V1 (TSIn &SIn) |
Static constructor that loads the network from a stream SIn and returns a pointer to it. Backwards compatible. More... | |
static PUndirNet | LoadShM (TShMIn &ShMIn) |
Static constructor that loads the network from memory. More... | |
static PUndirNet | GetSmallGraph () |
Returns a small network on 5 nodes and 5 edges. More... | |
Private Member Functions | |
TNode & | GetNode (const int &NId) |
const TNode & | GetNode (const int &NId) const |
TIntPr | OrderEdgeNodes (const int &SrcNId, const int &DstNId) const |
void | LoadNetworkShM (TShMIn &ShMIn) |
Private Attributes | |
TCRef | CRef |
TInt | MxNId |
TInt | NEdges |
THash< TInt, TNode > | NodeH |
TAttr | SAttrN |
TAttrPair | SAttrE |
Friends | |
class | TUndirNetMtx |
class | TPt< TUndirNet > |
Undirected 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 undirected edge between a pair of nodes. Self loops (one per node) are allowed but multiple (parallel) edges are not. The undirected 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<TUndirNet> TUndirNet::PNet |
typedef TUndirNet TUndirNet::TNet |
|
inlineexplicit |
Constructor that reserves enough memory for a network of Nodes nodes and Edges edges.
Definition at line 3536 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::Reserve().
|
inline |
int TUndirNet::AddEdge | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Adds an edge between node IDs SrcNId and 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 TUndirNet have no IDs we return -1. The function aborts if SrcNId or DstNId are not nodes in the graph.
Definition at line 2213 of file network.cpp.
References TStr::Fmt(), TNEANet::GetNode(), IAssertR, TNEANet::IsEdge(), and TNEANet::IsNode().
|
inline |
Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the network.
Definition at line 3650 of file network.h.
References AddEdge(), TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Referenced by AddEdge().
int TUndirNet::AddEdgeUnchecked | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Adds an edge between node IDs SrcNId and 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 2224 of file network.cpp.
References TNEANet::GetNode().
int TUndirNet::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 2124 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 3590 of file network.h.
References AddNode(), and TUndirNet::TNodeI::GetId().
Referenced by AddNode().
int TUndirNet::AddNode | ( | const int & | NId, |
const TIntV & | NbrNIdV | ||
) |
Adds a node of ID NId to the network and create edges to all nodes in vector NbrNIdV.
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 NbrNIdV vector do not exist. Use TUndirNet::IsOk to check that the resulting graph is consistent after the operation.
Definition at line 2147 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TStr::Fmt(), TUndirNet::TNode::GetDeg(), TNEANet::GetNode(), IAssertR, TUndirNet::TNode::Id, TNEANet::IsNode(), TVec< TVal, TSizeTy >::Len(), TMath::Mx(), TNEANet::MxNId, TUndirNet::TNode::NIdV, TNEANet::NodeH, and TVec< TVal, TSizeTy >::Sort().
Adds a node of ID NId to the network and create edges to all nodes in vector NIdVId in the vector pool Pool.
//int& 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 TUndirNet::IsOk to check that the resulting graph is consistent.
Definition at line 2168 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TStr::Fmt(), TVec< TVal, TSizeTy >::GenExt(), TUndirNet::TNode::GetDeg(), TVecPool< TVal, TSizeTy >::GetValVPt(), TVecPool< TVal, TSizeTy >::GetVLen(), IAssertR, TUndirNet::TNode::Id, TNEANet::IsNode(), TMath::Mx(), TNEANet::MxNId, TUndirNet::TNode::NIdV, TNEANet::NodeH, and TVec< TVal, TSizeTy >::Sort().
int TUndirNet::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 2135 of file network.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TNEANet::IsNode(), TMath::Mx(), TNEANet::MxNId, and TNEANet::NodeH.
int TUndirNet::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 2475 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2483 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Adds Int sparse attribute with name AttrName
to EdgeI
.
Definition at line 3835 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with id AttrId
to EdgeI
.
Definition at line 3839 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
int TUndirNet::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 2491 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2499 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Adds Flt sparse attribute with name AttrName
to EdgeI
.
Definition at line 3849 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Adds Flt sparse attribute with id AttrId
to EdgeI
.
Definition at line 3853 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
int TUndirNet::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 2507 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2515 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Adds Str sparse attribute with name AttrName
to EdgeI
.
Definition at line 3863 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Adds Str sparse attribute with id AttrId
to EdgeI
.
Definition at line 3867 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Adds Int sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2342 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 2349 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Adds Int sparse attribute with name AttrName
to NodeI
.
Definition at line 3717 of file network.h.
References TUndirNet::TNodeI::GetId().
Adds Int sparse attribute with id AttrId
to NodeI
.
Definition at line 3721 of file network.h.
References TUndirNet::TNodeI::GetId().
Adds Flt sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2356 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 2363 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Adds Flt sparse attribute with name AttrName
to NodeI
.
Definition at line 3731 of file network.h.
References TUndirNet::TNodeI::GetId().
Adds Flt sparse attribute with id AttrId
to NodeI
.
Definition at line 3735 of file network.h.
References TUndirNet::TNodeI::GetId().
Adds Str sparse attribute with name AttrName
to the given node with id NId
.
Definition at line 2370 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 2377 of file network.cpp.
References TAttr::AddSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Adds Str sparse attribute with name AttrName
to NodeI
.
Definition at line 3745 of file network.h.
References TUndirNet::TNodeI::GetId().
Adds Str sparse attribute with id AttrId
to NodeI
.
Definition at line 3749 of file network.h.
References TUndirNet::TNodeI::GetId().
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2604 of file network.cpp.
References TAttr::AddSAttr(), and TNEANet::SAttrE.
Adds mapping for sparse attribute with name Name
and type AttrType
.
Definition at line 2456 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 3660 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::BegNI(), TNodeEdgeNet< TNodeData, TEdgeData >::EndNI(), TUndirNet::TNodeI::GetId(), TNodeEdgeNet< TNodeData, TEdgeData >::GetNodes(), TUndirNet::TNodeI::GetOutDeg(), and TUndirNet::TNodeI::GetOutNId().
|
inline |
Returns an iterator referring to the first node in the network.
Definition at line 3622 of file network.h.
References THash< TKey, TDat, THashFunc >::BegI().
|
inline |
Deletes all nodes and edges from the network.
Definition at line 3681 of file network.h.
References TAttr::Clr(), TAttrPair::Clr(), and THash< TKey, TDat, THashFunc >::Clr().
void TUndirNet::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 2272 of file network.cpp.
References THash< TKey, TDat, THashFunc >::Defrag(), THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), THash< TKey, TDat, THashFunc >::IsKeyIdEqKeyN(), TNEANet::NodeH, and THash< TKey, TDat, THashFunc >::Pack().
void TUndirNet::DelEdge | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Deletes an edge between node IDs SrcNId and 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 2233 of file network.cpp.
References TVec< TVal, TSizeTy >::Del(), TAttr::DelSAttrId(), TStr::Fmt(), TNEANet::GetNode(), IAssertR, TNEANet::IsNode(), TUndirNet::TNode::NIdV, TNEANet::SAttrE, and TVec< TVal, TSizeTy >::SearchBin().
void TUndirNet::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 2186 of file network.cpp.
References AssertR, TVec< TVal, TSizeTy >::Del(), THash< TKey, TDat, THashFunc >::DelKey(), TAttr::DelSAttrId(), TStr::Fmt(), TUndirNet::TNode::GetDeg(), TUndirNet::TNode::GetNbrNId(), TNEANet::GetNode(), IAssert, TNEANet::IsNode(), TUndirNet::TNode::NIdV, TNEANet::NodeH, TNEANet::SAttrN, and TVec< TVal, TSizeTy >::SearchBin().
|
inline |
Deletes node of ID NodeI.GetId() from the network.
Definition at line 3618 of file network.h.
References DelNode(), and TUndirNet::TNode::GetId().
Referenced by DelNode().
int TUndirNet::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 2571 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2579 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
Deletes sparse attribute with name AttrName
from EdgeI
.
Definition at line 3919 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with id AttrId
from EdgeI
.
Definition at line 3923 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Deletes sparse attribute with name AttrName
from node with id NId
.
Definition at line 2426 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 2433 of file network.cpp.
References TAttr::DelSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
Deletes sparse attribute with name AttrName
from NodeI
.
Definition at line 3801 of file network.h.
References TUndirNet::TNodeI::GetId().
Deletes sparse attribute with id AttrId
from NodeI
.
Definition at line 3805 of file network.h.
References TUndirNet::TNodeI::GetId().
void TUndirNet::Dump | ( | FILE * | OutF = stdout | ) | const |
Print the network in a human readable form to an output stream OutF.
Definition at line 2319 of file network.cpp.
References edge, THash< TKey, TDat, THashFunc >::FFirstKeyId(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TUndirNet::TNode::GetDeg(), TNEANet::GetEdges(), TUndirNet::TNode::GetId(), TUndirNet::TNode::GetNbrNId(), TNEANet::GetNodes(), and TNEANet::NodeH.
|
inline |
Tests whether the network is empty (has zero nodes).
Definition at line 3679 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 3662 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 3624 of file network.h.
References THash< TKey, TDat, THashFunc >::EndI().
int TUndirNet::GetEdges | ( | ) | const |
TEdgeI TUndirNet::GetEI | ( | const int & | EId | ) | const |
Not supported/implemented!
TUndirNet::TEdgeI TUndirNet::GetEI | ( | const int & | SrcNId, |
const int & | DstNId | ||
) | const |
Returns an iterator referring to edge (SrcNId, DstNId) in the network.
Note that since this is an undirected graph GetEI(SrcNId, DstNId) has the same effect as GetEI(DstNId, SrcNId).
Definition at line 2254 of file network.cpp.
References TNEANet::EndNI(), TNEANet::GetNI(), IAssert, TMath::Mn(), TMath::Mx(), TNEANet::MxNId, and TUndirNet::TNodeI::NodeHI.
Gets a list of all edges that have a sparse attribute with name AttrName
.
Definition at line 2596 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 2600 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 2448 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 2452 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 3628 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 3626 of file network.h.
References THash< TKey, TDat, THashFunc >::GetI().
void TUndirNet::GetNIdV | ( | TIntV & | NIdV | ) | const |
Gets a vector IDs of all nodes in the network.
Definition at line 2265 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 3515 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat().
|
inlineprivate |
Definition at line 3516 of file network.h.
References THash< TKey, TDat, THashFunc >::GetDat().
|
inline |
Returns the number of nodes in the network.
Definition at line 3576 of file network.h.
References THash< TKey, TDat, THashFunc >::Len().
Returns an interator referring to a random node in the network.
Definition at line 3674 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 3672 of file network.h.
References THash< TKey, TDat, THashFunc >::GetKey(), and THash< TKey, TDat, THashFunc >::GetRndKeyId().
int TUndirNet::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 2523 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2531 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Gets Int sparse attribute with name AttrName
from EdgeI
.
Definition at line 3877 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with id AttrId
from EdgeI
.
Definition at line 3881 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
int TUndirNet::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 2539 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2547 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Gets Flt sparse attribute with name AttrName
from EdgeI
.
Definition at line 3891 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Gets Flt sparse attribute with id AttrId
from EdgeI
.
Definition at line 3895 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
int TUndirNet::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 2555 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
int TUndirNet::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 2563 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsEdge(), and TNEANet::SAttrE.
|
inline |
Gets Str sparse attribute with name AttrName
from EdgeI
.
Definition at line 3905 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Gets Str sparse attribute with id AttrId
from EdgeI
.
Definition at line 3909 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Gets Int sparse attribute with name AttrName
from node with id NId
.
Definition at line 2384 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 2391 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Gets Int sparse attribute with name AttrName
from NodeI
.
Definition at line 3759 of file network.h.
References TUndirNet::TNodeI::GetId().
Gets Int sparse attribute with id AttrId
from NodeI
.
Definition at line 3763 of file network.h.
References TUndirNet::TNodeI::GetId().
Gets Flt sparse attribute with name AttrName
from node with id NId
.
Definition at line 2398 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 2405 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Gets Flt sparse attribute with name AttrName
from NodeI
.
Definition at line 3773 of file network.h.
References TUndirNet::TNodeI::GetId().
Gets Flt sparse attribute with id AttrId
from NodeI
.
Definition at line 3777 of file network.h.
References TUndirNet::TNodeI::GetId().
Gets Str sparse attribute with name AttrName
from node with id NId
.
Definition at line 2412 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 2419 of file network.cpp.
References TAttr::GetSAttrDat(), TNEANet::IsNode(), and TNEANet::SAttrN.
|
inline |
Gets Str sparse attribute with name AttrName
from NodeI
.
Definition at line 3787 of file network.h.
References TUndirNet::TNodeI::GetId().
Gets Str sparse attribute with id AttrId
from NodeI
.
Definition at line 3791 of file network.h.
References TUndirNet::TNodeI::GetId().
Gets id and type for attribute with name Name
.
Definition at line 2608 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrE.
Gets id and type for attribute with name Name
.
Definition at line 2460 of file network.cpp.
References TAttr::GetSAttrId(), and TNEANet::SAttrN.
Gets name and type for attribute with id AttrId
.
Definition at line 2612 of file network.cpp.
References TAttr::GetSAttrName(), and TNEANet::SAttrE.
Gets name and type for attribute with id AttrId
.
Definition at line 2464 of file network.cpp.
References TAttr::GetSAttrName(), and TNEANet::SAttrN.
int TUndirNet::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 2587 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 3929 of file network.h.
References TUndirNet::TEdgeI::GetDstNId(), and TUndirNet::TEdgeI::GetSrcNId().
Gets a list of all sparse attributes of type AttrType
for node with id NId
.
Definition at line 2440 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 3812 of file network.h.
References TUndirNet::TNodeI::GetId().
|
static |
Returns a small network on 5 nodes and 5 edges.
/// Graph: 3--0--4 /// /| /// 1-2 ///
Definition at line 2333 of file network.cpp.
References New().
bool TUndirNet::HasFlag | ( | const TGraphFlag & | Flag | ) | const |
Allows for run-time checking the type of the network (see the TGraphFlag for flags).
Definition at line 2119 of file network.cpp.
References HasGraphFlag.
bool TUndirNet::IsEdge | ( | const int & | SrcNId, |
const int & | DstNId | ||
) | const |
Tests whether an edge between node IDs SrcNId and DstNId exists in the network.
Definition at line 2248 of file network.cpp.
References TNEANet::GetNode(), and TNEANet::IsNode().
|
inline |
Tests whether ID NId is a node.
Definition at line 3620 of file network.h.
References THash< TKey, TDat, THashFunc >::IsKey().
bool TUndirNet::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 2282 of file network.cpp.
References TNEANet::BegEI(), TStr::CStr(), EAssertR, TNEANet::EndEI(), ErrNotify(), THash< TKey, TDat, THashFunc >::FFirstKeyId(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::FNextKeyId(), TUndirNet::TNode::GetDeg(), TNEANet::GetEdges(), TUndirNet::TNode::GetId(), TUndirNet::TNode::GetNbrNId(), TNEANet::IsNode(), TVec< TVal, TSizeTy >::IsSorted(), TUndirNet::TNode::NIdV, and TNEANet::NodeH.
Static constructor that loads the network from a stream SIn and returns a pointer to it.
Definition at line 3553 of file network.h.
Static constructor that loads the network from a stream SIn and returns a pointer to it. Backwards compatible.
Definition at line 3555 of file network.h.
|
inlineprivate |
Definition at line 3525 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 3564 of file network.h.
References LoadNetworkShM().
|
inlinestatic |
Static constructor that returns a pointer to the network. Call: PUndirNet Graph = TUndirNet::New().
Definition at line 3547 of file network.h.
Referenced by GetSmallGraph().
|
inlinestatic |
|
private |
|
inline |
Reserves memory for a network of Nodes nodes and Edges edges.
Definition at line 3683 of file network.h.
References THash< TKey, TDat, THashFunc >::Gen().
|
inline |
Reserves memory for node ID NId having Deg edges.
Definition at line 3685 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 3542 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 3545 of file network.h.
References THash< TKey, TDat, THashFunc >::Save(), and TInt::Save().
|
inline |
Sorts the adjacency lists of each node.
Definition at line 3687 of file network.h.
References TNodeEdgeNet< TNodeData, TEdgeData >::BegNI(), and TNodeEdgeNet< TNodeData, TEdgeData >::EndNI().
|
private |
Definition at line 3509 of file network.h.
Referenced by operator=().
|
private |
Definition at line 3509 of file network.h.
Referenced by operator=().
Definition at line 3510 of file network.h.
Referenced by operator=().