SNAP Library 3.0, User Reference
2016-07-20 17:56:49
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... | |
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... | |
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 262 of file mmnet.h.
Definition at line 264 of file mmnet.h.
Definition at line 266 of file mmnet.h.
|
inline |
Definition at line 268 of file mmnet.h.
|
inline |
Definition at line 270 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 188 of file mmnet.cpp.
|
inline |
Attribute based add function for attr to Flt value.
Definition at line 374 of file mmnet.h.
Definition at line 471 of file mmnet.cpp.
Adds a new Flt edge attribute to the hashmap.
Definition at line 561 of file mmnet.cpp.
|
inline |
Attribute based add function for attr to Int value.
Definition at line 368 of file mmnet.h.
Definition at line 425 of file mmnet.cpp.
Adds a new Int edge attribute to the hashmap.
Definition at line 522 of file mmnet.cpp.
|
inline |
Attribute based add function for attr to Str value.
Definition at line 371 of file mmnet.h.
Definition at line 448 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 542 of file mmnet.cpp.
Returns a vector of attr names for edge EId.
Definition at line 333 of file mmnet.h.
void TCrossNet::AttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 284 of file mmnet.cpp.
Returns a vector of attr values for edge EId.
Definition at line 337 of file mmnet.h.
void TCrossNet::AttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 294 of file mmnet.cpp.
|
inline |
void TCrossNet::Clr | ( | ) |
Deletes all nodes and edges from the graph.
Definition at line 174 of file mmnet.cpp.
|
inline |
Deletes the edge attribute for NodeI.
Definition at line 425 of file mmnet.h.
int TCrossNet::DelAttrDatE | ( | const int & | EId, |
const TStr & | attr | ||
) |
Definition at line 507 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 256 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 386 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsFltDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 405 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsIntDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 393 of file mmnet.cpp.
bool TCrossNet::EdgeAttrIsStrDeleted | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 399 of file mmnet.cpp.
|
inline |
Returns a vector of int attr names for node NId.
Definition at line 359 of file mmnet.h.
void TCrossNet::FltAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 346 of file mmnet.cpp.
Returns a vector of attr values for node NId.
Definition at line 363 of file mmnet.h.
void TCrossNet::FltAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TFltV & | Values | ||
) | const |
Definition at line 356 of file mmnet.cpp.
|
private |
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 420 of file mmnet.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 396 of file mmnet.h.
Returns an iterator referring to the edge of ID EId in the graph.
Definition at line 408 of file mmnet.h.
|
inlineprivate |
TStr TCrossNet::GetEdgeAttrValue | ( | const int & | EId, |
const TStrIntPrH::TIter & | CrossHI | ||
) | const |
Definition at line 411 of file mmnet.cpp.
|
inline |
|
inline |
|
inline |
Gets the value of flt attr from the edge attr value vector.
Definition at line 384 of file mmnet.h.
|
inline |
Gets the value of int attr from the edge attr value vector.
Definition at line 378 of file mmnet.h.
|
inline |
|
inline |
Gets the id of the dst mode.
Definition at line 324 of file mmnet.h.
|
inline |
Definition at line 307 of file mmnet.h.
|
inline |
Gets the value of str attr from the edge attr value vector.
Definition at line 381 of file mmnet.h.
Gets Str edge attribute val. If not a proper attr, return default.
Definition at line 298 of file mmnet.h.
Returns a vector of int attr names for edge EId.
Definition at line 341 of file mmnet.h.
void TCrossNet::IntAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 304 of file mmnet.cpp.
Returns a vector of attr values for edge EId.
Definition at line 345 of file mmnet.h.
void TCrossNet::IntAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TIntV & | Values | ||
) | const |
Definition at line 314 of file mmnet.cpp.
bool TCrossNet::IsAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 367 of file mmnet.cpp.
|
inline |
Whether edges in the crossnet are directed.
Definition at line 331 of file mmnet.h.
|
inline |
bool TCrossNet::IsFltAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 382 of file mmnet.cpp.
bool TCrossNet::IsIntAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 374 of file mmnet.cpp.
bool TCrossNet::IsStrAttrDeletedE | ( | const int & | EId, |
const TStr & | attr | ||
) | const |
Definition at line 378 of file mmnet.cpp.
Definition at line 275 of file mmnet.h.
|
inline |
Saves the TCrossNet to the binary stream.
Definition at line 326 of file mmnet.h.
|
private |
Returns a vector of str attr names for node NId.
Definition at line 351 of file mmnet.h.
void TCrossNet::StrAttrNameEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Names | ||
) | const |
Definition at line 325 of file mmnet.cpp.
Returns a vector of attr values for node NId.
Definition at line 355 of file mmnet.h.
void TCrossNet::StrAttrValueEI | ( | const TInt & | EId, |
TStrIntPrH::TIter | CrossHI, | ||
TStrV & | Values | ||
) | const |
Definition at line 335 of file mmnet.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |