#include <graphcounter.h>
|
static bool | IsEdge (const PNGraph &G, int SrcNId, int DstNId) |
|
static void | GetEdges (uint64 graphId, int nodes, TVec< TPair< int, int > > &edges) |
|
static void | GetNormalizedGraph (const PNGraph &G, PNGraph &nG) |
|
static void | GetIndGraph (const PNGraph &G, const TIntV &sg, PNGraph &indG) |
|
static void | GetGraph (uint64 graphId, int nodes, PNGraph &G) |
|
static void | GetIsoGraphs (uint64 graphId, int nodes, TVec< PNGraph > &isoG) |
|
static void | GetIsoGraphs (const PNGraph &G, TVec< PNGraph > &isoG) |
|
static uint64 | GraphId (const PNGraph &G) |
|
static uint64 | GraphId (const PNGraph &G, const TIntV &sg) |
|
static uint64 | GetMinAndGraphIds (const TVec< PNGraph > &isoG, TVec< uint64 > &graphIds) |
|
Definition at line 79 of file graphcounter.h.
void TGraphEnumUtils::GetEdges |
( |
uint64 |
graphId, |
|
|
int |
nodes, |
|
|
TVec< TPair< int, int > > & |
edges |
|
) |
| |
|
static |
Definition at line 190 of file graphcounter.cpp.
191 for(
int row=0; row<nodes; row++) {
192 for(
int col=0; col<nodes; col++) {
193 int n = row*nodes+col;
195 uint64 bits = graphId >> n;
unsigned long long uint64
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
void TGraphEnumUtils::GetGraph |
( |
uint64 |
graphId, |
|
|
int |
nodes, |
|
|
PNGraph & |
G |
|
) |
| |
|
static |
Definition at line 269 of file graphcounter.cpp.
272 for(
int i=0; i<nodes; i++) G->AddNode(i);
274 for(
int row=0; row<nodes; row++) {
275 for(
int col=0; col<nodes; col++) {
276 int n = row*nodes+col;
278 uint64 bits = graphId >> n;
280 if((bits & mask)==1) G->AddEdge(row, col);
unsigned long long uint64
Definition at line 251 of file graphcounter.cpp.
253 for(
int i=0; i<sg.
Len(); i++) indG->AddNode(sg[i]);
255 for(
int i=0; i<sg.
Len(); i++) {
260 for(
int j=0; j<deg; j++) {
262 if(nId == dstId)
continue;
264 if(indG->IsNode(dstId)) indG->AddEdge(nId, dstId);
int GetNbrNId(const int &NodeN) const
Returns ID of NodeN-th neighboring node.
TSizeTy Len() const
Returns the number of elements in the vector.
int GetOutDeg() const
Returns out-degree of the current node.
Node iterator. Only forward iteration (operator++) is supported.
void TGraphEnumUtils::GetIsoGraphs |
( |
uint64 |
graphId, |
|
|
int |
nodes, |
|
|
TVec< PNGraph > & |
isoG |
|
) |
| |
|
static |
Definition at line 202 of file graphcounter.cpp.
203 TIntV v(nodes);
for(
int i=0; i<nodes; i++) v[i]=i;
210 for(
int i=0; i<perms.
Len(); i++) {
213 for(
int j=0; j<nodes; j++) isoG[i]->AddNode(j);
215 for(
int j=0; j<edges.
Len(); j++) {
216 int srcId = edges[j].Val1;
217 int dstId = edges[j].Val2;
219 int pSrcId = perms[i][srcId];
220 int pDstId = perms[i][dstId];
222 isoG[i]->AddEdge(pSrcId, pDstId);
static PNGraph New()
Static constructor that returns a pointer to the graph. Call: PNGraph Graph = TNGraph::New().
TSizeTy Len() const
Returns the number of elements in the vector.
static void GetPermutations(TIntV &v, int start, TVec< TIntV > &perms)
static void GetEdges(uint64 graphId, int nodes, TVec< TPair< int, int > > &edges)
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition at line 227 of file graphcounter.cpp.
228 int nodes = G->GetNodes();
230 TIntV v(nodes);
for(
int i=0; i<nodes; i++) v[i]=i;
234 for(
int i=0; i<perms.
Len(); i++) {
237 for(
int j=0; j<nodes; j++) isoG[i]->AddNode(j);
240 int srcId = eIt.GetSrcNId();
241 int dstId = eIt.GetDstNId();
243 int pSrcId = perms[i][srcId];
244 int pDstId = perms[i][dstId];
246 isoG[i]->AddEdge(pSrcId, pDstId);
static PNGraph New()
Static constructor that returns a pointer to the graph. Call: PNGraph Graph = TNGraph::New().
TSizeTy Len() const
Returns the number of elements in the vector.
static void GetPermutations(TIntV &v, int start, TVec< TIntV > &perms)
Edge iterator. Only forward iteration (operator++) is supported.
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition at line 311 of file graphcounter.cpp.
315 graphIds.
Add(minGraphId);
317 for(
int i=1; i<isoG.
Len(); i++) {
319 if(minGraphId > curGraphId) minGraphId=curGraphId;
321 graphIds.
Add(curGraphId);
TSizeTy Len() const
Returns the number of elements in the vector.
unsigned long long uint64
static uint64 GraphId(const PNGraph &G)
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
void TGraphEnumUtils::GetNormalizedGraph |
( |
const PNGraph & |
G, |
|
|
PNGraph & |
nG |
|
) |
| |
|
static |
Definition at line 172 of file graphcounter.cpp.
177 for(
int i=0; i<G->GetNodes(); i++) nG->AddNode(i);
180 int srcId = eIt.GetSrcNId();
181 int dstId = eIt.GetDstNId();
183 int mSrcId = map.
GetDat(srcId);
184 int mDstId = map.
GetDat(dstId);
186 nG->AddEdge(mSrcId, mDstId);
const TDat & GetDat(const TKey &Key) const
static void GetNormalizedMap(const PNGraph &G, THash< TInt, TInt > &map)
Edge iterator. Only forward iteration (operator++) is supported.
Definition at line 147 of file graphcounter.cpp.
151 map.
AddDat(it.GetId(), nId);
Node iterator. Only forward iteration (operator++) is supported.
TDat & AddDat(const TKey &Key)
void TGraphEnumUtils::GetPermutations |
( |
TIntV & |
v, |
|
|
int |
start, |
|
|
TVec< TIntV > & |
perms |
|
) |
| |
|
staticprivate |
Definition at line 156 of file graphcounter.cpp.
158 if (start == n-1) perms.
Add(v);
160 for (
int i = start; i < n; i++) {
TSizeTy Len() const
Returns the number of elements in the vector.
static void GetPermutations(TIntV &v, int start, TVec< TIntV > &perms)
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition at line 285 of file graphcounter.cpp.
286 int nodes = G->GetNodes();
289 int srcId = it.GetSrcNId();
290 int dstId = it.GetDstNId();
static uint Pow2(const int &pow)
Edge iterator. Only forward iteration (operator++) is supported.
unsigned long long uint64
Definition at line 298 of file graphcounter.cpp.
299 int nodes = sg.
Len();
301 for(
int i=0; i<nodes; i++) {
302 for(
int j=0; j<nodes; j++) {
TSizeTy Len() const
Returns the number of elements in the vector.
static uint Pow2(const int &pow)
static bool IsEdge(const PNGraph &G, int SrcNId, int DstNId)
unsigned long long uint64
static bool TGraphEnumUtils::IsEdge |
( |
const PNGraph & |
G, |
|
|
int |
SrcNId, |
|
|
int |
DstNId |
|
) |
| |
|
inlinestatic |
Definition at line 84 of file graphcounter.h.
86 return G->IsEdge(SrcNId, DstNId,
true);
The documentation for this class was generated from the following files: