SNAP Library 6.0, User Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Implements a single CrossNet consisting of edges between two TModeNets (could be the same TModeNet) More...
#include <mmnet.h>
Classes | |
class | TAFltI |
Node/edge float attribute iterator. Iterates through all nodes/edges for one float attribute. More... | |
class | TAIntI |
Node/edge integer attribute iterator. Iterates through all nodes/edges for one integer attribute. More... | |
class | TAStrI |
Node/edge string attribute iterator. Iterates through all nodes/edges for one string attribute. More... | |
class | TCrossEdge |
A single edge in the cross net. Has an Edge Id, and the source and destination node ids. (Mode ids are implicit from TCrossNet) More... | |
class | TCrossEdgeI |
Edge iterator. Only forward iteration (operator++) is supported. More... | |
class | TLoadVecInit |
Public Member Functions | |
TCrossNet () | |
TCrossNet (TInt MId1, TInt MId2, TInt LId) | |
TCrossNet (TInt MId1, TInt MId2, TBool IsDir, TInt LId) | |
TCrossNet (TSIn &SIn) | |
TCrossNet (const TCrossNet &OtherTCrossNet) | |
TCrossNet & | operator= (const TCrossNet &OtherTCrossNet) |
bool | IsEdge (const int &EId) const |
Tests whether an edge with edge ID EId exists in the graph. More... | |
int | GetMxEId () const |
int | GetEdges () const |
Returns the number of edges in the graph. More... | |
void | Clr () |
Deletes all nodes and edges from the graph. More... | |
int | AddEdge (const int &sourceNId, const int &destNId, int EId=-1) |
Adds an edge to the CrossNet; Mode1 NId should be the sourceNId always, regardless of whether edge is directed. More... | |
TCrossEdgeI | GetEdgeI (const int &EId) const |
Edge iterators. More... | |
TCrossEdgeI | BegEdgeI () const |
TCrossEdgeI | EndEdgeI () const |
int | DelEdge (const int &EId) |
Deletes an edge by its id. More... | |
int | GetMode1 () const |
Gets the id of the src mode. More... | |
int | GetMode2 () const |
Gets the id of the dst mode. More... | |
void | Save (TSOut &SOut) const |
Saves the TCrossNet to the binary stream. More... | |
void | LoadShM (TShMIn &ShMIn) |
Loads network from shared memory stream. More... | |
bool | IsDirected () const |
Whether edges in the crossnet are directed. More... | |
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 CrossHI, 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 CrossHI, 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 CrossHI, 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 CrossHI, TIntV &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 CrossHI, 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 CrossHI, 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 CrossHI, 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 CrossHI, TFltV &Values) const |
int | AddIntAttrDatE (const TCrossEdgeI &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 TCrossEdgeI &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 TCrossEdgeI &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) |
TInt | GetIntAttrDatE (const TCrossEdgeI &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 TCrossEdgeI &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 TCrossEdgeI &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) |
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... | |
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 | DelAttrDatE (const TCrossEdgeI &EdgeI, const TStr &attr) |
Deletes the edge attribute for NodeI. More... | |
int | DelAttrDatE (const int &EId, const TStr &attr) |
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 | DelAttrE (const TStr &attr) |
Removes all the values for edge attr. More... | |
bool | IsAttrDeletedE (const int &EId, const TStr &attr) const |
bool | IsIntAttrDeletedE (const int &EId, const TStr &attr) const |
bool | IsStrAttrDeletedE (const int &EId, const TStr &attr) const |
bool | IsFltAttrDeletedE (const int &EId, const TStr &attr) const |
bool | EdgeAttrIsDeleted (const int &EId, const TStrIntPrH::TIter &CrossHI) const |
bool | EdgeAttrIsIntDeleted (const int &EId, const TStrIntPrH::TIter &CrossHI) const |
bool | EdgeAttrIsStrDeleted (const int &EId, const TStrIntPrH::TIter &CrossHI) const |
bool | EdgeAttrIsFltDeleted (const int &EId, const TStrIntPrH::TIter &CrossHI) const |
TStr | GetEdgeAttrValue (const int &EId, const TStrIntPrH::TIter &CrossHI) const |
Private Types | |
enum | { IntType, StrType, FltType } |
Private Member Functions | |
void | SetParentPointer (TMMNet *parent) |
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... | |
int | GetAttrTypeE (const TStr &attr) const |
TCrossEdge & | GetEdge (int eid) |
Private Attributes | |
THash< TInt, TCrossEdge > | CrossH |
TInt | MxEId |
The HashTable from Edge id to the corresponding Edge. More... | |
TInt | Mode1 |
TInt | Mode2 |
The first mode. In the case of directed crossnets, this is implicitly understood to be the source mode. More... | |
TBool | IsDirect |
The second mode. In the case of directed crossnets, this is implicitly understood to be the destination mode. More... | |
TInt | CrossNetId |
TMMNet * | Net |
TStrIntPrH | KeyToIndexTypeE |
THash< TStr, TInt > | IntDefaultsE |
THash< TStr, TStr > | StrDefaultsE |
THash< TStr, TFlt > | FltDefaultsE |
TVec< TIntV > | VecOfIntVecsE |
TVec< TStrV > | VecOfStrVecsE |
TVec< TFltV > | VecOfFltVecsE |
Friends | |
class | TMMNet |
class | TModeNet |
Implements a single CrossNet consisting of edges between two TModeNets (could be the same TModeNet)
The class corresponding to one particular CrossNet in a TMMNet. Has a CrossNet name, and two modes. Can be either undirected or directed. If it is directed, it is directed in one direction only: from mode 1 to mode 2.
|
private |
Enumerator | |
---|---|
IntType | |
StrType | |
FltType |
|
inline |
Definition at line 280 of file mmnet.h.
Definition at line 282 of file mmnet.h.
Definition at line 284 of file mmnet.h.
|
inline |
Definition at line 286 of file mmnet.h.
|
inline |
Definition at line 288 of file mmnet.h.
int TCrossNet::AddEdge | ( | const int & | sourceNId, |
const int & | destNId, | ||
int | EId = -1 |
||
) |
Adds an edge to the CrossNet; Mode1 NId should be the sourceNId always, regardless of whether edge is directed.
Definition at line 233 of file mmnet.cpp.
|
inline |
Attribute based add function for attr to Flt value.
Definition at line 410 of file mmnet.h.
Definition at line 516 of file mmnet.cpp.
Adds a new Flt edge attribute to the hashmap.
Definition at line 606 of file mmnet.cpp.
|
inline |
Attribute based add function for attr to Int value.
Definition at line 404 of file mmnet.h.
Definition at line 470 of file mmnet.cpp.
Adds a new Int edge attribute to the hashmap.
Definition at line 567 of file mmnet.cpp.
|
inline |
Attribute based add function for attr to Str value.
Definition at line 407 of file mmnet.h.
Definition at line 493 of file mmnet.cpp.
int TCrossNet::AddStrAttrE | ( | const TStr & | attr, |
TStr | defaultValue = TStr::GetNullStr() |
||
) |
Adds a new Str edge attribute to the hashmap.
Definition at line 587 of file mmnet.cpp.
Returns a vector of attr names for edge EId.
Definition at line 369 of file mmnet.h.
void TCrossNet::AttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 329 of file mmnet.cpp.
Returns a vector of attr values for edge EId.
Definition at line 373 of file mmnet.h.
void TCrossNet::AttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 339 of file mmnet.cpp.
|
inline |
void TCrossNet::Clr | ( | ) |
Deletes all nodes and edges from the graph.
Definition at line 219 of file mmnet.cpp.
|
inline |
Deletes the edge attribute for NodeI.
Definition at line 461 of file mmnet.h.
int TCrossNet::DelAttrDatE | ( | const int & | EId, |
const TStr & | attr | ||
) |
Definition at line 552 of file mmnet.cpp.
int TCrossNet::DelAttrE | ( | const TStr & | attr | ) |
Removes all the values for edge attr.
int TCrossNet::DelEdge | ( | const int & | EId | ) |
Deletes an edge by its id.
Definition at line 301 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 431 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsFltDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 450 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsIntDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 438 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsStrDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 444 of file mmnet.cpp.
|
inline |
Returns a vector of int attr names for node NId.
Definition at line 395 of file mmnet.h.
void TCrossNet::FltAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 391 of file mmnet.cpp.
Returns a vector of attr values for node NId.
Definition at line 399 of file mmnet.h.
void TCrossNet::FltAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 401 of file mmnet.cpp.
|
private |
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 456 of file mmnet.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 432 of file mmnet.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 444 of file mmnet.h.
|
inlineprivate |
TStr TCrossNet::GetEdgeAttrValue | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 456 of file mmnet.cpp.
|
inline |
|
inline |
|
inline |
Gets the value of flt attr from the edge attr value vector.
Definition at line 420 of file mmnet.h.
|
inline |
Gets the value of int attr from the edge attr value vector.
Definition at line 414 of file mmnet.h.
|
inline |
|
inline |
Gets the id of the dst mode.
Definition at line 342 of file mmnet.h.
|
inline |
Definition at line 325 of file mmnet.h.
|
inline |
Gets the value of str attr from the edge attr value vector.
Definition at line 417 of file mmnet.h.
Gets Str edge attribute val. If not a proper attr, return default.
Definition at line 316 of file mmnet.h.
Returns a vector of int attr names for edge EId.
Definition at line 377 of file mmnet.h.
void TCrossNet::IntAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 349 of file mmnet.cpp.
Returns a vector of attr values for edge EId.
Definition at line 381 of file mmnet.h.
void TCrossNet::IntAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 359 of file mmnet.cpp.
bool TCrossNet::IsAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 412 of file mmnet.cpp.
|
inline |
Whether edges in the crossnet are directed.
Definition at line 367 of file mmnet.h.
|
inline |
bool TCrossNet::IsFltAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 427 of file mmnet.cpp.
bool TCrossNet::IsIntAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 419 of file mmnet.cpp.
bool TCrossNet::IsStrAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 423 of file mmnet.cpp.
|
inline |
Loads network from shared memory stream.
Definition at line 348 of file mmnet.h.
Definition at line 293 of file mmnet.h.
|
inline |
Saves the TCrossNet to the binary stream.
Definition at line 344 of file mmnet.h.
|
private |
Returns a vector of str attr names for node NId.
Definition at line 387 of file mmnet.h.
void TCrossNet::StrAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 370 of file mmnet.cpp.
Returns a vector of attr values for node NId.
Definition at line 391 of file mmnet.h.
void TCrossNet::StrAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 380 of file mmnet.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |