SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <util.h>
Static Public Member Functions | |
static void | GetCdf (const TIntPrV &PdfV, TIntPrV &CdfV) |
static void | GetCdf (const TFltPrV &PdfV, TFltPrV &CdfV) |
static void | GetCdf (const TIntFltKdV &PdfV, TIntFltKdV &CdfV) |
static TIntPrV | GetCdf (const TIntPrV &PdfV) |
static TFltPrV | GetCdf (const TFltPrV &PdfV) |
static void | GetCCdf (const TIntPrV &PdfV, TIntPrV &CCdfV) |
static void | GetCCdf (const TFltPrV &PdfV, TFltPrV &CCdfV) |
static void | GetCCdf (const TIntFltKdV &PdfV, TIntFltKdV &CCdfV) |
static TIntPrV | GetCCdf (const TIntPrV &PdfV) |
static TFltPrV | GetCCdf (const TFltPrV &PdfV) |
static void | GetPdf (const TIntPrV &CdfV, TIntPrV &PdfV) |
static void | GetPdf (const TFltPrV &CdfV, TFltPrV &PdfV) |
static void | GetPdf (const TIntFltKdV &CdfV, TIntFltKdV &PdfV) |
static void | Normalize (TFltPrV &PdfV) |
static void | Normalize (TIntFltKdV &PdfV) |
static void | MakeExpBins (const TFltPrV &XYValV, TFltPrV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1) |
static void | MakeExpBins (const TFltKdV &XYValV, TFltKdV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1) |
static void | MakeExpBins (const TFltV &YValV, TFltV &ExpYValV, const double &BinFactor=1.01) |
static void | MakeExpBins (const TIntV &YValV, TIntV &ExpYValV, const double &BinFactor=1.01) |
void TGUtil::GetCCdf | ( | const TIntPrV & | PdfV, |
TIntPrV & | CCdfV | ||
) | [static] |
Definition at line 33 of file util.cpp.
References TVec< TVal >::Len().
Referenced by GetCCdf(), TSnap::PlotInDegDistr(), and TSnap::PlotOutDegDistr().
{ CCdfV = PdfV; for (int i = CCdfV.Len()-2; i >= 0; i--) { CCdfV[i].Val2 = CCdfV[i+1].Val2 + CCdfV[i].Val2; } }
void TGUtil::GetCCdf | ( | const TFltPrV & | PdfV, |
TFltPrV & | CCdfV | ||
) | [static] |
Definition at line 39 of file util.cpp.
References TVec< TVal >::Len().
{ CCdfV = PdfV; for (int i = CCdfV.Len()-2; i >= 0; i--) { CCdfV[i].Val2 = CCdfV[i+1].Val2 + CCdfV[i].Val2; } }
void TGUtil::GetCCdf | ( | const TIntFltKdV & | PdfV, |
TIntFltKdV & | CCdfV | ||
) | [static] |
Definition at line 45 of file util.cpp.
References TVec< TVal >::Len().
{ CCdfV = PdfV; for (int i = CCdfV.Len()-2; i >= 0; i--) { CCdfV[i].Dat = CCdfV[i+1].Dat + CCdfV[i].Dat; } }
TIntPrV TGUtil::GetCCdf | ( | const TIntPrV & | PdfV | ) | [static] |
TFltPrV TGUtil::GetCCdf | ( | const TFltPrV & | PdfV | ) | [static] |
void TGUtil::GetCdf | ( | const TIntPrV & | PdfV, |
TIntPrV & | CdfV | ||
) | [static] |
Definition at line 3 of file util.cpp.
References TVec< TVal >::Len().
Referenced by TSnap::TSnapDetail::CalcEffDiamPdf(), and GetCdf().
{ CdfV = PdfV; for (int i = 1; i < CdfV.Len(); i++) { CdfV[i].Val2 = CdfV[i-1].Val2 + CdfV[i].Val2; } }
void TGUtil::GetCdf | ( | const TFltPrV & | PdfV, |
TFltPrV & | CdfV | ||
) | [static] |
Definition at line 9 of file util.cpp.
References TVec< TVal >::Len().
{ CdfV = PdfV; for (int i = 1; i < CdfV.Len(); i++) { CdfV[i].Val2 = CdfV[i-1].Val2 + CdfV[i].Val2; } }
void TGUtil::GetCdf | ( | const TIntFltKdV & | PdfV, |
TIntFltKdV & | CdfV | ||
) | [static] |
Definition at line 15 of file util.cpp.
References TVec< TVal >::Len().
{ CdfV = PdfV; for (int i = 1; i < CdfV.Len(); i++) { CdfV[i].Dat = CdfV[i-1].Dat + CdfV[i].Dat; } }
TIntPrV TGUtil::GetCdf | ( | const TIntPrV & | PdfV | ) | [static] |
TFltPrV TGUtil::GetCdf | ( | const TFltPrV & | PdfV | ) | [static] |
void TGUtil::GetPdf | ( | const TIntPrV & | CdfV, |
TIntPrV & | PdfV | ||
) | [static] |
Definition at line 63 of file util.cpp.
References TVec< TVal >::Len().
{ PdfV = CdfV; for (int i = PdfV.Len()-1; i > 0; i--) { PdfV[i].Val2 = PdfV[i].Val2 - PdfV[i-1].Val2; } }
void TGUtil::GetPdf | ( | const TFltPrV & | CdfV, |
TFltPrV & | PdfV | ||
) | [static] |
Definition at line 69 of file util.cpp.
References TVec< TVal >::Len().
{ PdfV = CdfV; for (int i = PdfV.Len()-1; i > 0; i--) { PdfV[i].Val2 = PdfV[i].Val2 - PdfV[i-1].Val2; } }
void TGUtil::GetPdf | ( | const TIntFltKdV & | CdfV, |
TIntFltKdV & | PdfV | ||
) | [static] |
Definition at line 75 of file util.cpp.
References TVec< TVal >::Len().
{ PdfV = CdfV; for (int i = PdfV.Len()-1; i > 0; i--) { PdfV[i].Dat = PdfV[i].Dat - PdfV[i-1].Dat; } }
void TGUtil::MakeExpBins | ( | const TFltPrV & | XYValV, |
TFltPrV & | ExpXYValV, | ||
const double & | BinFactor = 2 , |
||
const double & | MinYVal = 1 |
||
) | [static] |
Definition at line 99 of file util.cpp.
Referenced by MakeExpBins(), and TSnap::PlotSngVec().
{ TGnuPlot::MakeExpBins(XYValV, ExpXYValV, BinFactor, MinYVal); }
void TGUtil::MakeExpBins | ( | const TFltKdV & | XYValV, |
TFltKdV & | ExpXYValV, | ||
const double & | BinFactor = 2 , |
||
const double & | MinYVal = 1 |
||
) | [static] |
Definition at line 103 of file util.cpp.
References MakeExpBins().
{ TGnuPlot::MakeExpBins(XYValV, ExpXYValV, BinFactor, MinYVal); }
void TGUtil::MakeExpBins | ( | const TFltV & | YValV, |
TFltV & | ExpYValV, | ||
const double & | BinFactor = 1.01 |
||
) | [static] |
Definition at line 107 of file util.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), and TVec< TVal >::Len().
{ ExpYValV.Clr(true); int prevI=0; for (int i = 0; i < YValV.Len(); ) { ExpYValV.Add(YValV[i]); i = int(i*BinFactor); if (i==prevI) { i++; } prevI = i; } }
void TGUtil::MakeExpBins | ( | const TIntV & | YValV, |
TIntV & | ExpYValV, | ||
const double & | BinFactor = 1.01 |
||
) | [static] |
Definition at line 118 of file util.cpp.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), and TVec< TVal >::Len().
{ ExpYValV.Clr(true); int prevI=0; for (int i = 0; i < YValV.Len(); ) { ExpYValV.Add(YValV[i]); i = int(i*BinFactor); if (i==prevI) { i++; } prevI = i; } }
void TGUtil::Normalize | ( | TFltPrV & | PdfV | ) | [static] |
Definition at line 81 of file util.cpp.
References TVec< TVal >::Len().
{ double Sum = 0.0; for (int i = 0; i < PdfV.Len(); i++) { Sum += PdfV[i].Val2; } if (Sum <= 0.0) { return; } for (int i = 0; i < PdfV.Len(); i++) { PdfV[i].Val2 /= Sum; } }
void TGUtil::Normalize | ( | TIntFltKdV & | PdfV | ) | [static] |
Definition at line 90 of file util.cpp.
References TVec< TVal >::Len().
{ double Sum = 0.0; for (int i = 0; i < PdfV.Len(); i++) { Sum += PdfV[i].Dat; } if (Sum <= 0.0) { return; } for (int i = 0; i < PdfV.Len(); i++) { PdfV[i].Dat /= Sum; } }