|
SNAP Library 2.1, User Reference
2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <ncp.h>
Public Member Functions | |
| TCutInfo () | |
| TCutInfo (const int &ClustNodes, const int &EdgesInside, const int &CutSize) | |
| TCutInfo (const int &ClustNodes, const int &EdgesInside, const int &CutSize, const TIntV &NIdV) | |
| TCutInfo (const PUNGraph &G, const TIntV &ClustNIdV, bool TakeNIdV=false) | |
| TCutInfo (const TCutInfo &CS) | |
| int | GetNodes () const |
| int | GetEdges () const |
| int | GetVol () const |
| int | GetCutSz () const |
| double | GetPhi () const |
| double | GetExpansion () const |
| double | GetIntDens () const |
| double | GetCutRatio (const int &GNodes) const |
| double | GetNormCut (const int &GEdges) const |
| double | GetFracDegOut (const PUNGraph &Graph, double &MxFrac, double &AvgFrac, double &MedianFrac, double &Pct9Frac, double &Flake) const |
| double | GetModular (const int &GEdges) const |
| double | GetModRat (const int &GEdges) const |
| double | GetExpEdgesIn (const int &GEdges) const |
| bool | operator< (const TCutInfo &CS) const |
Public Attributes | |
| TInt | Nodes |
| TInt | Edges |
| TInt | CutSz |
| TIntV | CutNIdV |
| TLocClustStat::TCutInfo::TCutInfo | ( | ) | [inline] |
| TLocClustStat::TCutInfo::TCutInfo | ( | const int & | ClustNodes, |
| const int & | EdgesInside, | ||
| const int & | CutSize | ||
| ) | [inline] |
| TLocClustStat::TCutInfo::TCutInfo | ( | const int & | ClustNodes, |
| const int & | EdgesInside, | ||
| const int & | CutSize, | ||
| const TIntV & | NIdV | ||
| ) | [inline] |
| TLocClustStat::TCutInfo::TCutInfo | ( | const PUNGraph & | G, |
| const TIntV & | ClustNIdV, | ||
| bool | TakeNIdV = false |
||
| ) | [inline] |
| TLocClustStat::TCutInfo::TCutInfo | ( | const TCutInfo & | CS | ) | [inline] |
| double TLocClustStat::TCutInfo::GetCutRatio | ( | const int & | GNodes | ) | const [inline] |
| int TLocClustStat::TCutInfo::GetCutSz | ( | ) | const [inline] |
| int TLocClustStat::TCutInfo::GetEdges | ( | ) | const [inline] |
| double TLocClustStat::TCutInfo::GetExpansion | ( | ) | const [inline] |
| double TLocClustStat::TCutInfo::GetExpEdgesIn | ( | const int & | GEdges | ) | const [inline] |
Definition at line 172 of file ncp.h.
{ return TMath::Sqr(2.0*Edges+CutSz)/(2.0*GEdges); } // expected edges inside (sum of degrees on nodes inside)^2/(2*E)
| double TLocClustStat::TCutInfo::GetFracDegOut | ( | const PUNGraph & | Graph, |
| double & | MxFrac, | ||
| double & | AvgFrac, | ||
| double & | MedianFrac, | ||
| double & | Pct9Frac, | ||
| double & | Flake | ||
| ) | const |
Definition at line 245 of file ncp.cpp.
{
if (CutNIdV.Empty()) {
IAssert(Nodes<100 || ! CutNIdV.Empty());
MxFrac=1; AvgFrac=1; MedianFrac=1; Pct9Frac=1; Flake=1;
return 1;
}
TMom FracDegMom;
TIntSet InNIdSet(CutNIdV.Len());
int NHalfIn=0;
for (int i = 0; i < CutNIdV.Len(); i++) {
InNIdSet.AddKey(CutNIdV[i]); }
for (int n = 0; n < CutNIdV.Len(); n++) {
const TUNGraph::TNodeI NI = Graph->GetNI(CutNIdV[n]);
int EdgesOut = 0;
for (int i = 0; i < NI.GetDeg(); i++) {
if (! InNIdSet.IsKey(NI.GetNbrNId(i))) { EdgesOut++; }
}
const double FracOut = EdgesOut/double(NI.GetDeg());
if (FracOut <= 0.5) { NHalfIn++; }
FracDegMom.Add(FracOut);
}
FracDegMom.Def();
MxFrac = FracDegMom.GetMx();
AvgFrac = FracDegMom.GetMean();
MedianFrac = FracDegMom.GetMedian();
Pct9Frac = FracDegMom.GetDecile(9);
Flake = 1.0 - double(NHalfIn)/double(CutNIdV.Len());
return MxFrac;
}
| double TLocClustStat::TCutInfo::GetIntDens | ( | ) | const [inline] |
| double TLocClustStat::TCutInfo::GetModRat | ( | const int & | GEdges | ) | const [inline] |
Definition at line 171 of file ncp.h.
{ return (2.0*Edges) / GetExpEdgesIn(GEdges); } // modularity ratio
| double TLocClustStat::TCutInfo::GetModular | ( | const int & | GEdges | ) | const [inline] |
Definition at line 170 of file ncp.h.
{ return (2.0*Edges - GetExpEdgesIn(GEdges)) / (2.0*GEdges); } // modularity
| int TLocClustStat::TCutInfo::GetNodes | ( | ) | const [inline] |
| double TLocClustStat::TCutInfo::GetNormCut | ( | const int & | GEdges | ) | const [inline] |
| double TLocClustStat::TCutInfo::GetPhi | ( | ) | const [inline] |
| int TLocClustStat::TCutInfo::GetVol | ( | ) | const [inline] |
| bool TLocClustStat::TCutInfo::operator< | ( | const TCutInfo & | CS | ) | const [inline] |