SNAP Library 4.1, User Reference
2018-07-26 16:30:42
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Big Network. More...
#include <bignet.h>
Classes | |
class | TEdgeI |
Edge iterator. More... | |
class | TNode |
Node container class. More... | |
class | TNodeI |
Node iterator. More... | |
Public Types | |
enum | { DelNId = INT_MAX } |
typedef TNodeData | TNodeDat |
typedef TBigNet< TNodeData, IsDir > | TNet |
typedef TPt< TNet > | PNet |
typedef THash< TInt, TNode > | TNodeH |
typedef TPt< TBigNet < TNodeData, IsDir > > | PBigNet |
typedef TVecPool< TInt > | TVPool |
typedef TPt< TVPool > | PVPool |
Public Member Functions | |
TBigNet (const int &Nodes, const TSize &Edges, const bool &Sources=false) | |
TBigNet (TSIn &SIn) | |
virtual | ~TBigNet () |
virtual void | Save (TSOut &SOut) const |
TBigNet & | operator= (const TBigNet &Net) |
bool | OnlySources () const |
bool | HasFlag (const TGraphFlag &Flag) const |
void | DumpFlags () const |
int | GetNodes () const |
int | GetMxNId () const |
Returns an id that is larger than any node id in the network. More... | |
int | AddNode (int NId, const int &InDeg, const int &OutDeg) |
int | AddNode (int NId, const int &InDeg, const int &OutDeg, const TNodeDat &NodeDat) |
int | AddNode (int NId, const TIntV &InNIdV, const TIntV &OutNIdV) |
int | AddNode (int NId, const TIntV &InNIdV, const TIntV &OutNIdV, const TNodeDat &NodeDat) |
int | AddUndirNode (int NId, const int &Deg) |
int | AddUndirNode (int NId, const int &Deg, const TNodeDat &NodeDat) |
int | AddUndirNode (int NId, const TIntV &EdgeNIdV) |
int | AddUndirNode (int NId, const TIntV &EdgeNIdV, const TNodeDat &NodeDat) |
void | SetInNIdV (int NId, const TIntV &InNIdV) |
void | SetOutNIdV (int NId, const TIntV &OutNIdV) |
void | GetInNIdV (int NId, TIntV &OutNIdV) const |
void | GetOutNIdV (int NId, TIntV &OutNIdV) const |
bool | IsNode (const int &NId) const |
TNodeI | BegNI () const |
TNodeI | EndNI () const |
TNodeI | GetNI (const int &NId) const |
TNodeDat & | GetNDat (const int &NId) |
const TNodeDat & | GetNDat (const int &NId) const |
TEdgeI | BegEI () const |
TEdgeI | EndEI () const |
TEdgeI | GetEI (const int &EId) const |
int | IsolateNode (int NId) |
int | DelNode (int NId) |
bool | IsIsoNode (const int &NId) const |
uint | GetDelEdges () |
void | CompactEdgePool () |
::TSize | GetEdges () const |
int | AddEdge (const int &SrcNId, const int &DstNId) |
bool | IsEdge (const int &SrcNId, const int &DstNId, const bool &Dir=true) const |
void | SortEdgeV () |
void | InvertFromSources (uint ExpectNodes=0) |
void | Rewire (TRnd &Rnd=TInt::Rnd) |
PNGraph | GetNGraph (const bool &RenumberNodes=false) const |
PNGraph | GetSubNGraph (const TIntV &NIdV) const |
PBigNet | GetSubGraph (const TIntV &NIdV, const bool &RenumberNodes=false) const |
void | GetSubGraph (const TIntV &NIdV, TBigNet *NewNet, const bool &RenumberNodes=false) const |
int | GetRndNId (TRnd &Rnd=TInt::Rnd) const |
TNodeI | GetRndNI (TRnd &Rnd=TInt::Rnd) const |
void | GetNIdV (TIntV &NIdV) const |
bool | Empty () const |
void | Clr (const bool &DoDel=true) |
void | Reserve (const int &Nodes, const TSize &Edges) |
void | Defrag (const bool &OnlyNodeLinks=false) |
bool | IsOk () const |
void | Dump (const TStr &Desc=TStr()) const |
void | SaveForDisk (const TStr &OutFNm) const |
Static Public Member Functions | |
static PBigNet | New (const int &Nodes, const TSize &Edges, const bool &Sources=false) |
static PBigNet | Load (TSIn &SIn) |
static void | LoadNodeDatH (const TStr &InFNm, TNodeH &NodeH) |
static void | SaveToDisk (const TStr &InFNm, const TStr &OutFNm, const bool &SaveSparseHash) |
Protected Member Functions | |
bool | IsNode (const int &NId, TNode &Node) const |
int * | GetInNIdVPt (const int &NId) const |
int * | GetOutNIdVPt (const int &NId) const |
const TNode & | GetNode (const int &NId) const |
TNode & | GetNode (const int &NId) |
Static Protected Member Functions | |
static void | AddSorted (int *Beg, int *End, const int &Val) |
static const int * | BinSearch (const int *Beg, const int *End, const int &Val) |
static const int * | BinSearch2 (const int *Beg, const int *End, const int &Val) |
Protected Attributes | |
TCRef | CRef |
TInt | MxNId |
TB32Set | Flags |
TVPool | Pool |
TNodeH | NodeH |
Friends | |
class | TPt< TBigNet > |
Big Network.
This class implements similar interface to TNGraph and TUNGraph. The class is meant for storing particularly large static directed or undirected networks. The network representation is optimized for low memory footprint. This means that when a particular node is added to the network its (maximum) in- and out-degree need to be specified, so that the class allocates enough memory for that number of edges being adjacent to a node. The class nicely supports adding as well as deleting nodes, although the memory does not get freed. Deleting edges is supported, while adding edges is supported only up to the point until the node reaches its prespecified in- or out-degree.
anonymous enum |
TBigNet< TNodeData, IsDir >::TBigNet | ( | const int & | Nodes, |
const TSize & | Edges, | ||
const bool & | Sources = false |
||
) |
int TBigNet< TNodeData, IsDir >::AddEdge | ( | const int & | SrcNId, |
const int & | DstNId | ||
) |
Definition at line 537 of file bignet.h.
int TBigNet< TNodeData, IsDir >::AddNode | ( | int | NId, |
const int & | InDeg, | ||
const int & | OutDeg | ||
) |
int TBigNet< TNodeData, IsDir >::AddNode | ( | int | NId, |
const int & | InDeg, | ||
const int & | OutDeg, | ||
const TNodeDat & | NodeDat | ||
) |
int TBigNet< TNodeData, IsDir >::AddNode | ( | int | NId, |
const TIntV & | InNIdV, | ||
const TIntV & | OutNIdV | ||
) |
int TBigNet< TNodeData, IsDir >::AddNode | ( | int | NId, |
const TIntV & | InNIdV, | ||
const TIntV & | OutNIdV, | ||
const TNodeDat & | NodeDat | ||
) |
|
staticprotected |
int TBigNet< TNodeData, IsDir >::AddUndirNode | ( | int | NId, |
const int & | Deg | ||
) |
int TBigNet< TNodeData, IsDir >::AddUndirNode | ( | int | NId, |
const int & | Deg, | ||
const TNodeDat & | NodeDat | ||
) |
int TBigNet< TNodeData, IsDir >::AddUndirNode | ( | int | NId, |
const TIntV & | EdgeNIdV | ||
) |
int TBigNet< TNodeData, IsDir >::AddUndirNode | ( | int | NId, |
const TIntV & | EdgeNIdV, | ||
const TNodeDat & | NodeDat | ||
) |
|
staticprotected |
|
staticprotected |
|
inline |
Definition at line 204 of file bignet.h.
void TBigNet< TNodeData, IsDir >::CompactEdgePool | ( | ) |
Definition at line 532 of file bignet.h.
|
inline |
int TBigNet< TNodeData, IsDir >::DelNode | ( | int | NId | ) |
void TBigNet< TNodeData, IsDir >::Dump | ( | const TStr & | Desc = TStr() | ) | const |
void TBigNet< TNodeData, IsDir >::DumpFlags | ( | ) | const |
Definition at line 310 of file bignet.h.
|
inline |
Definition at line 518 of file bignet.h.
|
inline |
TEdgeI TBigNet< TNodeData, IsDir >::GetEI | ( | const int & | EId | ) | const |
void TBigNet< TNodeData, IsDir >::GetInNIdV | ( | int | NId, |
TIntV & | OutNIdV | ||
) | const |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
PNGraph TBigNet< TNodeData, IsDir >::GetNGraph | ( | const bool & | RenumberNodes = false | ) | const |
Definition at line 766 of file bignet.h.
|
inline |
void TBigNet< TNodeData, IsDir >::GetNIdV | ( | TIntV & | NIdV | ) | const |
|
inlineprotected |
|
inlineprotected |
|
inline |
void TBigNet< TNodeData, IsDir >::GetOutNIdV | ( | int | NId, |
TIntV & | OutNIdV | ||
) | const |
|
inlineprotected |
|
inline |
|
inline |
Definition at line 199 of file bignet.h.
TPt< TBigNet< TNodeData, IsDir > > TBigNet< TNodeData, IsDir >::GetSubGraph | ( | const TIntV & | NIdV, |
const bool & | RenumberNodes = false |
||
) | const |
Definition at line 806 of file bignet.h.
void TBigNet< TNodeData, IsDir >::GetSubGraph | ( | const TIntV & | NIdV, |
TBigNet< TNodeData, IsDir > * | NewNet, | ||
const bool & | RenumberNodes = false |
||
) | const |
PNGraph TBigNet< TNodeData, IsDir >::GetSubNGraph | ( | const TIntV & | NIdV | ) | const |
Definition at line 777 of file bignet.h.
|
inline |
Definition at line 146 of file bignet.h.
void TBigNet< TNodeData, IsDir >::InvertFromSources | ( | uint | ExpectNodes = 0 | ) |
Definition at line 604 of file bignet.h.
bool TBigNet< TNodeData, IsDir >::IsEdge | ( | const int & | SrcNId, |
const int & | DstNId, | ||
const bool & | Dir = true |
||
) | const |
Definition at line 553 of file bignet.h.
bool TBigNet< TNodeData, IsDir >::IsIsoNode | ( | const int & | NId | ) | const |
Definition at line 508 of file bignet.h.
|
inlineprotected |
|
inline |
bool TBigNet< TNodeData, IsDir >::IsOk | ( | ) | const |
Definition at line 954 of file bignet.h.
int TBigNet< TNodeData, IsDir >::IsolateNode | ( | int | NId | ) |
Definition at line 454 of file bignet.h.
|
inlinestatic |
Definition at line 141 of file bignet.h.
|
static |
Definition at line 1077 of file bignet.h.
|
inlinestatic |
Definition at line 139 of file bignet.h.
|
inline |
|
inline |
void TBigNet< TNodeData, IsDir >::Reserve | ( | const int & | Nodes, |
const TSize & | Edges | ||
) |
void TBigNet< TNodeData, IsDir >::Rewire | ( | TRnd & | Rnd = TInt::Rnd | ) |
Definition at line 668 of file bignet.h.
|
virtual |
void TBigNet< TNodeData, IsDir >::SaveForDisk | ( | const TStr & | OutFNm | ) | const |
|
static |
Definition at line 1097 of file bignet.h.
void TBigNet< TNodeData, IsDir >::SetInNIdV | ( | int | NId, |
const TIntV & | InNIdV | ||
) |
void TBigNet< TNodeData, IsDir >::SetOutNIdV | ( | int | NId, |
const TIntV & | OutNIdV | ||
) |
void TBigNet< TNodeData, IsDir >::SortEdgeV | ( | ) |