SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TGUtil Class Reference

Graph Utilities. More...

#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)
 

Detailed Description

Graph Utilities.

Definition at line 3 of file util.h.

Member Function Documentation

void TGUtil::GetCCdf ( const TIntPrV PdfV,
TIntPrV CCdfV 
)
static

Definition at line 33 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

Referenced by GetCCdf(), TSnap::PlotInDegDistr(), and TSnap::PlotOutDegDistr().

33  {
34  CCdfV = PdfV;
35  for (int i = CCdfV.Len()-2; i >= 0; i--) {
36  CCdfV[i].Val2 = CCdfV[i+1].Val2 + CCdfV[i].Val2; }
37 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

Here is the caller graph for this function:

void TGUtil::GetCCdf ( const TFltPrV PdfV,
TFltPrV CCdfV 
)
static

Definition at line 39 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

39  {
40  CCdfV = PdfV;
41  for (int i = CCdfV.Len()-2; i >= 0; i--) {
42  CCdfV[i].Val2 = CCdfV[i+1].Val2 + CCdfV[i].Val2; }
43 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

void TGUtil::GetCCdf ( const TIntFltKdV PdfV,
TIntFltKdV CCdfV 
)
static

Definition at line 45 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

45  {
46  CCdfV = PdfV;
47  for (int i = CCdfV.Len()-2; i >= 0; i--) {
48  CCdfV[i].Dat = CCdfV[i+1].Dat + CCdfV[i].Dat; }
49 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

TIntPrV TGUtil::GetCCdf ( const TIntPrV PdfV)
static

Definition at line 51 of file util.cpp.

References GetCCdf().

51  {
52  TIntPrV CCdfV;
53  GetCCdf(PdfV, CCdfV);
54  return CCdfV;
55 }
static void GetCCdf(const TIntPrV &PdfV, TIntPrV &CCdfV)
Definition: util.cpp:33

Here is the call graph for this function:

TFltPrV TGUtil::GetCCdf ( const TFltPrV PdfV)
static

Definition at line 57 of file util.cpp.

References GetCCdf().

57  {
58  TFltPrV CCdfV;
59  GetCCdf(PdfV, CCdfV);
60  return CCdfV;
61 }
static void GetCCdf(const TIntPrV &PdfV, TIntPrV &CCdfV)
Definition: util.cpp:33
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:430

Here is the call graph for this function:

void TGUtil::GetCdf ( const TIntPrV PdfV,
TIntPrV CdfV 
)
static

Definition at line 3 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

Referenced by TSnap::TSnapDetail::CalcEffDiamPdf(), and GetCdf().

3  {
4  CdfV = PdfV;
5  for (int i = 1; i < CdfV.Len(); i++) {
6  CdfV[i].Val2 = CdfV[i-1].Val2 + CdfV[i].Val2; }
7 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

Here is the caller graph for this function:

void TGUtil::GetCdf ( const TFltPrV PdfV,
TFltPrV CdfV 
)
static

Definition at line 9 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

9  {
10  CdfV = PdfV;
11  for (int i = 1; i < CdfV.Len(); i++) {
12  CdfV[i].Val2 = CdfV[i-1].Val2 + CdfV[i].Val2; }
13 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

void TGUtil::GetCdf ( const TIntFltKdV PdfV,
TIntFltKdV CdfV 
)
static

Definition at line 15 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

15  {
16  CdfV = PdfV;
17  for (int i = 1; i < CdfV.Len(); i++) {
18  CdfV[i].Dat = CdfV[i-1].Dat + CdfV[i].Dat; }
19 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

TIntPrV TGUtil::GetCdf ( const TIntPrV PdfV)
static

Definition at line 21 of file util.cpp.

References GetCdf().

21  {
22  TIntPrV CdfV;
23  GetCdf(PdfV, CdfV);
24  return CdfV;
25 }
static void GetCdf(const TIntPrV &PdfV, TIntPrV &CdfV)
Definition: util.cpp:3

Here is the call graph for this function:

TFltPrV TGUtil::GetCdf ( const TFltPrV PdfV)
static

Definition at line 27 of file util.cpp.

References GetCdf().

27  {
28  TFltPrV CdfV;
29  GetCdf(PdfV, CdfV);
30  return CdfV;
31 }
static void GetCdf(const TIntPrV &PdfV, TIntPrV &CdfV)
Definition: util.cpp:3
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:430

Here is the call graph for this function:

void TGUtil::GetPdf ( const TIntPrV CdfV,
TIntPrV PdfV 
)
static

Definition at line 63 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

63  {
64  PdfV = CdfV;
65  for (int i = PdfV.Len()-1; i > 0; i--) {
66  PdfV[i].Val2 = PdfV[i].Val2 - PdfV[i-1].Val2; }
67 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

void TGUtil::GetPdf ( const TFltPrV CdfV,
TFltPrV PdfV 
)
static

Definition at line 69 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

69  {
70  PdfV = CdfV;
71  for (int i = PdfV.Len()-1; i > 0; i--) {
72  PdfV[i].Val2 = PdfV[i].Val2 - PdfV[i-1].Val2; }
73 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

void TGUtil::GetPdf ( const TIntFltKdV CdfV,
TIntFltKdV PdfV 
)
static

Definition at line 75 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

75  {
76  PdfV = CdfV;
77  for (int i = PdfV.Len()-1; i > 0; i--) {
78  PdfV[i].Dat = PdfV[i].Dat - PdfV[i-1].Dat; }
79 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

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.

References TGnuPlot::MakeExpBins().

Referenced by TSnap::PlotSngVec().

99  {
100  TGnuPlot::MakeExpBins(XYValV, ExpXYValV, BinFactor, MinYVal);
101 }
static void MakeExpBins(const TFltPrV &XYValV, TFltPrV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1)
Definition: gnuplot.cpp:614

Here is the call graph for this function:

Here is the caller graph for this function:

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 TGnuPlot::MakeExpBins().

103  {
104  TGnuPlot::MakeExpBins(XYValV, ExpXYValV, BinFactor, MinYVal);
105 }
static void MakeExpBins(const TFltPrV &XYValV, TFltPrV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1)
Definition: gnuplot.cpp:614

Here is the call graph for this function:

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, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), and TVec< TVal, TSizeTy >::Len().

107  {
108  ExpYValV.Clr(true);
109  int prevI=0;
110  for (int i = 0; i < YValV.Len(); ) {
111  ExpYValV.Add(YValV[i]);
112  i = int(i*BinFactor);
113  if (i==prevI) { i++; }
114  prevI = i;
115  }
116 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

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, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), and TVec< TVal, TSizeTy >::Len().

118  {
119  ExpYValV.Clr(true);
120  int prevI=0;
121  for (int i = 0; i < YValV.Len(); ) {
122  ExpYValV.Add(YValV[i]);
123  i = int(i*BinFactor);
124  if (i==prevI) { i++; }
125  prevI = i;
126  }
127 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

void TGUtil::Normalize ( TFltPrV PdfV)
static

Definition at line 81 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

81  {
82  double Sum = 0.0;
83  for (int i = 0; i < PdfV.Len(); i++) {
84  Sum += PdfV[i].Val2; }
85  if (Sum <= 0.0) { return; }
86  for (int i = 0; i < PdfV.Len(); i++) {
87  PdfV[i].Val2 /= Sum; }
88 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:

void TGUtil::Normalize ( TIntFltKdV PdfV)
static

Definition at line 90 of file util.cpp.

References TVec< TVal, TSizeTy >::Len().

90  {
91  double Sum = 0.0;
92  for (int i = 0; i < PdfV.Len(); i++) {
93  Sum += PdfV[i].Dat; }
94  if (Sum <= 0.0) { return; }
95  for (int i = 0; i < PdfV.Len(); i++) {
96  PdfV[i].Dat /= Sum; }
97 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575

Here is the call graph for this function:


The documentation for this class was generated from the following files: