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
gbase.h File Reference

Go to the source code of this file.

Classes

struct  TSnap::IsDirected< TGraph >
 Tests (at compile time) if the graph is directed. More...
 
struct  TSnap::IsMultiGraph< TGraph >
 Tests (at compile time) if the graph is a multigraph with multiple edges between the same nodes. More...
 
struct  TSnap::IsNodeDat< TGraph >
 Tests (at compile time) if the graph is a network with data on nodes. More...
 
struct  TSnap::IsEdgeDat< TGraph >
 Tests (at compile time) if the graph is a network with data on edges. More...
 
struct  TSnap::IsSources< TGraph >
 Tests (at compile time) if the nodes store only out-edges, but not in-edges. More...
 
struct  TSnap::IsBipart< TGraph >
 Tests (at compile time) if the graph is a bipartite graph type. More...
 
class  TSnapQueue< TVal >
 Fast Queue used by the TBreathFS (uses memcpy to move objects TVal around). More...
 
class  TUnionFind
 Union Find class (Disjoint-set data structure). More...
 
class  THeap< TVal, TCmp >
 Simple heap data structure. More...
 

Namespaces

 TSnap
 Main namespace for all the Snap global entities.
 

Macros

#define Kilo(n)   (1000*(n))
 
#define Mega(n)   (1000*1000*(n))
 
#define Giga(n)   (1000*1000*1000*(n))
 
#define HasGraphFlag(TGraph, Flag)
 For quick testing of the properties of the graph/network object (see TGraphFlag). More...
 

Typedefs

typedef enum TGraphFlag_ TGraphFlag
 Graph Flags, used for quick testing of graph types. More...
 
typedef enum TAttrType_ TAttrType
 Types for tables, sparse and dense attributes. More...
 

Enumerations

enum  TGraphFlag_ {
  gfUndef =0, gfDirected, gfMultiGraph, gfNodeDat,
  gfEdgeDat, gfSources, gfBipart, gfMx
}
 Graph Flags, used for quick testing of graph types. More...
 
enum  TAttrType_ { atInt, atFlt, atStr }
 Types for tables, sparse and dense attributes. More...
 

Functions

TStr TSnap::GetFlagStr (const TGraphFlag &GraphFlag)
 Returns a string representation of a flag. More...
 
template<class PGraph >
void TSnap::PrintInfo (const PGraph &Graph, const TStr &Desc="", const TStr &OutFNm="", const bool &Fast=true)
 Prints basic graph statistics. More...
 
template<class PGraph >
int64 TSnap::GetTriads (const PGraph &Graph, int64 &ClosedTriadsX, int64 &OpenTriadsX, int SampleNodes)
 Computes the number of Closed and Open triads. More...
 
template<class PGraph >
double TSnap::GetBfsEffDiam (const PGraph &Graph, const int &NTestNodes, const bool &IsDir, double &EffDiamX, int &FullDiamX)
 Returns the (approximation of the) Effective Diameter and the Diameter of a graph (by performing BFS from NTestNodes random starting nodes). More...
 
template<class PGraph >
double TSnap::GetMxWccSz (const PGraph &Graph)
 Returns the fraction of nodes in the largest weakly connected component of a Graph. More...
 
template<class PGraph >
double TSnap::GetMxSccSz (const PGraph &Graph)
 Returns the fraction of nodes in the largest strongly connected component of a Graph. More...
 
template<class PGraph >
int TSnap::GetKCoreNodes (const PGraph &Graph, TIntPrV &CoreIdSzV)
 Returns the number of nodes in each core of order K (where K=0, 1, ...) More...
 
template<class PGraph >
int TSnap::GetKCoreEdges (const PGraph &Graph, TIntPrV &CoreIdSzV)
 Returns the number of edges in each core of order K (where K=0, 1, ...) More...
 

Macro Definition Documentation

#define Giga (   n)    (1000*1000*1000*(n))

Definition at line 5 of file gbase.h.

#define HasGraphFlag (   TGraph,
  Flag 
)
Value:
Tests (at compile time) if the graph is a network with data on nodes.
Definition: gbase.h:32
Tests (at compile time) if the graph is directed.
Definition: gbase.h:28
have explicit edges (multigraph): TNEGraph, TNodeEdgeNet
Definition: gbase.h:14
Tests (at compile time) if the graph is a network with data on edges.
Definition: gbase.h:34
network with data on edges
Definition: gbase.h:16
Tests (at compile time) if the graph is a multigraph with multiple edges between the same nodes...
Definition: gbase.h:30
directed graph (TNGraph, TNEGraph), else graph is undirected TUNGraph
Definition: gbase.h:13
nodes only store out-edges (but not in-edges). See TBigNet
Definition: gbase.h:17
Tests (at compile time) if the nodes store only out-edges, but not in-edges.
Definition: gbase.h:36
network with data on nodes
Definition: gbase.h:15
Tests (at compile time) if the graph is a bipartite graph type.
Definition: gbase.h:38
bipartite graph
Definition: gbase.h:18

For quick testing of the properties of the graph/network object (see TGraphFlag).

Definition at line 41 of file gbase.h.

#define Kilo (   n)    (1000*(n))

Definition at line 3 of file gbase.h.

#define Mega (   n)    (1000*1000*(n))

Definition at line 4 of file gbase.h.

Typedef Documentation

typedef enum TAttrType_ TAttrType

Types for tables, sparse and dense attributes.

typedef enum TGraphFlag_ TGraphFlag

Graph Flags, used for quick testing of graph types.

This is very useful for testing graph properties at compile time for partial template specialization as well as compile time assert (CAssert).

Enumeration Type Documentation

enum TAttrType_

Types for tables, sparse and dense attributes.

Enumerator
atInt 
atFlt 
atStr 

Definition at line 23 of file gbase.h.

enum TAttrType_ TAttrType
Types for tables, sparse and dense attributes.
Definition: gbase.h:23
Definition: gbase.h:23
Definition: gbase.h:23

Graph Flags, used for quick testing of graph types.

This is very useful for testing graph properties at compile time for partial template specialization as well as compile time assert (CAssert).

Enumerator
gfUndef 

default value, no flags

gfDirected 

directed graph (TNGraph, TNEGraph), else graph is undirected TUNGraph

gfMultiGraph 

have explicit edges (multigraph): TNEGraph, TNodeEdgeNet

gfNodeDat 

network with data on nodes

gfEdgeDat 

network with data on edges

gfSources 

nodes only store out-edges (but not in-edges). See TBigNet

gfBipart 

bipartite graph

gfMx 

sentinel, last value for iteration

Definition at line 11 of file gbase.h.

11  {
12  gfUndef=0,
13  gfDirected,
14  gfMultiGraph,
15  gfNodeDat,
16  gfEdgeDat,
17  gfSources,
18  gfBipart,
19  gfMx
20 } TGraphFlag;
default value, no flags
Definition: gbase.h:12
have explicit edges (multigraph): TNEGraph, TNodeEdgeNet
Definition: gbase.h:14
network with data on edges
Definition: gbase.h:16
directed graph (TNGraph, TNEGraph), else graph is undirected TUNGraph
Definition: gbase.h:13
sentinel, last value for iteration
Definition: gbase.h:19
enum TGraphFlag_ TGraphFlag
Graph Flags, used for quick testing of graph types.
nodes only store out-edges (but not in-edges). See TBigNet
Definition: gbase.h:17
network with data on nodes
Definition: gbase.h:15
bipartite graph
Definition: gbase.h:18