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
TNEANet Class Reference

Directed multigraph with node edge attributes. More...

#include <network.h>

Inheritance diagram for TNEANet:
Collaboration diagram for TNEANet:

Classes

class  LoadHashOfVecFunctor
 
class  LoadTNodeFunctor
 
class  LoadVecFunctor
 
class  LoadVecOfVecFunctor
 
class  TAFltI
 Node/edge float attribute iterator. Iterates through all nodes/edges for one float attribute. More...
 
class  TAFltVI
 
class  TAIntI
 Node/edge integer attribute iterator. Iterates through all nodes/edges for one integer attribute. More...
 
class  TAIntVI
 
class  TAStrI
 Node/edge string attribute iterator. Iterates through all nodes/edges for one string attribute. More...
 
class  TEdge
 
class  TEdgeI
 Edge iterator. Only forward iteration (operator++) is supported. More...
 
class  TNode
 
class  TNodeI
 Node iterator. Only forward iteration (operator++) is supported. More...
 

Public Types

typedef TNEANet TNet
 
typedef TPt< TNEANetPNet
 

Public Member Functions

 TNEANet ()
 
 TNEANet (const int &Nodes, const int &Edges)
 Constructor that reserves enough memory for a graph of nodes and edges. More...
 
 TNEANet (const TNEANet &Graph)
 
 TNEANet (TSIn &SIn)
 Constructor for loading the graph from a (binary) stream SIn. More...
 
void Save (TSOut &SOut) const
 Saves the graph to a (binary) stream SOut. Expects data structures for sparse attributes. More...
 
void Save_V1 (TSOut &SOut) const
 Saves the graph to a (binary) stream SOut. Available for backwards compatibility. More...
 
void Save_V2 (TSOut &SOut) const
 Saves the graph without any sparse data structures. Available for backwards compatibility. More...
 
void LoadNetworkShM (TShMIn &ShMIn)
 load network from shared memory for this network More...
 
void ConvertToSparse ()
 
bool HasFlag (const TGraphFlag &Flag) const
 Allows for run-time checking the type of the graph (see the TGraphFlag for flags). More...
 
TNEANetoperator= (const TNEANet &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 graph. More...
 
virtual void DelNode (const int &NId)
 Deletes node of ID NId from the graph. More...
 
void DelNode (const TNode &NodeI)
 Deletes node of ID NodeI.GetId() from the graph. More...
 
bool IsNode (const int &NId) const
 Tests whether ID NId is a node. More...
 
TNodeI BegNI () const
 Returns an iterator referring to the first node in the graph. More...
 
TNodeI EndNI () const
 Returns an iterator referring to the past-the-end node in the graph. More...
 
TNodeI GetNI (const int &NId) const
 Returns an iterator referring to the node of ID NId in the graph. More...
 
TAIntI BegNAIntI (const TStr &attr) const
 Returns an iterator referring to the first node's int attribute. More...
 
TAIntI EndNAIntI (const TStr &attr) const
 Returns an iterator referring to the past-the-end node's attribute. More...
 
TAIntI GetNAIntI (const TStr &attr, const int &NId) const
 Returns an iterator referring to the node of ID NId in the graph. More...
 
TAIntVI BegNAIntVI (const TStr &attr) const
 Returns an iterator referring to the first node's int attribute. More...
 
TAIntVI EndNAIntVI (const TStr &attr) const
 Returns an iterator referring to the past-the-end node's attribute. More...
 
TAIntVI GetNAIntVI (const TStr &attr, const int &NId) const
 Returns an iterator referring to the node of ID NId in the graph. More...
 
TAFltVI BegNAFltVI (const TStr &attr) const
 Returns an iterator referring to the first node's flt attribute. More...
 
TAFltVI EndNAFltVI (const TStr &attr) const
 Returns an iterator referring to the past-the-end node's attribute. More...
 
TAFltVI GetNAFltVI (const TStr &attr, const int &NId) const
 Returns an iterator referring to the node of ID NId in the graph. More...
 
TAStrI BegNAStrI (const TStr &attr) const
 Returns an iterator referring to the first node's str attribute. More...
 
TAStrI EndNAStrI (const TStr &attr) const
 Returns an iterator referring to the past-the-end node's attribute. More...
 
TAStrI GetNAStrI (const TStr &attr, const int &NId) const
 Returns an iterator referring to the node of ID NId in the graph. More...
 
TAFltI BegNAFltI (const TStr &attr) const
 Returns an iterator referring to the first node's flt attribute. More...
 
TAFltI EndNAFltI (const TStr &attr) const
 Returns an iterator referring to the past-the-end node's attribute. More...
 
TAFltI GetNAFltI (const TStr &attr, const int &NId) const
 Returns an iterator referring to the node of ID NId in the graph. More...
 
void AttrNameNI (const TInt &NId, TStrV &Names) const
 Returns a vector of attr names for node NId. More...
 
void AttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const
 
void AttrValueNI (const TInt &NId, TStrV &Values) const
 Returns a vector of attr values for node NId. More...
 
void AttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Values) const
 
void IntAttrNameNI (const TInt &NId, TStrV &Names) const
 Returns a vector of int attr names for node NId. More...
 
void IntAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const
 
void IntAttrValueNI (const TInt &NId, TIntV &Values) const
 Returns a vector of attr values for node NId. More...
 
void IntAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TIntV &Values) const
 
void IntVAttrNameNI (const TInt &NId, TStrV &Names) const
 Returns a vector of int attr names for node NId. More...
 
void IntVAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const
 
void IntVAttrValueNI (const TInt &NId, TVec< TIntV > &Values) const
 Returns a vector of attr values for node NId. More...
 
void IntVAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TVec< TIntV > &Values) const
 
void FltVAttrNameNI (const TInt &NId, TStrV &Names) const
 Returns a vector of flt attr names for node NId. More...
 
void FltVAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const
 
void FltVAttrValueNI (const TInt &NId, TVec< TFltV > &Values) const
 Returns a vector of flt values for node NId. More...
 
void FltVAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TVec< TFltV > &Values) const
 
void StrAttrNameNI (const TInt &NId, TStrV &Names) const
 Returns a vector of str attr names for node NId. More...
 
void StrAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const
 
void StrAttrValueNI (const TInt &NId, TStrV &Values) const
 Returns a vector of attr values for node NId. More...
 
void StrAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Values) const
 
void FltAttrNameNI (const TInt &NId, TStrV &Names) const
 Returns a vector of int attr names for node NId. More...
 
void FltAttrNameNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TStrV &Names) const
 
void FltAttrValueNI (const TInt &NId, TFltV &Values) const
 Returns a vector of attr values for node NId. More...
 
void FltAttrValueNI (const TInt &NId, TStrIntPrH::TIter NodeHI, TFltV &Values) const
 
void AttrNameEI (const TInt &EId, TStrV &Names) const
 Returns a vector of attr names for edge EId. More...
 
void AttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const
 
void AttrValueEI (const TInt &EId, TStrV &Values) const
 Returns a vector of attr values for edge EId. More...
 
void AttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Values) const
 
void IntAttrNameEI (const TInt &EId, TStrV &Names) const
 Returns a vector of int attr names for edge EId. More...
 
void IntAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const
 
void IntAttrValueEI (const TInt &EId, TIntV &Values) const
 Returns a vector of attr values for edge EId. More...
 
void IntAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TIntV &Values) const
 
void IntVAttrNameEI (const TInt &EId, TStrV &Names) const
 Returns a vector of int attr names for edge EId. More...
 
void IntVAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const
 
void IntVAttrValueEI (const TInt &EId, TVec< TIntV > &Values) const
 Returns a vector of attr values for edge EId. More...
 
void IntVAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TVec< TIntV > &Values) const
 
void FltVAttrNameEI (const TInt &EId, TStrV &Names) const
 Returns a vector of flt attr names for edge EId. More...
 
void FltVAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const
 
void FltVAttrValueEI (const TInt &EId, TVec< TFltV > &Values) const
 Returns a vector of attr values for edge EId. More...
 
void FltVAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TVec< TFltV > &Values) const
 
void StrAttrNameEI (const TInt &EId, TStrV &Names) const
 Returns a vector of str attr names for node NId. More...
 
void StrAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const
 
void StrAttrValueEI (const TInt &EId, TStrV &Values) const
 Returns a vector of attr values for node NId. More...
 
void StrAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Values) const
 
void FltAttrNameEI (const TInt &EId, TStrV &Names) const
 Returns a vector of int attr names for node NId. More...
 
void FltAttrNameEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TStrV &Names) const
 
void FltAttrValueEI (const TInt &EId, TFltV &Values) const
 Returns a vector of attr values for node NId. More...
 
void FltAttrValueEI (const TInt &EId, TStrIntPrH::TIter EdgeHI, TFltV &Values) const
 
TAIntI BegEAIntI (const TStr &attr) const
 Returns an iterator referring to the first edge's int attribute. More...
 
TAIntI EndEAIntI (const TStr &attr) const
 Returns an iterator referring to the past-the-end edge's attribute. More...
 
TAIntI GetEAIntI (const TStr &attr, const int &EId) const
 Returns an iterator referring to the edge of ID EId in the graph. More...
 
TAIntVI BegEAIntVI (const TStr &attr) const
 Returns an iterator referring to the first edge's int attribute. More...
 
TAIntVI EndEAIntVI (const TStr &attr) const
 Returns an iterator referring to the past-the-end edge's attribute. More...
 
TAIntVI GetEAIntVI (const TStr &attr, const int &EId) const
 Returns an iterator referring to the edge of ID EId in the graph. More...
 
TAFltVI BegEAFltVI (const TStr &attr) const
 Returns an iterator referring to the first edge's int attribute. More...
 
TAFltVI EndEAFltVI (const TStr &attr) const
 Returns an iterator referring to the past-the-end edge's attribute. More...
 
TAFltVI GetEAFltVI (const TStr &attr, const int &EId) const
 Returns an iterator referring to the edge of ID EId in the graph. More...
 
TAStrI BegEAStrI (const TStr &attr) const
 Returns an iterator referring to the first edge's str attribute. More...
 
TAStrI EndEAStrI (const TStr &attr) const
 Returns an iterator referring to the past-the-end edge's attribute. More...
 
TAStrI GetEAStrI (const TStr &attr, const int &EId) const
 Returns an iterator referring to the edge of ID EId in the graph. More...
 
TAFltI BegEAFltI (const TStr &attr) const
 Returns an iterator referring to the first edge's flt attribute. More...
 
TAFltI EndEAFltI (const TStr &attr) const
 Returns an iterator referring to the past-the-end edge's attribute. More...
 
TAFltI GetEAFltI (const TStr &attr, const int &EId) const
 Returns an iterator referring to the edge of ID EId in the graph. More...
 
int GetMxNId () const
 Returns an ID that is larger than any node ID in the network. More...
 
int GetMxEId () const
 Returns an ID that is larger than any edge ID in the network. More...
 
int GetEdges () const
 Returns the number of edges in the graph. More...
 
int AddEdge (const int &SrcNId, const int &DstNId, int EId=-1)
 Adds an edge with ID EId between node IDs SrcNId and DstNId to the graph. More...
 
int AddEdge (const TEdgeI &EdgeI)
 Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the graph. More...
 
void DelEdge (const int &EId)
 Deletes an edge with edge ID EId from the graph. More...
 
void DelEdge (const int &SrcNId, const int &DstNId, const bool &IsDir=true)
 Deletes all edges between node IDs SrcNId and DstNId from the graph. More...
 
bool IsEdge (const int &EId) const
 Tests whether an edge with edge ID EId exists in the graph. More...
 
bool IsEdge (const int &SrcNId, const int &DstNId, const bool &IsDir=true) const
 Tests whether an edge between node IDs SrcNId and DstNId exists in the graph. More...
 
bool IsEdge (const int &SrcNId, const int &DstNId, int &EId, const bool &IsDir=true) const
 Tests whether an edge between node IDs SrcNId and DstNId exists in the graph. if an edge exists, return its edge ID in EId. More...
 
int GetEId (const int &SrcNId, const int &DstNId) const
 Returns an edge ID between node IDs SrcNId and DstNId, if such an edge exists. Otherwise, return -1. More...
 
TEdgeI BegEI () const
 Returns an iterator referring to the first edge in the graph. More...
 
TEdgeI EndEI () const
 Returns an iterator referring to the past-the-end edge in the graph. More...
 
TEdgeI GetEI (const int &EId) const
 Returns an iterator referring to edge with edge ID EId. More...
 
TEdgeI GetEI (const int &SrcNId, const int &DstNId) const
 Returns an iterator referring to edge (SrcNId, DstNId) in the graph. More...
 
int GetRndNId (TRnd &Rnd=TInt::Rnd)
 Returns an ID of a random node in the graph. More...
 
TNodeI GetRndNI (TRnd &Rnd=TInt::Rnd)
 Returns an interator referring to a random node in the graph. More...
 
int GetRndEId (TRnd &Rnd=TInt::Rnd)
 Returns an ID of a random edge in the graph. More...
 
TEdgeI GetRndEI (TRnd &Rnd=TInt::Rnd)
 Returns an interator referring to a random edge in the graph. More...
 
void GetNIdV (TIntV &NIdV) const
 Gets a vector IDs of all nodes in the graph. More...
 
void GetEIdV (TIntV &EIdV) const
 Gets a vector IDs of all edges in the graph. More...
 
bool Empty () const
 Tests whether the graph is empty (has zero nodes). More...
 
void Clr ()
 Deletes all nodes and edges from the graph. More...
 
void Reserve (const int &Nodes, const int &Edges)
 Reserves memory for a graph of Nodes nodes and Edges edges. More...
 
void Defrag (const bool &OnlyNodeLinks=false)
 Defragments the graph. More...
 
bool IsOk (const bool &ThrowExcept=true) const
 Checks the graph data structure for internal consistency. More...
 
void Dump (FILE *OutF=stdout) const
 Print the graph in a human readable form to an output stream OutF. More...
 
int AddIntAttrDatN (const TNodeI &NodeI, const TInt &value, const TStr &attr)
 Attribute based add function for attr to Int value. More...
 
int AddIntAttrDatN (const int &NId, const TInt &value, const TStr &attr)
 
int AddStrAttrDatN (const TNodeI &NodeI, const TStr &value, const TStr &attr)
 Attribute based add function for attr to Str value. More...
 
int AddStrAttrDatN (const int &NId, const TStr &value, const TStr &attr)
 
int AddFltAttrDatN (const TNodeI &NodeI, const TFlt &value, const TStr &attr)
 Attribute based add function for attr to Flt value. More...
 
int AddFltAttrDatN (const int &NId, const TFlt &value, const TStr &attr)
 
int AddIntVAttrDatN (const TNodeI &NodeI, const TIntV &value, const TStr &attr)
 Attribute based add function for attr to IntV value. More...
 
int AddIntVAttrDatN (const int &NId, const TIntV &value, const TStr &attr, TBool UseDense=true)
 
int AddFltVAttrDatN (const TNodeI &NodeI, const TFltV &value, const TStr &attr)
 Attribute based add function for attr to FltV value. More...
 
int AddFltVAttrDatN (const int &NId, const TFltV &value, const TStr &attr, TBool UseDense=true)
 
int AppendIntVAttrDatN (const TNodeI &NodeI, const TInt &value, const TStr &attr)
 Appends value onto the TIntV attribute for the given node. More...
 
int AppendIntVAttrDatN (const int &NId, const TInt &value, const TStr &attr, TBool UseDense=true)
 
int DelFromIntVAttrDatN (const TNodeI &NodeI, const TInt &value, const TStr &attr)
 Deletes value from the TIntV attribute for the given node. More...
 
int DelFromIntVAttrDatN (const int &NId, const TInt &value, const TStr &attr)
 
int AppendFltVAttrDatN (const TNodeI &NodeI, const TFlt &value, const TStr &attr)
 Appends value onto the TFltV attribute for the given node. More...
 
int AppendFltVAttrDatN (const int &NId, const TFlt &value, const TStr &attr, TBool UseDense=true)
 
int DelFromFltVAttrDatN (const TNodeI &NodeI, const TFlt &value, const TStr &attr)
 Deletes value from the TFltV attribute for the given node. More...
 
int DelFromFltVAttrDatN (const int &NId, const TFlt &value, const TStr &attr)
 
int AddIntAttrDatE (const TEdgeI &EdgeI, const TInt &value, const TStr &attr)
 Attribute based add function for attr to Int value. More...
 
int AddIntAttrDatE (const int &EId, const TInt &value, const TStr &attr)
 
int AddStrAttrDatE (const TEdgeI &EdgeI, const TStr &value, const TStr &attr)
 Attribute based add function for attr to Str value. More...
 
int AddStrAttrDatE (const int &EId, const TStr &value, const TStr &attr)
 
int AddFltAttrDatE (const TEdgeI &EdgeI, const TFlt &value, const TStr &attr)
 Attribute based add function for attr to Flt value. More...
 
int AddFltAttrDatE (const int &EId, const TFlt &value, const TStr &attr)
 
int AddIntVAttrDatE (const TEdgeI &EdgeI, const TIntV &value, const TStr &attr)
 Attribute based add function for attr to IntV value. More...
 
int AddIntVAttrDatE (const int &EId, const TIntV &value, const TStr &attr, TBool UseDense=true)
 
int AppendIntVAttrDatE (const TEdgeI &EdgeI, const TInt &value, const TStr &attr)
 Appends value onto the TIntV attribute for the given node. More...
 
int AppendIntVAttrDatE (const int &EId, const TInt &value, const TStr &attr, TBool UseDense=true)
 
int AddFltVAttrDatE (const TEdgeI &EdgeI, const TFltV &value, const TStr &attr)
 Attribute based add function for attr to TFltV value. More...
 
int AddFltVAttrDatE (const int &EId, const TFltV &value, const TStr &attr, TBool UseDense=true)
 
int AppendFltVAttrDatE (const TEdgeI &EdgeI, const TFlt &value, const TStr &attr)
 Appends value onto the TFltV attribute for the given node. More...
 
int AppendFltVAttrDatE (const int &EId, const TFlt &value, const TStr &attr, TBool UseDense=true)
 
TInt GetIntAttrDatN (const TNodeI &NodeI, const TStr &attr)
 Gets the value of int attr from the node attr value vector. More...
 
TInt GetIntAttrDatN (const int &NId, const TStr &attr)
 
TStr GetStrAttrDatN (const TNodeI &NodeI, const TStr &attr)
 Gets the value of str attr from the node attr value vector. More...
 
TStr GetStrAttrDatN (const int &NId, const TStr &attr)
 
TFlt GetFltAttrDatN (const TNodeI &NodeI, const TStr &attr)
 Gets the value of flt attr from the node attr value vector. More...
 
TFlt GetFltAttrDatN (const int &NId, const TStr &attr)
 
TIntV GetIntVAttrDatN (const TNodeI &NodeI, const TStr &attr) const
 Gets the value of the intv attr from the node attr value vector. More...
 
TIntV GetIntVAttrDatN (const int &NId, const TStr &attr) const
 
TFltV GetFltVAttrDatN (const TNodeI &NodeI, const TStr &attr) const
 Gets the value of the fltv attr from the node attr value vector. More...
 
TFltV GetFltVAttrDatN (const int &NId, const TStr &attr) const
 
int GetIntAttrIndN (const TStr &attr)
 Gets the index of the node attr value vector specified by attr (same as GetAttrIndN for compatibility reasons). More...
 
int GetAttrIndN (const TStr &attr)
 Gets the index of the node attr value vector specified by attr. More...
 
TInt GetIntAttrIndDatN (const TNodeI &NodeI, const int &index)
 Gets the value of an int node attr specified by node iterator NodeI and the attr index. More...
 
TInt GetIntAttrIndDatN (const int &NId, const int &index)
 Gets the value of an int node attr specified by node ID NId and the attr index. More...
 
TStr GetStrAttrIndDatN (const TNodeI &NodeI, const int &index)
 Gets the value of a string node attr specified by node iterator NodeI and the attr index. More...
 
TStr GetStrAttrIndDatN (const int &NId, const int &index)
 Gets the value of a string node attr specified by node ID NId and the attr index. More...
 
TFlt GetFltAttrIndDatN (const TNodeI &NodeI, const int &index)
 Gets the value of a float node attr specified by node iterator NodeI and the attr index. More...
 
TFlt GetFltAttrIndDatN (const int &NId, const int &index)
 Gets the value of a float node attr specified by node ID NId and the attr index. More...
 
TInt GetIntAttrDatE (const TEdgeI &EdgeI, const TStr &attr)
 Gets the value of int attr from the edge attr value vector. More...
 
TInt GetIntAttrDatE (const int &EId, const TStr &attr)
 
TStr GetStrAttrDatE (const TEdgeI &EdgeI, const TStr &attr)
 Gets the value of str attr from the edge attr value vector. More...
 
TStr GetStrAttrDatE (const int &EId, const TStr &attr)
 
TFlt GetFltAttrDatE (const TEdgeI &EdgeI, const TStr &attr)
 Gets the value of flt attr from the edge attr value vector. More...
 
TFlt GetFltAttrDatE (const int &EId, const TStr &attr)
 
TIntV GetIntVAttrDatE (const TEdgeI &EdgeI, const TStr &attr)
 Gets the value of the intv attr from the edge attr value vector. More...
 
TIntV GetIntVAttrDatE (const int &EId, const TStr &attr)
 
TFltV GetFltVAttrDatE (const TEdgeI &EdgeI, const TStr &attr)
 Gets the value of the fltv attr from the edge attr value vector. More...
 
TFltV GetFltVAttrDatE (const int &EId, const TStr &attr)
 
int GetIntAttrIndE (const TStr &attr)
 Gets the index of the edge attr value vector specified by attr (same as GetAttrIndE for compatibility reasons). More...
 
int GetAttrIndE (const TStr &attr)
 Gets the index of the edge attr value vector specified by attr. More...
 
TInt GetIntAttrIndDatE (const TEdgeI &EdgeI, const int &index)
 Gets the value of an int edge attr specified by edge iterator EdgeI and the attr index. More...
 
TInt GetIntAttrIndDatE (const int &EId, const int &index)
 Gets the value of an int edge attr specified by edge ID EId and the attr index. More...
 
TFlt GetFltAttrIndDatE (const TEdgeI &EdgeI, const int &index)
 Gets the value of a float edge attr specified by edge iterator EdgeI and the attr index. More...
 
TFlt GetFltAttrIndDatE (const int &EId, const int &index)
 Gets the value of an int edge attr specified by edge ID EId and the attr index. More...
 
TStr GetStrAttrIndDatE (const TEdgeI &EdgeI, const int &index)
 Gets the value of a string edge attr specified by edge iterator EdgeI and the attr index. More...
 
TStr GetStrAttrIndDatE (const int &EId, const int &index)
 Gets the value of an int edge attr specified by edge ID EId and the attr index. More...
 
int DelAttrDatN (const TNodeI &NodeI, const TStr &attr)
 Deletes the node attribute for NodeI. More...
 
int DelAttrDatN (const int &NId, const TStr &attr)
 
int DelAttrDatE (const TEdgeI &EdgeI, const TStr &attr)
 Deletes the edge attribute for NodeI. More...
 
int DelAttrDatE (const int &EId, const TStr &attr)
 
int AddIntAttrN (const TStr &attr, TInt defaultValue=TInt::Mn)
 Adds a new Int node attribute to the hashmap. More...
 
int AddStrAttrN (const TStr &attr, TStr defaultValue=TStr::GetNullStr())
 Adds a new Str node attribute to the hashmap. More...
 
int AddFltAttrN (const TStr &attr, TFlt defaultValue=TFlt::Mn)
 Adds a new Flt node attribute to the hashmap. More...
 
int AddIntVAttrN (const TStr &attr, TBool UseDense=true)
 Adds a new IntV node attribute to the hashmap. More...
 
int AddFltVAttrN (const TStr &attr, TBool UseDense=true)
 Adds a new FltV node attribute to the hashmap. More...
 
int AddIntAttrE (const TStr &attr, TInt defaultValue=TInt::Mn)
 Adds a new Int edge attribute to the hashmap. More...
 
int AddStrAttrE (const TStr &attr, TStr defaultValue=TStr::GetNullStr())
 Adds a new Str edge attribute to the hashmap. More...
 
int AddFltAttrE (const TStr &attr, TFlt defaultValue=TFlt::Mn)
 Adds a new Flt edge attribute to the hashmap. More...
 
int AddIntVAttrE (const TStr &attr, TBool UseDense=true)
 Adds a new IntV edge attribute to the hashmap. More...
 
int AddFltVAttrE (const TStr &attr, TBool UseDense=true)
 Adds a new FltV edge attribute to the hashmap. More...
 
int DelAttrN (const TStr &attr)
 Removes all the values for node attr. More...
 
int DelAttrE (const TStr &attr)
 Removes all the values for edge attr. More...
 
bool IsAttrDeletedN (const int &NId, const TStr &attr) const
 Returns true if attr exists for node NId and has default value. More...
 
bool IsIntAttrDeletedN (const int &NId, const TStr &attr) const
 Returns true if Int attr exists for node NId and has default value. More...
 
bool IsIntVAttrDeletedN (const int &NId, const TStr &attr) const
 Returns true if IntV attr exists for node NId and is an empty vector. More...
 
bool IsFltVAttrDeletedN (const int &NId, const TStr &attr) const
 Returns true if FltV attr exists for node NId and is an empty vector. More...
 
bool IsStrAttrDeletedN (const int &NId, const TStr &attr) const
 Returns true if Str attr exists for node NId and has default value. More...
 
bool IsFltAttrDeletedN (const int &NId, const TStr &attr) const
 Returns true if Flt attr exists for node NId and has default value. More...
 
bool NodeAttrIsDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns true if NId attr deleted for current node attr iterator. More...
 
bool NodeAttrIsIntDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns true if NId attr deleted value for current node int attr iterator. More...
 
bool NodeAttrIsIntVDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns true if NId attr deleted value for current node int vector attr iterator. More...
 
bool NodeAttrIsFltVDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns true if NId attr deleted value for current node int vector attr iterator. More...
 
bool NodeAttrIsStrDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns true if NId attr deleted value for current node str attr iterator. More...
 
bool NodeAttrIsFltDeleted (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns true if NId attr deleted value for current node flt attr iterator. More...
 
bool IsAttrDeletedE (const int &EId, const TStr &attr) const
 Returns true if attr exists for edge EId and has default value. More...
 
bool IsIntAttrDeletedE (const int &EId, const TStr &attr) const
 Returns true if Int attr exists for edge EId and has default value. More...
 
bool IsIntVAttrDeletedE (const int &EId, const TStr &attr) const
 Returns true if IntV attr exists for edge EId and is an empty vector. More...
 
bool IsFltVAttrDeletedE (const int &EId, const TStr &attr) const
 Returns true if FltV attr exists for edge EId and is an empty vector. More...
 
bool IsStrAttrDeletedE (const int &EId, const TStr &attr) const
 Returns true if Str attr exists for edge NId and has default value. More...
 
bool IsFltAttrDeletedE (const int &EId, const TStr &attr) const
 Returns true if Flt attr exists for edge NId and has default value. More...
 
bool EdgeAttrIsDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns true if EId attr deleted for current edge attr iterator. More...
 
bool EdgeAttrIsIntDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns true if EId attr deleted for current edge int attr iterator. More...
 
bool EdgeAttrIsIntVDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns true if EId attr deleted for current edge int vector attr iterator. More...
 
bool EdgeAttrIsFltVDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns true if EId attr deleted for current edge flt vector attr iterator. More...
 
bool EdgeAttrIsStrDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns true if EId attr deleted for current edge str attr iterator. More...
 
bool EdgeAttrIsFltDeleted (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns true if EId attr deleted for current edge flt attr iterator. More...
 
TStr GetNodeAttrValue (const int &NId, const TStrIntPrH::TIter &NodeHI) const
 Returns node attribute value, converted to Str type. More...
 
TStr GetEdgeAttrValue (const int &EId, const TStrIntPrH::TIter &EdgeHI) const
 Returns edge attribute value, converted to Str type. More...
 
TFlt GetWeightOutEdges (const TNodeI &NI, const TStr &attr)
 Gets the sum of the weights of all the outgoing edges of the node. More...
 
bool IsFltAttrE (const TStr &attr)
 Checks if there is an edge attribute with name attr. More...
 
bool IsIntAttrE (const TStr &attr)
 Checks if there is an edge attribute with name attr. More...
 
bool IsStrAttrE (const TStr &attr)
 Checks if there is an edge attribute with name attr. More...
 
TVec< TFlt > & GetFltAttrVecE (const TStr &attr)
 Gets Vector for the Flt Attribute attr. More...
 
int GetFltKeyIdE (const int &EId)
 Gets keyid for edge with id EId. More...
 
void GetWeightOutEdgesV (TFltV &OutWeights, const TFltV &AttrVal)
 Fills OutWeights with the outgoing weight from each node. More...
 
void GetAttrNNames (TStrV &IntAttrNames, TStrV &FltAttrNames, TStrV &StrAttrNames) const
 Fills each of the vectors with the names of node attributes of the given type. More...
 
void GetAttrENames (TStrV &IntAttrNames, TStrV &FltAttrNames, TStrV &StrAttrNames) const
 Fills each of the vectors with the names of edge attributes of the given type. More...
 
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 TInt &EId, const TStr &AttrName, const TInt &Val)
 Adds Int sparse attribute with name AttrName to the given edge with id EId. More...
 
int AddSAttrDatE (const TInt &EId, const TInt &AttrId, const TInt &Val)
 Adds Int sparse attribute with id AttrId to the given edge with id EId. 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 TInt &EId, const TStr &AttrName, const TFlt &Val)
 Adds Flt sparse attribute with name AttrName to the given edge with id EId. More...
 
int AddSAttrDatE (const TInt &EId, const TInt &AttrId, const TFlt &Val)
 Adds Flt sparse attribute with id AttrId to the given edge with id EId. 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 TInt &EId, const TStr &AttrName, const TStr &Val)
 Adds Str sparse attribute with name AttrName to the given edge with id EId. More...
 
int AddSAttrDatE (const TInt &EId, const TInt &AttrId, const TStr &Val)
 Adds Str sparse attribute with id AttrId to the given edge with id EId. 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 TInt &EId, const TStr &AttrName, TInt &ValX) const
 Gets Int sparse attribute with name AttrName from edge with id EId. More...
 
int GetSAttrDatE (const TInt &EId, const TInt &AttrId, TInt &ValX) const
 Gets Int sparse attribute with id AttrId from edge with id EId. 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 TInt &EId, const TStr &AttrName, TFlt &ValX) const
 Gets Flt sparse attribute with name AttrName from edge with id EId. More...
 
int GetSAttrDatE (const TInt &EId, const TInt &AttrId, TFlt &ValX) const
 Gets Flt sparse attribute with id AttrId from edge with id EId. 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 TInt &EId, const TStr &AttrName, TStr &ValX) const
 Gets Str sparse attribute with name AttrName from edge with id EId. More...
 
int GetSAttrDatE (const TInt &EId, const TInt &AttrId, TStr &ValX) const
 Gets Str sparse attribute with id AttrId from edge with id EId. 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 TInt &EId, const TStr &AttrName)
 Deletes sparse attribute with name AttrName from edge with id EId. More...
 
int DelSAttrDatE (const TInt &EId, const TInt &AttrId)
 Deletes sparse attribute with id AttrId from edge with id EId. 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 TInt &EId, const TAttrType AttrType, TAttrPrV &AttrV) const
 Gets a list of all sparse attributes of type AttrType for edge with id EId. 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, TIntV &IdV) const
 Gets a list of all edges that have a sparse attribute with name AttrName. More...
 
int GetIdVSAttrE (const TInt &AttrId, TIntV &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 PNEANet New ()
 Static cons returns pointer to graph. Ex: PNEANet Graph=TNEANet::New(). More...
 
static PNEANet New (const int &Nodes, const int &Edges)
 Static constructor that returns a pointer to the graph and reserves enough memory for Nodes nodes and Edges edges. More...
 
static PNEANet Load (TSIn &SIn)
 Static constructor that loads the graph from a stream SIn and returns a pointer to it. More...
 
static PNEANet Load_V1 (TSIn &SIn)
 Static constructor that loads the graph from a stream SIn and returns a pointer to it. Backwards compatible. More...
 
static PNEANet Load_V2 (TSIn &SIn)
 Static constructor that loads the graph from a stream SIn and returns a pointer to it. Backwards compatible without Sparse. More...
 
static PNEANet LoadShM (TShMIn &ShMIn)
 Static constructor that loads the network from memory. More...
 
static PNEANet GetSmallGraph ()
 Returns a small multigraph on 5 nodes and 6 edges. More...
 

Public Attributes

TCRef CRef
 

Protected Types

enum  {
  IntType, StrType, FltType, IntVType,
  FltVType
}
 

Protected Member Functions

TNodeGetNode (const int &NId)
 
const TNodeGetNode (const int &NId) const
 
TEdgeGetEdge (const int &EId)
 
const TEdgeGetEdge (const int &EId) const
 
int AddAttributes (const int NId)
 
TInt GetIntAttrDefaultN (const TStr &attribute) const
 Gets Int node attribute val. If not a proper attr, return default. More...
 
TStr GetStrAttrDefaultN (const TStr &attribute) const
 Gets Str node attribute val. If not a proper attr, return default. More...
 
TFlt GetFltAttrDefaultN (const TStr &attribute) const
 Gets Flt node attribute val. If not a proper attr, return default. More...
 
TInt GetIntAttrDefaultE (const TStr &attribute) const
 Gets Int edge attribute val. If not a proper attr, return default. More...
 
TStr GetStrAttrDefaultE (const TStr &attribute) const
 Gets Str edge attribute val. If not a proper attr, return default. More...
 
TFlt GetFltAttrDefaultE (const TStr &attribute) const
 Gets Flt edge attribute val. If not a proper attr, return default. More...
 
TInt CheckDenseOrSparseN (const TStr &attr) const
 Return 1 if in Dense, 0 if in Sparse, -1 if neither. More...
 
TInt CheckDenseOrSparseE (const TStr &attr) const
 
 TNEANet (const TNEANet &Graph, bool modeSubGraph)
 
 TNEANet (bool copyAll, const TNEANet &Graph)
 

Protected Attributes

TInt MxNId
 
TInt MxEId
 
THash< TInt, TNodeNodeH
 
THash< TInt, TEdgeEdgeH
 
TStrIntPrH KeyToIndexTypeN
 KeyToIndexType[N|E]: Key->(Type,Index). More...
 
TStrIntPrH KeyToIndexTypeE
 
THash< TStr, TBoolKeyToDenseN
 KeyToDense[N|E]: Key->(True if Vec, False if Hash) More...
 
THash< TStr, TBoolKeyToDenseE
 
THash< TStr, TIntIntDefaultsN
 
THash< TStr, TIntIntDefaultsE
 
THash< TStr, TStrStrDefaultsN
 
THash< TStr, TStrStrDefaultsE
 
THash< TStr, TFltFltDefaultsN
 
THash< TStr, TFltFltDefaultsE
 
TVec< TIntVVecOfIntVecsN
 
TVec< TIntVVecOfIntVecsE
 
TVec< TStrVVecOfStrVecsN
 
TVec< TStrVVecOfStrVecsE
 
TVec< TFltVVecOfFltVecsN
 
TVec< TFltVVecOfFltVecsE
 
TVec< TVec< TIntV > > VecOfIntVecVecsN
 
TVec< TVec< TIntV > > VecOfIntVecVecsE
 
TVec< TVec< TFltV > > VecOfFltVecVecsN
 
TVec< TVec< TFltV > > VecOfFltVecVecsE
 
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
 
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
 
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
 
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
 
TAttr SAttrN
 
TAttr SAttrE
 

Friends

class TPt< TNEANet >
 

Detailed Description

Directed multigraph with node edge attributes.

Node IDs can be arbitrary non-negative integers. Edges have IDs. There can be more than one directed edge from one source node to a destination node. Self loops (one per node) are allowed as well as multiple (parallel) edges. Nodes and edges can have attributes/data associated with them. The attributes can be added dynamically at runtime. The directed multigraph data structure is implemented using sorted adjacency lists. This means adding a node takes constant time, while adding an edge takes linear time (since adjacency list is kept sorted) in the node degree. Accessing arbitrary node takes constant time and accessing any edge takes logarithmic time in the node degree. The attributes are organized in a columnar store, where each attribute column is defined for all the nodes or edges in the network.

Definition at line 1741 of file network.h.

Member Typedef Documentation

Definition at line 1744 of file network.h.

Definition at line 1743 of file network.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
IntType 
StrType 
FltType 
IntVType 
FltVType 

Definition at line 2070 of file network.h.

Constructor & Destructor Documentation

TNEANet::TNEANet ( )
inline

Definition at line 2124 of file network.h.

2124  : CRef(), MxNId(0), MxEId(0), NodeH(), EdgeH(),
2132  SAttrN(), SAttrE(){ }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TAttr SAttrN
Definition: network.h:2072
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TAttr SAttrE
Definition: network.h:2073
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
TCRef CRef
Definition: network.h:2050
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058
TNEANet::TNEANet ( const int &  Nodes,
const int &  Edges 
)
inlineexplicit

Constructor that reserves enough memory for a graph of nodes and edges.

Definition at line 2134 of file network.h.

References TNodeEdgeNet< TNodeData, TEdgeData >::Reserve().

2134  : CRef(),
2142  SAttrN(), SAttrE()
2143  { Reserve(Nodes, Edges); }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TAttr SAttrN
Definition: network.h:2072
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TAttr SAttrE
Definition: network.h:2073
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
void Reserve(const int &Nodes, const int &Edges)
Reserves memory for a graph of Nodes nodes and Edges edges.
Definition: network.h:2844
TCRef CRef
Definition: network.h:2050
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058

Here is the call graph for this function:

TNEANet::TNEANet ( const TNEANet Graph)
inline

Definition at line 2144 of file network.h.

2144  : MxNId(Graph.MxNId), MxEId(Graph.MxEId),
2152  SAttrN(), SAttrE() { }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TAttr SAttrN
Definition: network.h:2072
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TAttr SAttrE
Definition: network.h:2073
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058
TNEANet::TNEANet ( TSIn SIn)
inline

Constructor for loading the graph from a (binary) stream SIn.

Definition at line 2154 of file network.h.

2154  : MxNId(SIn), MxEId(SIn), NodeH(SIn), EdgeH(SIn),
2156  StrDefaultsN(SIn), StrDefaultsE(SIn), FltDefaultsN(SIn), FltDefaultsE(SIn),
2159  VecOfFltVecVecsN(SIn), VecOfFltVecVecsE(SIn),
2162  SAttrN(SIn), SAttrE(SIn) { }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TAttr SAttrN
Definition: network.h:2072
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TAttr SAttrE
Definition: network.h:2073
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058
TNEANet::TNEANet ( const TNEANet Graph,
bool  modeSubGraph 
)
inlineprotected

Definition at line 2164 of file network.h.

2164  : MxNId(Graph.MxNId), MxEId(Graph.MxEId),
2173  { }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058
TNEANet::TNEANet ( bool  copyAll,
const TNEANet Graph 
)
inlineprotected

Definition at line 2174 of file network.h.

2174  : MxNId(Graph.MxNId), MxEId(Graph.MxEId),
2183  SAttrN(Graph.SAttrN), SAttrE(Graph.SAttrE) { }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TAttr SAttrN
Definition: network.h:2072
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TAttr SAttrE
Definition: network.h:2073
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058

Member Function Documentation

int TNEANet::AddAttributes ( const int  NId)
protected

Definition at line 559 of file network.cpp.

References FltDefaultsN, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultN(), GetIntAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), THash< TKey, TDat, THashFunc >::GetKeyV(), TStr::GetNullStr(), GetStrAttrDefaultN(), TVec< TVal, TSizeTy >::Ins(), IntDefaultsN, KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), TInt::Mn, TFlt::Mn, NodeH, StrDefaultsN, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsN, VecOfFltVecVecsN, VecOfIntVecsN, VecOfIntVecVecsN, and VecOfStrVecsN.

Referenced by AddNode(), and AddNodeUnchecked().

559  {
560  int i;
561  // update attribute columns
562  for (i = 0; i < VecOfIntVecsN.Len(); i++) {
563  TVec<TInt>& IntVec = VecOfIntVecsN[i];
564  int KeyId = NodeH.GetKeyId(NId);
565  if (IntVec.Len() > KeyId) {
566  IntVec[KeyId] = TInt::Mn;
567  } else {
568  IntVec.Ins(KeyId, TInt::Mn);
569  }
570  }
571  TVec<TStr> DefIntVec = TVec<TStr>();
572  IntDefaultsN.GetKeyV(DefIntVec);
573  for (i = 0; i < DefIntVec.Len(); i++) {
574  TStr attr = DefIntVec[i];
575  TVec<TInt>& IntVec = VecOfIntVecsN[KeyToIndexTypeN.GetDat(DefIntVec[i]).Val2];
576  IntVec[NodeH.GetKeyId(NId)] = GetIntAttrDefaultN(attr);
577  }
578  for (i = 0; i < VecOfStrVecsN.Len(); i++) {
579  TVec<TStr>& StrVec = VecOfStrVecsN[i];
580  int KeyId = NodeH.GetKeyId(NId);
581  if (StrVec.Len() > KeyId) {
582  StrVec[KeyId] = TStr::GetNullStr();
583  } else {
584  StrVec.Ins(KeyId, TStr::GetNullStr());
585  }
586  }
587  TVec<TStr> DefStrVec = TVec<TStr>();
588  StrDefaultsN.GetKeyV(DefStrVec);
589  for (i = 0; i < DefStrVec.Len(); i++) {
590  TStr attr = DefStrVec[i];
591  TVec<TStr>& StrVec = VecOfStrVecsN[KeyToIndexTypeN.GetDat(DefStrVec[i]).Val2];
592  StrVec[NodeH.GetKeyId(NId)] = GetStrAttrDefaultN(attr);
593  }
594  for (i = 0; i < VecOfFltVecsN.Len(); i++) {
595  TVec<TFlt>& FltVec = VecOfFltVecsN[i];
596  int KeyId = NodeH.GetKeyId(NId);
597  if (FltVec.Len() > KeyId) {
598  FltVec[KeyId] = TFlt::Mn;
599  } else {
600  FltVec.Ins(KeyId, TFlt::Mn);
601  }
602  }
603  TVec<TStr> DefFltVec = TVec<TStr>();
604  FltDefaultsN.GetKeyV(DefFltVec);
605  for (i = 0; i < DefFltVec.Len(); i++) {
606  TStr attr = DefFltVec[i];
607  TVec<TFlt>& FltVec = VecOfFltVecsN[KeyToIndexTypeN.GetDat(DefFltVec[i]).Val2];
608  FltVec[NodeH.GetKeyId(NId)] = GetFltAttrDefaultN(attr);
609  }
610  for (i = 0; i < VecOfIntVecVecsN.Len(); i++) {
611  TVec<TIntV>& IntVecV = VecOfIntVecVecsN[i];
612  int KeyId = NodeH.GetKeyId(NId);
613  if (IntVecV.Len() > KeyId) {
614  IntVecV[KeyId] = TIntV();
615  } else {
616  IntVecV.Ins(KeyId, TIntV());
617  }
618  }
619  for (i = 0; i < VecOfFltVecVecsN.Len(); i++) {
620  TVec<TFltV>& FltVecV = VecOfFltVecVecsN[i];
621  int KeyId = NodeH.GetKeyId(NId);
622  if (FltVecV.Len() > KeyId) {
623  FltVecV[KeyId] = TFltV();
624  } else {
625  FltVecV.Ins(KeyId, TFltV());
626  }
627  }
628  return NId;
629 }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
static const int Mn
Definition: dt.h:1141
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
TStr GetStrAttrDefaultN(const TStr &attribute) const
Gets Str node attribute val. If not a proper attr, return default.
Definition: network.h:2040
static TStr GetNullStr()
Definition: dt.cpp:1626
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVec< TFlt > TFltV
Definition: ds.h:1596
void GetKeyV(TVec< TKey > &KeyV) const
Definition: hash.h:484
Definition: dt.h:412
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVec< TInt > TIntV
Definition: ds.h:1594
TVal2 Val2
Definition: ds.h:35
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
TFlt GetFltAttrDefaultN(const TStr &attribute) const
Gets Flt node attribute val. If not a proper attr, return default.
Definition: network.h:2042
TInt GetIntAttrDefaultN(const TStr &attribute) const
Gets Int node attribute val. If not a proper attr, return default.
Definition: network.h:2038
static const double Mn
Definition: dt.h:1390

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddEdge ( const int &  SrcNId,
const int &  DstNId,
int  EId = -1 
)

Adds an edge with ID EId between node IDs SrcNId and DstNId to the graph.

Returns the ID of the edge being added. If EId is -1, edge ID is automatically assigned. Aborts, if an edge with ID EId already exists. Aborts, if SrcNId or DstNId are not nodes in the graph.

Definition at line 753 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::AddSorted(), EdgeH, FltDefaultsE, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultE(), GetIntAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), THash< TKey, TDat, THashFunc >::GetKeyV(), GetNode(), TStr::GetNullStr(), GetStrAttrDefaultE(), IAssertR, TNEANet::TNode::InEIdV, TVec< TVal, TSizeTy >::Ins(), IntDefaultsE, IsEdge(), IsNode(), KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), TInt::Mn, TFlt::Mn, TMath::Mx(), MxEId, TNEANet::TNode::OutEIdV, StrDefaultsE, TPair< TVal1, TVal2 >::Val2, VecOfFltVecsE, VecOfFltVecVecsE, VecOfIntVecsE, VecOfIntVecVecsE, and VecOfStrVecsE.

753  {
754  int i;
755 
756  if (EId == -1) { EId = MxEId; MxEId++; }
757  else { MxEId = TMath::Mx(EId+1, MxEId()); }
758  IAssertR(!IsEdge(EId), TStr::Fmt("EdgeId %d already exists", EId));
759  IAssertR(IsNode(SrcNId) && IsNode(DstNId), TStr::Fmt("%d or %d not a node.", SrcNId, DstNId).CStr());
760  EdgeH.AddDat(EId, TEdge(EId, SrcNId, DstNId));
761  GetNode(SrcNId).OutEIdV.AddSorted(EId);
762  GetNode(DstNId).InEIdV.AddSorted(EId);
763 
764  // update attribute columns
765  for (i = 0; i < VecOfIntVecsE.Len(); i++) {
766  TVec<TInt>& IntVec = VecOfIntVecsE[i];
767  int KeyId = EdgeH.GetKeyId(EId);
768  if (IntVec.Len() > KeyId) {
769  IntVec[KeyId] = TInt::Mn;
770  } else {
771  IntVec.Ins(KeyId, TInt::Mn);
772  }
773  }
774  TVec<TStr> DefIntVec = TVec<TStr>();
775  IntDefaultsE.GetKeyV(DefIntVec);
776  for (i = 0; i < DefIntVec.Len(); i++) {
777  TStr attr = DefIntVec[i];
778  TVec<TInt>& IntVec = VecOfIntVecsE[KeyToIndexTypeE.GetDat(DefIntVec[i]).Val2];
779  IntVec[EdgeH.GetKeyId(EId)] = GetIntAttrDefaultE(attr);
780  }
781 
782  for (i = 0; i < VecOfIntVecVecsE.Len(); i++) {
783  TVec<TIntV>& IntVecV = VecOfIntVecVecsE[i];
784  IntVecV.Ins(EdgeH.GetKeyId(EId), TIntV());
785  }
786 
787  for (i = 0; i < VecOfFltVecVecsE.Len(); i++) {
788  TVec<TFltV>& FltVecV = VecOfFltVecVecsE[i];
789  FltVecV.Ins(EdgeH.GetKeyId(EId), TFltV());
790  }
791 
792  for (i = 0; i < VecOfStrVecsE.Len(); i++) {
793  TVec<TStr>& StrVec = VecOfStrVecsE[i];
794  int KeyId = EdgeH.GetKeyId(EId);
795  if (StrVec.Len() > KeyId) {
796  StrVec[KeyId] = TStr::GetNullStr();
797  } else {
798  StrVec.Ins(KeyId, TStr::GetNullStr());
799  }
800  }
801  TVec<TStr> DefStrVec = TVec<TStr>();
802  StrDefaultsE.GetKeyV(DefStrVec);
803  for (i = 0; i < DefStrVec.Len(); i++) {
804  TStr attr = DefStrVec[i];
805  TVec<TStr>& StrVec = VecOfStrVecsE[KeyToIndexTypeE.GetDat(DefStrVec[i]).Val2];
806  StrVec[EdgeH.GetKeyId(EId)] = GetStrAttrDefaultE(attr);
807  }
808 
809  for (i = 0; i < VecOfFltVecsE.Len(); i++) {
810  TVec<TFlt>& FltVec = VecOfFltVecsE[i];
811  int KeyId = EdgeH.GetKeyId(EId);
812  if (FltVec.Len() > KeyId) {
813  FltVec[KeyId] = TFlt::Mn;
814  } else {
815  FltVec.Ins(KeyId, TFlt::Mn);
816  }
817  }
818  TVec<TStr> DefFltVec = TVec<TStr>();
819  FltDefaultsE.GetKeyV(DefFltVec);
820  for (i = 0; i < DefFltVec.Len(); i++) {
821  TStr attr = DefFltVec[i];
822  TVec<TFlt>& FltVec = VecOfFltVecsE[KeyToIndexTypeE.GetDat(DefFltVec[i]).Val2];
823  FltVec[EdgeH.GetKeyId(EId)] = GetFltAttrDefaultE(attr);
824  }
825  return EId;
826 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
static const T & Mx(const T &LVal, const T &RVal)
Definition: xmath.h:32
TNode & GetNode(const int &NId)
Definition: network.h:2030
TInt GetIntAttrDefaultE(const TStr &attribute) const
Gets Int edge attribute val. If not a proper attr, return default.
Definition: network.h:2044
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TIntV OutEIdV
Definition: network.h:1749
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TSizeTy AddSorted(const TVal &Val, const bool &Asc=true, const TSizeTy &_MxVals=-1)
Adds element Val to a sorted vector.
Definition: ds.h:1117
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
static const int Mn
Definition: dt.h:1141
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
TStr GetStrAttrDefaultE(const TStr &attribute) const
Gets Str edge attribute val. If not a proper attr, return default.
Definition: network.h:2046
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
static TStr GetNullStr()
Definition: dt.cpp:1626
TInt MxEId
Definition: network.h:2052
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
TVec< TFlt > TFltV
Definition: ds.h:1596
TFlt GetFltAttrDefaultE(const TStr &attribute) const
Gets Flt edge attribute val. If not a proper attr, return default.
Definition: network.h:2048
void GetKeyV(TVec< TKey > &KeyV) const
Definition: hash.h:484
Definition: dt.h:412
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVec< TInt > TIntV
Definition: ds.h:1594
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
TIntV InEIdV
Definition: network.h:1749
TDat & AddDat(const TKey &Key)
Definition: hash.h:238
static const double Mn
Definition: dt.h:1390

Here is the call graph for this function:

int TNEANet::AddEdge ( const TEdgeI EdgeI)
inline

Adds an edge between EdgeI.GetSrcNId() and EdgeI.GetDstNId() to the graph.

Definition at line 2794 of file network.h.

References AddEdge(), TNEANet::TEdgeI::GetDstNId(), TNEANet::TEdgeI::GetId(), and TNEANet::TEdgeI::GetSrcNId().

Referenced by AddEdge().

2794 { return AddEdge(EdgeI.GetSrcNId(), EdgeI.GetDstNId(), EdgeI.GetId()); }
int AddEdge(const int &SrcNId, const int &DstNId, int EId=-1)
Adds an edge with ID EId between node IDs SrcNId and DstNId to the graph.
Definition: network.cpp:753

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddFltAttrDatE ( const TEdgeI EdgeI,
const TFlt value,
const TStr attr 
)
inline

Attribute based add function for attr to Flt value.

Adds the key flt value pair to the corresponding edge attribute value vector.

Definition at line 2908 of file network.h.

References AddFltAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AddFltAttrDatE().

2908 { return AddFltAttrDatE(EdgeI.GetId(), value, attr); }
int AddFltAttrDatE(const TEdgeI &EdgeI, const TFlt &value, const TStr &attr)
Attribute based add function for attr to Flt value.
Definition: network.h:2908

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddFltAttrDatE ( const int &  EId,
const TFlt value,
const TStr attr 
)

Definition at line 1379 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), EdgeH, FltType, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), IsEdge(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), MxEId, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsE.

1379  {
1380  int i;
1381  TInt CurrLen;
1382 
1383  if (!IsEdge(EId)) {
1384  //AddEdge(EId);
1385  return -1;
1386  }
1387  if (KeyToIndexTypeE.IsKey(attr)) {
1389  NewVec[EdgeH.GetKeyId(EId)] = value;
1390  } else {
1391  CurrLen = VecOfFltVecsE.Len();
1392  KeyToIndexTypeE.AddDat(attr, TIntPr(FltType, CurrLen));
1393  TVec<TFlt> NewVec = TVec<TFlt>();
1394  for (i = 0; i < MxEId; i++) {
1395  NewVec.Ins(i, GetFltAttrDefaultE(attr));
1396  }
1397  NewVec[EdgeH.GetKeyId(EId)] = value;
1398  VecOfFltVecsE.Add(NewVec);
1399  }
1400  return 0;
1401 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TFlt GetFltAttrDefaultE(const TStr &attribute) const
Gets Flt edge attribute val. If not a proper attr, return default.
Definition: network.h:2048
TVal2 Val2
Definition: ds.h:35
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddFltAttrDatN ( const TNodeI NodeI,
const TFlt value,
const TStr attr 
)
inline

Attribute based add function for attr to Flt value.

Definition at line 2868 of file network.h.

References AddFltAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by AddFltAttrDatN(), and TSnap::LoadMode().

2868 { return AddFltAttrDatN(NodeI.GetId(), value, attr); }
int AddFltAttrDatN(const TNodeI &NodeI, const TFlt &value, const TStr &attr)
Attribute based add function for attr to Flt value.
Definition: network.h:2868

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddFltAttrDatN ( const int &  NId,
const TFlt value,
const TStr attr 
)

Definition at line 1224 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), FltType, THash< TKey, TDat, THashFunc >::GetDat(), GetFltAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), IsNode(), KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), MxNId, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfFltVecsN.

1224  {
1225  int i;
1226  TInt CurrLen;
1227 
1228  if (!IsNode(NId)) {
1229  // AddNode(NId);
1230  return -1;
1231  }
1232  if (KeyToIndexTypeN.IsKey(attr)) {
1234  NewVec[NodeH.GetKeyId(NId)] = value;
1235  } else {
1236  CurrLen = VecOfFltVecsN.Len();
1237  KeyToIndexTypeN.AddDat(attr, TIntPr(FltType, CurrLen));
1238  TVec<TFlt> NewVec = TVec<TFlt>();
1239  for (i = 0; i < MxNId; i++) {
1240  NewVec.Ins(i, GetFltAttrDefaultN(attr));
1241  }
1242  NewVec[NodeH.GetKeyId(NId)] = value;
1243  VecOfFltVecsN.Add(NewVec);
1244  }
1245  return 0;
1246 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TInt MxNId
Definition: network.h:2052
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
TFlt GetFltAttrDefaultN(const TStr &attribute) const
Gets Flt node attribute val. If not a proper attr, return default.
Definition: network.h:2042
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddFltAttrE ( const TStr attr,
TFlt  defaultValue = TFlt::Mn 
)

Adds a new Flt edge attribute to the hashmap.

Definition at line 1716 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), FltDefaultsE, FltType, TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), MxEId, and VecOfFltVecsE.

1716  {
1717  int i;
1718  TInt CurrLen;
1719  TVec<TFlt> NewVec;
1720  CurrLen = VecOfFltVecsE.Len();
1721  KeyToIndexTypeE.AddDat(attr, TIntPr(FltType, CurrLen));
1722  NewVec = TVec<TFlt>();
1723  for (i = 0; i < MxEId; i++) {
1724  NewVec.Ins(i, defaultValue);
1725  }
1726  VecOfFltVecsE.Add(NewVec);
1727  if (!FltDefaultsE.IsKey(attr)) {
1728  FltDefaultsE.AddDat(attr, defaultValue);
1729  } else {
1730  return -1;
1731  }
1732  return 0;
1733 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
THash< TStr, TFlt > FltDefaultsE
Definition: network.h:2062
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TVec< TFltV > VecOfFltVecsE
Definition: network.h:2065
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddFltAttrN ( const TStr attr,
TFlt  defaultValue = TFlt::Mn 
)

Adds a new Flt node attribute to the hashmap.

Definition at line 1621 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), FltDefaultsN, FltType, TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), MxNId, and VecOfFltVecsN.

1621  {
1622  // TODO(nkhadke): add error checking
1623  int i;
1624  TInt CurrLen;
1625  TVec<TFlt> NewVec;
1626  CurrLen = VecOfFltVecsN.Len();
1627  KeyToIndexTypeN.AddDat(attr, TIntPr(FltType, CurrLen));
1628  NewVec = TVec<TFlt>();
1629  for (i = 0; i < MxNId; i++) {
1630  NewVec.Ins(i, defaultValue);
1631  }
1632  VecOfFltVecsN.Add(NewVec);
1633  if (!FltDefaultsN.IsKey(attr)) {
1634  FltDefaultsN.AddDat(attr, defaultValue);
1635  } else {
1636  return -1;
1637  }
1638  return 0;
1639 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
THash< TStr, TFlt > FltDefaultsN
Definition: network.h:2062
TInt MxNId
Definition: network.h:2052
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVec< TFltV > VecOfFltVecsN
Definition: network.h:2065
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddFltVAttrDatE ( const TEdgeI EdgeI,
const TFltV value,
const TStr attr 
)
inline

Attribute based add function for attr to TFltV value.

Adds the key float vector value pair to the corresponding edge attribute value vector.

Definition at line 2924 of file network.h.

References AddFltVAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AddFltVAttrDatE().

2924 { return AddFltVAttrDatE(EdgeI.GetId(), value, attr); }
int AddFltVAttrDatE(const TEdgeI &EdgeI, const TFltV &value, const TStr &attr)
Attribute based add function for attr to TFltV value.
Definition: network.h:2924

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddFltVAttrDatE ( const int &  EId,
const TFltV value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1294 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), AddFltVAttrE(), CheckDenseOrSparseE(), TStr::CStr(), EdgeH, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsEdge(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, VecOfFltHashVecsE, and VecOfFltVecVecsE.

1294  {
1295  if (!IsEdge(EId)) {
1296  // AddNode(NId);
1297  return -1;
1298  }
1299  TInt location = CheckDenseOrSparseE(attr);
1300 
1301  if (location==-1) {
1302  AddFltVAttrE(attr, UseDense);
1303  location = CheckDenseOrSparseE(attr);
1304  }
1305  if (UseDense) {
1306  IAssertR(location != 0, TStr::Fmt("EdgeID %d exists for %s in sparse representation", EId, attr.CStr()));
1308  NewVec[EdgeH.GetKeyId(EId)] = value;
1309  } else {
1310  IAssertR(location != 1, TStr::Fmt("NodeId %d exists for %s in dense representation", EId, attr.CStr()));
1312  NewHash.AddDat(EdgeH.GetKeyId(EId), value);
1313  }
1314  return 0;
1315 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TInt CheckDenseOrSparseE(const TStr &attr) const
Definition: network.h:2116
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal2 Val2
Definition: ds.h:35
char * CStr()
Definition: dt.h:479
TDat & AddDat(const TKey &Key)
Definition: hash.h:238
int AddFltVAttrE(const TStr &attr, TBool UseDense=true)
Adds a new FltV edge attribute to the hashmap.
Definition: network.cpp:1679

Here is the call graph for this function:

int TNEANet::AddFltVAttrDatN ( const TNodeI NodeI,
const TFltV value,
const TStr attr 
)
inline

Attribute based add function for attr to FltV value.

Definition at line 2874 of file network.h.

References AddFltVAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by AddFltVAttrDatN().

2874 { return AddFltVAttrDatN(NodeI.GetId(), value, attr); }
int AddFltVAttrDatN(const TNodeI &NodeI, const TFltV &value, const TStr &attr)
Attribute based add function for attr to FltV value.
Definition: network.h:2874

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddFltVAttrDatN ( const int &  NId,
const TFltV value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1077 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), AddFltVAttrN(), CheckDenseOrSparseN(), TStr::CStr(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsNode(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, VecOfFltHashVecsN, and VecOfFltVecVecsN.

1077  {
1078  if (!IsNode(NId)) {
1079  // AddNode(NId);
1080  return -1;
1081  }
1082 
1083  TInt location = CheckDenseOrSparseN(attr);
1084  if (location==-1) {
1085  AddFltVAttrN(attr, UseDense);
1086  location = CheckDenseOrSparseN(attr);
1087  }
1088 
1089  if (UseDense) {
1090  IAssertR(location != 0, TStr::Fmt("NodeId %d exists for %s in sparse representation", NId, attr.CStr()));
1092  NewVec[NodeH.GetKeyId(NId)] = value;
1093  } else {
1094  IAssertR(location != 1, TStr::Fmt("NodeId %d exists for %s in dense representation", NId, attr.CStr()));
1096  NewHash.AddDat(NodeH.GetKeyId(NId), value);
1097  }
1098 
1099  return 0;
1100 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TInt CheckDenseOrSparseN(const TStr &attr) const
Return 1 if in Dense, 0 if in Sparse, -1 if neither.
Definition: network.h:2110
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
int AddFltVAttrN(const TStr &attr, TBool UseDense=true)
Adds a new FltV node attribute to the hashmap.
Definition: network.cpp:1584
char * CStr()
Definition: dt.h:479
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddFltVAttrE ( const TStr attr,
TBool  UseDense = true 
)

Adds a new FltV edge attribute to the hashmap.

Definition at line 1679 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), FltVType, KeyToDenseE, KeyToIndexTypeE, MxEId, VecOfFltHashVecsE, and VecOfFltVecVecsE.

Referenced by AddFltVAttrDatE().

1679  {
1680  TInt CurrLen;
1681  if (UseDense) {
1682  CurrLen = VecOfFltVecVecsE.Len();
1683  KeyToIndexTypeE.AddDat(attr, TIntPr(FltVType, CurrLen));
1684  KeyToDenseE.AddDat(attr, true);
1685  TVec<TFltV> NewVec = TVec<TFltV>(MxEId);
1686  VecOfFltVecVecsE.Add(NewVec);
1687  } else {
1688  CurrLen = VecOfFltHashVecsE.Len();
1689  KeyToIndexTypeE.AddDat(attr, TIntPr(FltVType, CurrLen));
1690  KeyToDenseE.AddDat(attr, false);
1691  THash<TInt, TFltV> NewHash;
1692  VecOfFltHashVecsE.Add(NewHash);
1693  }
1694  return 0;
1695 }
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddFltVAttrN ( const TStr attr,
TBool  UseDense = true 
)

Adds a new FltV node attribute to the hashmap.

Definition at line 1584 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), FltVType, KeyToDenseN, KeyToIndexTypeN, MxNId, VecOfFltHashVecsN, and VecOfFltVecVecsN.

Referenced by AddFltVAttrDatN(), and AppendFltVAttrDatN().

1584  {
1585  TInt CurrLen;
1586  if (UseDense) {
1587  CurrLen = VecOfFltVecVecsN.Len();
1588  KeyToIndexTypeN.AddDat(attr, TIntPr(FltVType, CurrLen));
1589  KeyToDenseN.AddDat(attr, true);
1590  TVec<TFltV> NewVec = TVec<TFltV>(MxNId);
1591  VecOfFltVecVecsN.Add(NewVec);
1592  } else {
1593  CurrLen = VecOfFltHashVecsN.Len();
1594  KeyToIndexTypeN.AddDat(attr, TIntPr(FltVType, CurrLen));
1595  KeyToDenseN.AddDat(attr, false);
1596  THash<TInt, TFltV> NewHash;
1597  VecOfFltHashVecsN.Add(NewHash);
1598  }
1599  return 0;
1600 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
TInt MxNId
Definition: network.h:2052
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
TDat & AddDat(const TKey &Key)
Definition: hash.h:238
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddIntAttrDatE ( const TEdgeI EdgeI,
const TInt value,
const TStr attr 
)
inline

Attribute based add function for attr to Int value.

Adds the key int value pair to the corresponding edge attribute value vector.

Definition at line 2898 of file network.h.

References AddIntAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AddIntAttrDatE().

2898 { return AddIntAttrDatE(EdgeI.GetId(), value, attr); }
int AddIntAttrDatE(const TEdgeI &EdgeI, const TInt &value, const TStr &attr)
Attribute based add function for attr to Int value.
Definition: network.h:2898

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddIntAttrDatE ( const int &  EId,
const TInt value,
const TStr attr 
)

Definition at line 1248 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), GetIntAttrDefaultE(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), IntType, IsEdge(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), MxEId, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsE.

1248  {
1249  int i;
1250  TInt CurrLen;
1251  if (!IsEdge(EId)) {
1252  //AddEdge(EId);
1253  return -1;
1254  }
1255  if (KeyToIndexTypeE.IsKey(attr)) {
1257  NewVec[EdgeH.GetKeyId(EId)] = value;
1258  } else {
1259  CurrLen = VecOfIntVecsE.Len();
1260  KeyToIndexTypeE.AddDat(attr, TIntPr(IntType, CurrLen));
1261  TVec<TInt> NewVec = TVec<TInt>();
1262  for (i = 0; i < MxEId; i++) {
1263  NewVec.Ins(i, GetIntAttrDefaultE(attr));
1264  }
1265  NewVec[EdgeH.GetKeyId(EId)] = value;
1266  VecOfIntVecsE.Add(NewVec);
1267  }
1268  return 0;
1269 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TInt GetIntAttrDefaultE(const TStr &attribute) const
Gets Int edge attribute val. If not a proper attr, return default.
Definition: network.h:2044
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVal2 Val2
Definition: ds.h:35
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddIntAttrDatN ( const TNodeI NodeI,
const TInt value,
const TStr attr 
)
inline

Attribute based add function for attr to Int value.

Definition at line 2862 of file network.h.

References AddIntAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by AddIntAttrDatN(), and TSnap::LoadMode().

2862 { return AddIntAttrDatN(NodeI.GetId(), value, attr); }
int AddIntAttrDatN(const TNodeI &NodeI, const TInt &value, const TStr &attr)
Attribute based add function for attr to Int value.
Definition: network.h:2862

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddIntAttrDatN ( const int &  NId,
const TInt value,
const TStr attr 
)

Definition at line 1031 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), THash< TKey, TDat, THashFunc >::GetDat(), GetIntAttrDefaultN(), THash< TKey, TDat, THashFunc >::GetKeyId(), TVec< TVal, TSizeTy >::Ins(), IntType, THash< TKey, TDat, THashFunc >::IsKey(), IsNode(), KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), MxNId, NodeH, TPair< TVal1, TVal2 >::Val2, and VecOfIntVecsN.

1031  {
1032  int i;
1033  TInt CurrLen;
1034  if (!IsNode(NId)) {
1035  // AddNode(NId);
1036  return -1;
1037  }
1038  if (KeyToIndexTypeN.IsKey(attr)) {
1040  NewVec[NodeH.GetKeyId(NId)] = value;
1041  } else {
1042  CurrLen = VecOfIntVecsN.Len();
1043  KeyToIndexTypeN.AddDat(attr, TIntPr(IntType, CurrLen));
1044  TVec<TInt> NewVec = TVec<TInt>();
1045  for (i = 0; i < MxNId; i++) {
1046  NewVec.Ins(i, GetIntAttrDefaultN(attr));
1047  }
1048  NewVec[NodeH.GetKeyId(NId)] = value;
1049  VecOfIntVecsN.Add(NewVec);
1050  }
1051  return 0;
1052 }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TInt MxNId
Definition: network.h:2052
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
TInt GetIntAttrDefaultN(const TStr &attribute) const
Gets Int node attribute val. If not a proper attr, return default.
Definition: network.h:2038
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddIntAttrE ( const TStr attr,
TInt  defaultValue = TInt::Mn 
)

Adds a new Int edge attribute to the hashmap.

Definition at line 1641 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), IntDefaultsE, IntType, THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), MxEId, and VecOfIntVecsE.

1641  {
1642  // TODO(nkhadke): add error checking
1643  int i;
1644  TInt CurrLen;
1645  TVec<TInt> NewVec;
1646  CurrLen = VecOfIntVecsE.Len();
1647  KeyToIndexTypeE.AddDat(attr, TIntPr(IntType, CurrLen));
1648  NewVec = TVec<TInt>();
1649  for (i = 0; i < MxEId; i++) {
1650  NewVec.Ins(i, defaultValue);
1651  }
1652  VecOfIntVecsE.Add(NewVec);
1653  if (!IntDefaultsE.IsKey(attr)) {
1654  IntDefaultsE.AddDat(attr, defaultValue);
1655  } else {
1656  return -1;
1657  }
1658  return 0;
1659 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
THash< TStr, TInt > IntDefaultsE
Definition: network.h:2060
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TVec< TIntV > VecOfIntVecsE
Definition: network.h:2063
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddIntAttrN ( const TStr attr,
TInt  defaultValue = TInt::Mn 
)

Adds a new Int node attribute to the hashmap.

Definition at line 1547 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), IntDefaultsN, IntType, THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), MxNId, and VecOfIntVecsN.

1547  {
1548  int i;
1549  TInt CurrLen;
1550  TVec<TInt> NewVec;
1551  CurrLen = VecOfIntVecsN.Len();
1552  KeyToIndexTypeN.AddDat(attr, TIntPr(IntType, CurrLen));
1553  NewVec = TVec<TInt>();
1554  for (i = 0; i < MxNId; i++) {
1555  NewVec.Ins(i, defaultValue);
1556  }
1557  VecOfIntVecsN.Add(NewVec);
1558  if (!IntDefaultsN.IsKey(attr)) {
1559  IntDefaultsN.AddDat(attr, defaultValue);
1560  } else {
1561  return -1;
1562  }
1563  return 0;
1564 }
TVec< TIntV > VecOfIntVecsN
Definition: network.h:2063
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TInt MxNId
Definition: network.h:2052
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
THash< TStr, TInt > IntDefaultsN
Definition: network.h:2060
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddIntVAttrDatE ( const TEdgeI EdgeI,
const TIntV value,
const TStr attr 
)
inline

Attribute based add function for attr to IntV value.

Adds the key integer vector value pair to the corresponding edge attribute value vector.

Definition at line 2915 of file network.h.

References AddIntVAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AddIntVAttrDatE().

2915 { return AddIntVAttrDatE(EdgeI.GetId(), value, attr); }
int AddIntVAttrDatE(const TEdgeI &EdgeI, const TIntV &value, const TStr &attr)
Attribute based add function for attr to IntV value.
Definition: network.h:2915

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddIntVAttrDatE ( const int &  EId,
const TIntV value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1271 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), AddIntVAttrE(), CheckDenseOrSparseE(), TStr::CStr(), EdgeH, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsEdge(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, VecOfIntHashVecsE, and VecOfIntVecVecsE.

1271  {
1272  if (!IsEdge(EId)) {
1273  // AddNode(NId);
1274  return -1;
1275  }
1276  TInt location = CheckDenseOrSparseE(attr);
1277  if (location==-1) {
1278  AddIntVAttrE(attr, UseDense);
1279  location = CheckDenseOrSparseE(attr);
1280  }
1281  if (UseDense) {
1282  IAssertR(location != 0, TStr::Fmt("EdgeID %d exists for %s in sparse representation", EId, attr.CStr()));
1284  NewVec[EdgeH.GetKeyId(EId)] = value;
1285  } else {
1286  IAssertR(location != 1, TStr::Fmt("NodeId %d exists for %s in dense representation", EId, attr.CStr()));
1288  NewHash.AddDat(EdgeH.GetKeyId(EId), value);
1289  }
1290  return 0;
1291 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TInt CheckDenseOrSparseE(const TStr &attr) const
Definition: network.h:2116
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
int AddIntVAttrE(const TStr &attr, TBool UseDense=true)
Adds a new IntV edge attribute to the hashmap.
Definition: network.cpp:1661
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal2 Val2
Definition: ds.h:35
char * CStr()
Definition: dt.h:479
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddIntVAttrDatN ( const TNodeI NodeI,
const TIntV value,
const TStr attr 
)
inline

Attribute based add function for attr to IntV value.

Definition at line 2871 of file network.h.

References AddIntVAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by AddIntVAttrDatN().

2871 { return AddIntVAttrDatN(NodeI.GetId(), value, attr); }
int AddIntVAttrDatN(const TNodeI &NodeI, const TIntV &value, const TStr &attr)
Attribute based add function for attr to IntV value.
Definition: network.h:2871

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddIntVAttrDatN ( const int &  NId,
const TIntV value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1054 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), AddIntVAttrN(), CheckDenseOrSparseN(), TStr::CStr(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsNode(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, VecOfIntHashVecsN, and VecOfIntVecVecsN.

1054  {
1055  if (!IsNode(NId)) {
1056  // AddNode(NId);
1057  return -1;
1058  }
1059  TInt location = CheckDenseOrSparseN(attr);
1060  if (location==-1) {
1061  AddIntVAttrN(attr, UseDense);
1062  location = CheckDenseOrSparseN(attr);
1063  }
1064  if (UseDense) {
1065  IAssertR(location != 0, TStr::Fmt("NodeId %d exists for %s in sparse representation", NId, attr.CStr()));
1067  NewVec[NodeH.GetKeyId(NId)] = value;
1068  } else {
1069  IAssertR(location != 1, TStr::Fmt("NodeId %d exists for %s in dense representation", NId, attr.CStr()));
1071  NewHash.AddDat(NodeH.GetKeyId(NId), value);
1072  }
1073 
1074  return 0;
1075 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
int AddIntVAttrN(const TStr &attr, TBool UseDense=true)
Adds a new IntV node attribute to the hashmap.
Definition: network.cpp:1566
TInt CheckDenseOrSparseN(const TStr &attr) const
Return 1 if in Dense, 0 if in Sparse, -1 if neither.
Definition: network.h:2110
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
char * CStr()
Definition: dt.h:479
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddIntVAttrE ( const TStr attr,
TBool  UseDense = true 
)

Adds a new IntV edge attribute to the hashmap.

Definition at line 1661 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), IntVType, KeyToDenseE, KeyToIndexTypeE, TVec< TVal, TSizeTy >::Len(), MxEId, VecOfIntHashVecsE, and VecOfIntVecVecsE.

Referenced by AddIntVAttrDatE().

1661  {
1662  TInt CurrLen;
1663  if (UseDense) {
1664  CurrLen = VecOfIntVecVecsE.Len();
1665  KeyToIndexTypeE.AddDat(attr, TIntPr(IntVType, CurrLen));
1666  KeyToDenseE.AddDat(attr, true);
1667  TVec<TIntV> NewVec = TVec<TIntV>(MxEId);
1668  VecOfIntVecVecsE.Add(NewVec);
1669  } else {
1670  CurrLen = VecOfIntHashVecsE.Len();
1671  KeyToIndexTypeE.AddDat(attr, TIntPr(IntVType, CurrLen));
1672  KeyToDenseE.AddDat(attr, false);
1673  THash<TInt, TIntV> NewHash;
1674  VecOfIntHashVecsE.Add(NewHash);
1675  }
1676  return 0;
1677 }
THash< TStr, TBool > KeyToDenseE
Definition: network.h:2058
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddIntVAttrN ( const TStr attr,
TBool  UseDense = true 
)

Adds a new IntV node attribute to the hashmap.

Definition at line 1566 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), IntVType, KeyToDenseN, KeyToIndexTypeN, TVec< TVal, TSizeTy >::Len(), MxNId, VecOfIntHashVecsN, and VecOfIntVecVecsN.

Referenced by AddIntVAttrDatN(), and AppendIntVAttrDatN().

1566  {
1567  TInt CurrLen;
1568  if (UseDense) {
1569  CurrLen = VecOfIntVecVecsN.Len();
1570  KeyToIndexTypeN.AddDat(attr, TIntPr(IntVType, CurrLen));
1571  KeyToDenseN.AddDat(attr, true);
1572  TVec<TIntV> NewVec = TVec<TIntV>(MxNId);
1573  VecOfIntVecVecsN.Add(NewVec);
1574  } else {
1575  CurrLen = VecOfIntHashVecsN.Len();
1576  KeyToIndexTypeN.AddDat(attr, TIntPr(IntVType, CurrLen));
1577  KeyToDenseN.AddDat(attr, false);
1578  THash<TInt, TIntV> NewHash;
1579  VecOfIntHashVecsN.Add(NewHash);
1580  }
1581  return 0;
1582 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TInt MxNId
Definition: network.h:2052
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TDat & AddDat(const TKey &Key)
Definition: hash.h:238
THash< TStr, TBool > KeyToDenseN
KeyToDense[N|E]: Key->(True if Vec, False if Hash)
Definition: network.h:2058

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::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 535 of file network.cpp.

References AddAttributes(), THash< TKey, TDat, THashFunc >::AddDat(), TStr::Fmt(), IAssertR, IsNode(), TMath::Mx(), MxNId, and NodeH.

Referenced by TSnap::LoadMode().

535  {
536  if (NId == -1) {
537  NId = MxNId; MxNId++;
538  } else {
539  IAssertR(!IsNode(NId), TStr::Fmt("NodeId %d already exists", NId));
540  MxNId = TMath::Mx(NId+1, MxNId());
541  }
542  NodeH.AddDat(NId, TNode(NId));
543  AddAttributes(NId);
544  return NId;
545 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
static const T & Mx(const T &LVal, const T &RVal)
Definition: xmath.h:32
TInt MxNId
Definition: network.h:2052
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
int AddAttributes(const int NId)
Definition: network.cpp:559
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddNode ( const TNodeI NodeI)
inline

Adds a node of ID NodeI.GetId() to the graph.

Definition at line 2377 of file network.h.

References AddNode(), and TNEANet::TNodeI::GetId().

Referenced by AddNode().

2377 { return AddNode(NodeI.GetId()); }
int AddNode(int NId=-1)
Adds a node of ID NId to the network.
Definition: network.cpp:535

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::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 547 of file network.cpp.

References AddAttributes(), THash< TKey, TDat, THashFunc >::AddDat(), IsNode(), TMath::Mx(), MxNId, and NodeH.

547  {
548  if (NId == -1) {
549  NId = MxNId; MxNId++;
550  } else {
551  if (IsNode(NId)) { return -1;}
552  MxNId = TMath::Mx(NId+1, MxNId());
553  }
554  NodeH.AddDat(NId, TNode(NId));
555  AddAttributes(NId);
556  return NId;
557 }
static const T & Mx(const T &LVal, const T &RVal)
Definition: xmath.h:32
TInt MxNId
Definition: network.h:2052
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
int AddAttributes(const int NId)
Definition: network.cpp:559
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TInt EId,
const TStr AttrName,
const TInt Val 
)

Adds Int sparse attribute with name AttrName to the given edge with id EId.

Definition at line 1991 of file network.cpp.

References TAttr::AddSAttrDat(), IsEdge(), and SAttrE.

1991  {
1992  if (!IsEdge(EId)) {
1993  return -1;
1994  }
1995  return SAttrE.AddSAttrDat(EId, AttrName, Val);
1996 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TAttr SAttrE
Definition: network.h:2073

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TInt EId,
const TInt AttrId,
const TInt Val 
)

Adds Int sparse attribute with id AttrId to the given edge with id EId.

Definition at line 1998 of file network.cpp.

References TAttr::AddSAttrDat(), IsEdge(), and SAttrE.

1998  {
1999  if (!IsEdge(EId)) {
2000  return -1;
2001  }
2002  return SAttrE.AddSAttrDat(EId, AttrId, Val);
2003 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TAttr SAttrE
Definition: network.h:2073

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TEdgeI EdgeI,
const TStr AttrName,
const TInt Val 
)
inline

Adds Int sparse attribute with name AttrName to EdgeI.

Definition at line 3243 of file network.h.

References TNEANet::TEdgeI::GetId().

3243  {
3244  return AddSAttrDatE(EdgeI.GetId(), AttrName, Val);
3245  }
int AddSAttrDatE(const TInt &EId, const TStr &AttrName, const TInt &Val)
Adds Int sparse attribute with name AttrName to the given edge with id EId.
Definition: network.cpp:1991

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TEdgeI EdgeI,
const TInt AttrId,
const TInt Val 
)
inline

Adds Int sparse attribute with id AttrId to EdgeI.

Definition at line 3247 of file network.h.

References TNEANet::TEdgeI::GetId().

3247  {
3248  return AddSAttrDatE(EdgeI.GetId(), AttrId, Val);
3249  }
int AddSAttrDatE(const TInt &EId, const TStr &AttrName, const TInt &Val)
Adds Int sparse attribute with name AttrName to the given edge with id EId.
Definition: network.cpp:1991

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TInt EId,
const TStr AttrName,
const TFlt Val 
)

Adds Flt sparse attribute with name AttrName to the given edge with id EId.

Definition at line 2005 of file network.cpp.

References TAttr::AddSAttrDat(), IsEdge(), and SAttrE.

2005  {
2006  if (!IsEdge(EId)) {
2007  return -1;
2008  }
2009  return SAttrE.AddSAttrDat(EId, AttrName, Val);
2010 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TAttr SAttrE
Definition: network.h:2073

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TInt EId,
const TInt AttrId,
const TFlt Val 
)

Adds Flt sparse attribute with id AttrId to the given edge with id EId.

Definition at line 2012 of file network.cpp.

References TAttr::AddSAttrDat(), IsEdge(), and SAttrE.

2012  {
2013  if (!IsEdge(EId)) {
2014  return -1;
2015  }
2016  return SAttrE.AddSAttrDat(EId, AttrId, Val);
2017 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TAttr SAttrE
Definition: network.h:2073

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TEdgeI EdgeI,
const TStr AttrName,
const TFlt Val 
)
inline

Adds Flt sparse attribute with name AttrName to EdgeI.

Definition at line 3257 of file network.h.

References TNEANet::TEdgeI::GetId().

3257  {
3258  return AddSAttrDatE(EdgeI.GetId(), AttrName, Val);
3259  }
int AddSAttrDatE(const TInt &EId, const TStr &AttrName, const TInt &Val)
Adds Int sparse attribute with name AttrName to the given edge with id EId.
Definition: network.cpp:1991

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TEdgeI EdgeI,
const TInt AttrId,
const TFlt Val 
)
inline

Adds Flt sparse attribute with id AttrId to EdgeI.

Definition at line 3261 of file network.h.

References TNEANet::TEdgeI::GetId().

3261  {
3262  return AddSAttrDatE(EdgeI.GetId(), AttrId, Val);
3263  }
int AddSAttrDatE(const TInt &EId, const TStr &AttrName, const TInt &Val)
Adds Int sparse attribute with name AttrName to the given edge with id EId.
Definition: network.cpp:1991

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TInt EId,
const TStr AttrName,
const TStr Val 
)

Adds Str sparse attribute with name AttrName to the given edge with id EId.

Definition at line 2019 of file network.cpp.

References TAttr::AddSAttrDat(), IsEdge(), and SAttrE.

2019  {
2020  if (!IsEdge(EId)) {
2021  return -1;
2022  }
2023  return SAttrE.AddSAttrDat(EId, AttrName, Val);
2024 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TAttr SAttrE
Definition: network.h:2073

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TInt EId,
const TInt AttrId,
const TStr Val 
)

Adds Str sparse attribute with id AttrId to the given edge with id EId.

Definition at line 2026 of file network.cpp.

References TAttr::AddSAttrDat(), IsEdge(), and SAttrE.

2026  {
2027  if (!IsEdge(EId)) {
2028  return -1;
2029  }
2030  return SAttrE.AddSAttrDat(EId, AttrId, Val);
2031 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
TAttr SAttrE
Definition: network.h:2073

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TEdgeI EdgeI,
const TStr AttrName,
const TStr Val 
)
inline

Adds Str sparse attribute with name AttrName to EdgeI.

Definition at line 3271 of file network.h.

References TNEANet::TEdgeI::GetId().

3271  {
3272  return AddSAttrDatE(EdgeI.GetId(), AttrName, Val);
3273  }
int AddSAttrDatE(const TInt &EId, const TStr &AttrName, const TInt &Val)
Adds Int sparse attribute with name AttrName to the given edge with id EId.
Definition: network.cpp:1991

Here is the call graph for this function:

int TNEANet::AddSAttrDatE ( const TEdgeI EdgeI,
const TInt AttrId,
const TStr Val 
)
inline

Adds Str sparse attribute with id AttrId to EdgeI.

Definition at line 3275 of file network.h.

References TNEANet::TEdgeI::GetId().

3275  {
3276  return AddSAttrDatE(EdgeI.GetId(), AttrId, Val);
3277  }
int AddSAttrDatE(const TInt &EId, const TStr &AttrName, const TInt &Val)
Adds Int sparse attribute with name AttrName to the given edge with id EId.
Definition: network.cpp:1991

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TInt NId,
const TStr AttrName,
const TInt Val 
)

Adds Int sparse attribute with name AttrName to the given node with id NId.

Definition at line 1865 of file network.cpp.

References TAttr::AddSAttrDat(), IsNode(), and SAttrN.

1865  {
1866  if (!IsNode(NId)) {
1867  return -1;
1868  }
1869  return SAttrN.AddSAttrDat(NId, AttrName, Val);
1870 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
TAttr SAttrN
Definition: network.h:2072
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TInt NId,
const TInt AttrId,
const TInt Val 
)

Adds Int sparse attribute with id AttrId to the given node with id NId.

Definition at line 1872 of file network.cpp.

References TAttr::AddSAttrDat(), IsNode(), and SAttrN.

1872  {
1873  if (!IsNode(NId)) {
1874  return -1;
1875  }
1876  return SAttrN.AddSAttrDat(NId, AttrId, Val);
1877 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
TAttr SAttrN
Definition: network.h:2072
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TNodeI NodeI,
const TStr AttrName,
const TInt Val 
)
inline

Adds Int sparse attribute with name AttrName to NodeI.

Definition at line 3125 of file network.h.

References TNEANet::TNodeI::GetId().

3125  {
3126  return AddSAttrDatN(NodeI.GetId(), AttrName, Val);
3127  }
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.
Definition: network.cpp:1865

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TNodeI NodeI,
const TInt AttrId,
const TInt Val 
)
inline

Adds Int sparse attribute with id AttrId to NodeI.

Definition at line 3129 of file network.h.

References TNEANet::TNodeI::GetId().

3129  {
3130  return AddSAttrDatN(NodeI.GetId(), AttrId, Val);
3131  }
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.
Definition: network.cpp:1865

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TInt NId,
const TStr AttrName,
const TFlt Val 
)

Adds Flt sparse attribute with name AttrName to the given node with id NId.

Definition at line 1879 of file network.cpp.

References TAttr::AddSAttrDat(), IsNode(), and SAttrN.

1879  {
1880  if (!IsNode(NId)) {
1881  return -1;
1882  }
1883  return SAttrN.AddSAttrDat(NId, AttrName, Val);
1884 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
TAttr SAttrN
Definition: network.h:2072
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TInt NId,
const TInt AttrId,
const TFlt Val 
)

Adds Flt sparse attribute with id AttrId to the given node with id NId.

Definition at line 1886 of file network.cpp.

References TAttr::AddSAttrDat(), IsNode(), and SAttrN.

1886  {
1887  if (!IsNode(NId)) {
1888  return -1;
1889  }
1890  return SAttrN.AddSAttrDat(NId, AttrId, Val);
1891 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
TAttr SAttrN
Definition: network.h:2072
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TNodeI NodeI,
const TStr AttrName,
const TFlt Val 
)
inline

Adds Flt sparse attribute with name AttrName to NodeI.

Definition at line 3139 of file network.h.

References TNEANet::TNodeI::GetId().

3139  {
3140  return AddSAttrDatN(NodeI.GetId(), AttrName, Val);
3141  }
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.
Definition: network.cpp:1865

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TNodeI NodeI,
const TInt AttrId,
const TFlt Val 
)
inline

Adds Flt sparse attribute with id AttrId to NodeI.

Definition at line 3143 of file network.h.

References TNEANet::TNodeI::GetId().

3143  {
3144  return AddSAttrDatN(NodeI.GetId(), AttrId, Val);
3145  }
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.
Definition: network.cpp:1865

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TInt NId,
const TStr AttrName,
const TStr Val 
)

Adds Str sparse attribute with name AttrName to the given node with id NId.

Definition at line 1893 of file network.cpp.

References TAttr::AddSAttrDat(), IsNode(), and SAttrN.

1893  {
1894  if (!IsNode(NId)) {
1895  return -1;
1896  }
1897  return SAttrN.AddSAttrDat(NId, AttrName, Val);
1898 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
TAttr SAttrN
Definition: network.h:2072
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TInt NId,
const TInt AttrId,
const TStr Val 
)

Adds Str sparse attribute with id AttrId to the given node with id NId.

Definition at line 1900 of file network.cpp.

References TAttr::AddSAttrDat(), IsNode(), and SAttrN.

1900  {
1901  if (!IsNode(NId)) {
1902  return -1;
1903  }
1904  return SAttrN.AddSAttrDat(NId, AttrId, Val);
1905 }
int AddSAttrDat(const TInt &Id, const TStr &AttrName, const TInt &Val)
Add Int attribute with name AttrName for the given id Id.
Definition: attr.cpp:2
TAttr SAttrN
Definition: network.h:2072
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TNodeI NodeI,
const TStr AttrName,
const TStr Val 
)
inline

Adds Str sparse attribute with name AttrName to NodeI.

Definition at line 3153 of file network.h.

References TNEANet::TNodeI::GetId().

3153  {
3154  return AddSAttrDatN(NodeI.GetId(), AttrName, Val);
3155  }
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.
Definition: network.cpp:1865

Here is the call graph for this function:

int TNEANet::AddSAttrDatN ( const TNodeI NodeI,
const TInt AttrId,
const TStr Val 
)
inline

Adds Str sparse attribute with id AttrId to NodeI.

Definition at line 3157 of file network.h.

References TNEANet::TNodeI::GetId().

3157  {
3158  return AddSAttrDatN(NodeI.GetId(), AttrId, Val);
3159  }
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.
Definition: network.cpp:1865

Here is the call graph for this function:

int TNEANet::AddSAttrE ( const TStr Name,
const TAttrType AttrType,
TInt AttrId 
)

Adds mapping for sparse attribute with name Name and type AttrType.

Definition at line 2105 of file network.cpp.

References TAttr::AddSAttr(), and SAttrE.

2105  {
2106  return SAttrE.AddSAttr(Name, AttrType, AttrId);
2107 }
TAttr SAttrE
Definition: network.h:2073
int AddSAttr(const TStr &Name, const TAttrType &AttrType, TInt &AttrIdX)
Adds a mapping for an attribute with name Name and type AttrType.
Definition: attr.cpp:210

Here is the call graph for this function:

int TNEANet::AddSAttrN ( const TStr Name,
const TAttrType AttrType,
TInt AttrId 
)

Adds mapping for sparse attribute with name Name and type AttrType.

Definition at line 1979 of file network.cpp.

References TAttr::AddSAttr(), and SAttrN.

1979  {
1980  return SAttrN.AddSAttr(Name, AttrType, AttrId);
1981 }
TAttr SAttrN
Definition: network.h:2072
int AddSAttr(const TStr &Name, const TAttrType &AttrType, TInt &AttrIdX)
Adds a mapping for an attribute with name Name and type AttrType.
Definition: attr.cpp:210

Here is the call graph for this function:

int TNEANet::AddStrAttrDatE ( const TEdgeI EdgeI,
const TStr value,
const TStr attr 
)
inline

Attribute based add function for attr to Str value.

Adds the key str value pair to the corresponding edge attribute value vector.

Definition at line 2903 of file network.h.

References AddStrAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AddStrAttrDatE().

2903 { return AddStrAttrDatE(EdgeI.GetId(), value, attr); }
int AddStrAttrDatE(const TEdgeI &EdgeI, const TStr &value, const TStr &attr)
Attribute based add function for attr to Str value.
Definition: network.h:2903

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddStrAttrDatE ( const int &  EId,
const TStr value,
const TStr attr 
)

Definition at line 1356 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), EdgeH, THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultE(), TVec< TVal, TSizeTy >::Ins(), IsEdge(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, StrType, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsE.

1356  {
1357  int i;
1358  TInt CurrLen;
1359  if (!IsEdge(EId)) {
1360  //AddEdge(EId);
1361  return -1;
1362  }
1363  if (KeyToIndexTypeE.IsKey(attr)) {
1365  NewVec[EdgeH.GetKeyId(EId)] = value;
1366  } else {
1367  CurrLen = VecOfStrVecsE.Len();
1368  KeyToIndexTypeE.AddDat(attr, TIntPr(StrType, CurrLen));
1369  TVec<TStr> NewVec = TVec<TStr>();
1370  for (i = 0; i < MxEId; i++) {
1371  NewVec.Ins(i, GetStrAttrDefaultE(attr));
1372  }
1373  NewVec[EdgeH.GetKeyId(EId)] = value;
1374  VecOfStrVecsE.Add(NewVec);
1375  }
1376  return 0;
1377 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TStr GetStrAttrDefaultE(const TStr &attribute) const
Gets Str edge attribute val. If not a proper attr, return default.
Definition: network.h:2046
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVal2 Val2
Definition: ds.h:35
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddStrAttrDatN ( const TNodeI NodeI,
const TStr value,
const TStr attr 
)
inline

Attribute based add function for attr to Str value.

Definition at line 2865 of file network.h.

References AddStrAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by AddStrAttrDatN(), and TSnap::LoadMode().

2865 { return AddStrAttrDatN(NodeI.GetId(), value, attr); }
int AddStrAttrDatN(const TNodeI &NodeI, const TStr &value, const TStr &attr)
Attribute based add function for attr to Str value.
Definition: network.h:2865

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AddStrAttrDatN ( const int &  NId,
const TStr value,
const TStr attr 
)

Definition at line 1201 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetStrAttrDefaultN(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), IsNode(), KeyToIndexTypeN, MxNId, NodeH, StrType, TPair< TVal1, TVal2 >::Val2, and VecOfStrVecsN.

1201  {
1202  int i;
1203  TInt CurrLen;
1204  if (!IsNode(NId)) {
1205  // AddNode(NId);
1206  return -1;
1207  }
1208  if (KeyToIndexTypeN.IsKey(attr)) {
1210  NewVec[NodeH.GetKeyId(NId)] = value;
1211  } else {
1212  CurrLen = VecOfStrVecsN.Len();
1213  KeyToIndexTypeN.AddDat(attr, TIntPr(StrType, CurrLen));
1214  TVec<TStr> NewVec = TVec<TStr>();
1215  for (i = 0; i < MxNId; i++) {
1216  NewVec.Ins(i, GetStrAttrDefaultN(attr));
1217  }
1218  NewVec[NodeH.GetKeyId(NId)] = value;
1219  VecOfStrVecsN.Add(NewVec);
1220  }
1221  return 0;
1222 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TInt MxNId
Definition: network.h:2052
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
TStr GetStrAttrDefaultN(const TStr &attribute) const
Gets Str node attribute val. If not a proper attr, return default.
Definition: network.h:2040
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddStrAttrE ( const TStr attr,
TStr  defaultValue = TStr::GetNullStr() 
)

Adds a new Str edge attribute to the hashmap.

Definition at line 1697 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeE, MxEId, StrDefaultsE, StrType, and VecOfStrVecsE.

1697  {
1698  int i;
1699  TInt CurrLen;
1700  TVec<TStr> NewVec;
1701  CurrLen = VecOfStrVecsE.Len();
1702  KeyToIndexTypeE.AddDat(attr, TIntPr(StrType, CurrLen));
1703  NewVec = TVec<TStr>();
1704  for (i = 0; i < MxEId; i++) {
1705  NewVec.Ins(i, defaultValue);
1706  }
1707  VecOfStrVecsE.Add(NewVec);
1708  if (!StrDefaultsE.IsKey(attr)) {
1709  StrDefaultsE.AddDat(attr, defaultValue);
1710  } else {
1711  return -1;
1712  }
1713  return 0;
1714 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TVec< TStrV > VecOfStrVecsE
Definition: network.h:2064
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
TInt MxEId
Definition: network.h:2052
Definition: dt.h:1137
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
THash< TStr, TStr > StrDefaultsE
Definition: network.h:2061
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AddStrAttrN ( const TStr attr,
TStr  defaultValue = TStr::GetNullStr() 
)

Adds a new Str node attribute to the hashmap.

Definition at line 1602 of file network.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), TVec< TVal, TSizeTy >::Ins(), THash< TKey, TDat, THashFunc >::IsKey(), KeyToIndexTypeN, MxNId, StrDefaultsN, StrType, and VecOfStrVecsN.

1602  {
1603  int i;
1604  TInt CurrLen;
1605  TVec<TStr> NewVec;
1606  CurrLen = VecOfStrVecsN.Len();
1607  KeyToIndexTypeN.AddDat(attr, TIntPr(StrType, CurrLen));
1608  NewVec = TVec<TStr>();
1609  for (i = 0; i < MxNId; i++) {
1610  NewVec.Ins(i, defaultValue);
1611  }
1612  VecOfStrVecsN.Add(NewVec);
1613  if (!StrDefaultsN.IsKey(attr)) {
1614  StrDefaultsN.AddDat(attr, defaultValue);
1615  } else {
1616  return -1;
1617  }
1618  return 0;
1619 }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
TInt MxNId
Definition: network.h:2052
TVec< TStrV > VecOfStrVecsN
Definition: network.h:2064
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
THash< TStr, TStr > StrDefaultsN
Definition: network.h:2061
Definition: dt.h:1137
void Ins(const TSizeTy &ValN, const TVal &Val)
Inserts new element Val before the element at position ValN.
Definition: ds.h:1180
bool IsKey(const TKey &Key) const
Definition: hash.h:258
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

int TNEANet::AppendFltVAttrDatE ( const TEdgeI EdgeI,
const TFlt value,
const TStr attr 
)
inline

Appends value onto the TFltV attribute for the given node.

Definition at line 2927 of file network.h.

References AppendFltVAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AppendFltVAttrDatE().

2927 { return AppendFltVAttrDatE(EdgeI.GetId(), value, attr); }
int AppendFltVAttrDatE(const TEdgeI &EdgeI, const TFlt &value, const TStr &attr)
Appends value onto the TFltV attribute for the given node.
Definition: network.h:2927

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AppendFltVAttrDatE ( const int &  EId,
const TFlt value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1337 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), CheckDenseOrSparseE(), TStr::CStr(), EdgeH, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsEdge(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, VecOfFltHashVecsE, and VecOfFltVecVecsE.

1337  {
1338  if (!IsEdge(EId)) {
1339  // AddNode(NId);
1340  return -1;
1341  }
1342  TInt location = CheckDenseOrSparseE(attr);
1343  if (location==-1) return -1;
1344  if (UseDense) {
1345  IAssertR(location != 0, TStr::Fmt("Edge %d exists for %s in sparse representation", EId, attr.CStr()));
1347  NewVec[EdgeH.GetKeyId(EId)].Add(value);
1348  } else {
1349  IAssertR(location != 1, TStr::Fmt("Edge %d exists for %s in dense representation", EId, attr.CStr()));
1351  NewHash[EdgeH.GetKeyId(EId)].Add(value);
1352  }
1353  return 0;
1354 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TInt CheckDenseOrSparseE(const TStr &attr) const
Definition: network.h:2116
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TVec< TVec< TFltV > > VecOfFltVecVecsE
Definition: network.h:2067
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
TVec< THash< TInt, TFltV > > VecOfFltHashVecsE
Definition: network.h:2069
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal2 Val2
Definition: ds.h:35
char * CStr()
Definition: dt.h:479
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

int TNEANet::AppendFltVAttrDatN ( const TNodeI NodeI,
const TFlt value,
const TStr attr 
)
inline

Appends value onto the TFltV attribute for the given node.

Definition at line 2887 of file network.h.

References AppendFltVAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by AppendFltVAttrDatN().

2887 { return AppendFltVAttrDatN(NodeI.GetId(), value, attr); }
int AppendFltVAttrDatN(const TNodeI &NodeI, const TFlt &value, const TStr &attr)
Appends value onto the TFltV attribute for the given node.
Definition: network.h:2887

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AppendFltVAttrDatN ( const int &  NId,
const TFlt value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1125 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), AddFltVAttrN(), CheckDenseOrSparseN(), TStr::CStr(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsNode(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, VecOfFltHashVecsN, and VecOfFltVecVecsN.

1125  {
1126  if (!IsNode(NId)) {
1127  // AddNode(NId);
1128  return -1;
1129  }
1130 
1131  TInt location = CheckDenseOrSparseN(attr);
1132 
1133 
1134  if (location==-1) {
1135  AddFltVAttrN(attr, UseDense);
1136  location = CheckDenseOrSparseN(attr);
1137  }
1138  if (UseDense) {
1139  IAssertR(location != 0, TStr::Fmt("NodeId %d exists for %s in sparse representation", NId, attr.CStr()));
1141  NewVec[NodeH.GetKeyId(NId)].Add(value);
1142  } else {
1143  IAssertR(location != 1, TStr::Fmt("NodeId %d exists for %s in dense representation", NId, attr.CStr()));
1145  NewHash[NodeH.GetKeyId(NId)].Add(value);
1146  }
1147  return 0;
1148 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TInt CheckDenseOrSparseN(const TStr &attr) const
Return 1 if in Dense, 0 if in Sparse, -1 if neither.
Definition: network.h:2110
TVec< THash< TInt, TFltV > > VecOfFltHashVecsN
Definition: network.h:2069
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TVec< TVec< TFltV > > VecOfFltVecVecsN
Definition: network.h:2067
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
int AddFltVAttrN(const TStr &attr, TBool UseDense=true)
Adds a new FltV node attribute to the hashmap.
Definition: network.cpp:1584
char * CStr()
Definition: dt.h:479
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

int TNEANet::AppendIntVAttrDatE ( const TEdgeI EdgeI,
const TInt value,
const TStr attr 
)
inline

Appends value onto the TIntV attribute for the given node.

Definition at line 2918 of file network.h.

References AppendIntVAttrDatE(), and TNEANet::TEdgeI::GetId().

Referenced by AppendIntVAttrDatE().

2918 { return AppendIntVAttrDatE(EdgeI.GetId(), value, attr); }
int AppendIntVAttrDatE(const TEdgeI &EdgeI, const TInt &value, const TStr &attr)
Appends value onto the TIntV attribute for the given node.
Definition: network.h:2918

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AppendIntVAttrDatE ( const int &  EId,
const TInt value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1317 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), CheckDenseOrSparseE(), TStr::CStr(), EdgeH, TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsEdge(), KeyToIndexTypeE, TPair< TVal1, TVal2 >::Val2, VecOfIntHashVecsE, and VecOfIntVecVecsE.

1317  {
1318  if (!IsEdge(EId)) {
1319  // AddNode(NId);
1320  return -1;
1321  }
1322  TInt location = CheckDenseOrSparseE(attr);
1323  if (location==-1) return -1;
1324  if (UseDense) {
1325  IAssertR(location != 0, TStr::Fmt("Edge %d exists for %s in sparse representation", EId, attr.CStr()));
1327  NewVec[EdgeH.GetKeyId(EId)].Add(value);
1328  } else {
1329  IAssertR(location != 1, TStr::Fmt("Edge %d exists for %s in dense representation", EId, attr.CStr()));
1331  NewHash[EdgeH.GetKeyId(EId)].Add(value);
1332  }
1333  return 0;
1334 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
TVec< THash< TInt, TIntV > > VecOfIntHashVecsE
Definition: network.h:2068
TInt CheckDenseOrSparseE(const TStr &attr) const
Definition: network.h:2116
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056
bool IsEdge(const int &EId) const
Tests whether an edge with edge ID EId exists in the graph.
Definition: network.h:2804
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
THash< TInt, TEdge > EdgeH
Definition: network.h:2054
TVec< TVec< TIntV > > VecOfIntVecVecsE
Definition: network.h:2066
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVal2 Val2
Definition: ds.h:35
char * CStr()
Definition: dt.h:479
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

int TNEANet::AppendIntVAttrDatN ( const TNodeI NodeI,
const TInt value,
const TStr attr 
)
inline

Appends value onto the TIntV attribute for the given node.

Definition at line 2880 of file network.h.

References AppendIntVAttrDatN(), and TNEANet::TNodeI::GetId().

Referenced by TModeNet::AddNeighbor(), and AppendIntVAttrDatN().

2880 { return AppendIntVAttrDatN(NodeI.GetId(), value, attr); }
int AppendIntVAttrDatN(const TNodeI &NodeI, const TInt &value, const TStr &attr)
Appends value onto the TIntV attribute for the given node.
Definition: network.h:2880

Here is the call graph for this function:

Here is the caller graph for this function:

int TNEANet::AppendIntVAttrDatN ( const int &  NId,
const TInt value,
const TStr attr,
TBool  UseDense = true 
)

Definition at line 1102 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), AddIntVAttrN(), CheckDenseOrSparseN(), TStr::CStr(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::GetKeyId(), IAssertR, IsNode(), KeyToIndexTypeN, NodeH, TPair< TVal1, TVal2 >::Val2, VecOfIntHashVecsN, and VecOfIntVecVecsN.

1102  {
1103  if (!IsNode(NId)) {
1104  // AddNode(NId);
1105  return -1;
1106  }
1107  TInt location = CheckDenseOrSparseN(attr);
1108  if (location==-1) {
1109  AddIntVAttrN(attr, UseDense);
1110  location = CheckDenseOrSparseN(attr);
1111  }
1112  if (UseDense) {
1113  IAssertR(location != 0, TStr::Fmt("NodeId %d exists for %s in sparse representation", NId, attr.CStr()));
1115  NewVec[NodeH.GetKeyId(NId)].Add(value);
1116  } else {
1117  IAssertR(location != 1, TStr::Fmt("NodeId %d exists for %s in dense representation", NId, attr.CStr()));
1119  NewHash[NodeH.GetKeyId(NId)].Add(value);
1120  }
1121  return 0;
1122 }
#define IAssertR(Cond, Reason)
Definition: bd.h:265
int AddIntVAttrN(const TStr &attr, TBool UseDense=true)
Adds a new IntV node attribute to the hashmap.
Definition: network.cpp:1566
TInt CheckDenseOrSparseN(const TStr &attr) const
Return 1 if in Dense, 0 if in Sparse, -1 if neither.
Definition: network.h:2110
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262
TStrIntPrH KeyToIndexTypeN
KeyToIndexType[N|E]: Key->(Type,Index).
Definition: network.h:2056
Definition: dt.h:1137
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
TVec< THash< TInt, TIntV > > VecOfIntHashVecsN
Definition: network.h:2068
TVal2 Val2
Definition: ds.h:35
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: network.h:2385
THash< TInt, TNode > NodeH
Definition: network.h:2053
TVec< TVec< TIntV > > VecOfIntVecVecsN
Definition: network.h:2066
char * CStr()
Definition: dt.h:479
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

void TNEANet::AttrNameEI ( const TInt EId,
TStrV Names 
) const
inline

Returns a vector of attr names for edge EId.

Definition at line 2586 of file network.h.

References THash< TKey, TDat, THashFunc >::BegI().

Referenced by TNEANet::TEdgeI::GetAttrNames().

2586  {
2587  AttrNameEI(EId, KeyToIndexTypeE.BegI(), Names);}
void AttrNameEI(const TInt &EId, TStrV &Names) const
Returns a vector of attr names for edge EId.
Definition: network.h:2586
TIter BegI() const
Definition: hash.h:213
TStrIntPrH KeyToIndexTypeE
Definition: network.h:2056

Here is the call graph for this function:

Here is the caller graph for this function:

void TNEANet::AttrNameEI ( const TInt EId,
TStrIntPrH::TIter  EdgeHI,
TStrV Names 
) const

Definition at line 308 of file network.cpp.

References TVec< TVal, TSizeTy >::Add(), EdgeAttrIsDeleted(), THashKeyDatI< TKey, TDat >::GetKey(), and THashKeyDatI< TKey, TDat >::IsEnd().

308  {
309  Names = TVec<TStr>();
310  while (!EdgeHI.IsEnd()) {
311  if (!EdgeAttrIsDeleted(EId, EdgeHI)) {
312  Names.Add(EdgeHI.GetKey());
313  }
314  EdgeHI++;
315  }
316 }
bool EdgeAttrIsDeleted(const int &EId, const TStrIntPrH::TIter &EdgeHI) const
Returns true if EId attr deleted for current edge attr iterator.
Definition: network.cpp:482
const TKey & GetKey() const
Definition: hash.h:80
bool IsEnd() const
Tests whether the iterator is pointing to the past-end element.
Definition: hash.h:78
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

void TNEANet::AttrNameNI ( const TInt NId,
TStrV Names 
) const
inline

Returns a vector of attr names for node NId.

Definition at line 2531 of file