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
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.

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
void TGUtil::GetCCdf ( const TFltPrV PdfV,
TFltPrV CCdfV 
)
static

Definition at line 39 of file util.cpp.

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
void TGUtil::GetCCdf ( const TIntFltKdV PdfV,
TIntFltKdV CCdfV 
)
static

Definition at line 45 of file util.cpp.

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
TIntPrV TGUtil::GetCCdf ( const TIntPrV PdfV)
static

Definition at line 51 of file util.cpp.

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

Definition at line 57 of file util.cpp.

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
void TGUtil::GetCdf ( const TIntPrV PdfV,
TIntPrV CdfV 
)
static

Definition at line 3 of file util.cpp.

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
void TGUtil::GetCdf ( const TFltPrV PdfV,
TFltPrV CdfV 
)
static

Definition at line 9 of file util.cpp.

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
void TGUtil::GetCdf ( const TIntFltKdV PdfV,
TIntFltKdV CdfV 
)
static

Definition at line 15 of file util.cpp.

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
TIntPrV TGUtil::GetCdf ( const TIntPrV PdfV)
static

Definition at line 21 of file util.cpp.

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

Definition at line 27 of file util.cpp.

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
void TGUtil::GetPdf ( const TIntPrV CdfV,
TIntPrV PdfV 
)
static

Definition at line 63 of file util.cpp.

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
void TGUtil::GetPdf ( const TFltPrV CdfV,
TFltPrV PdfV 
)
static

Definition at line 69 of file util.cpp.

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
void TGUtil::GetPdf ( const TIntFltKdV CdfV,
TIntFltKdV PdfV 
)
static

Definition at line 75 of file util.cpp.

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
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.

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
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.

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
void TGUtil::MakeExpBins ( const TFltV YValV,
TFltV ExpYValV,
const double &  BinFactor = 1.01 
)
static

Definition at line 107 of file util.cpp.

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
void TGUtil::MakeExpBins ( const TIntV YValV,
TIntV ExpYValV,
const double &  BinFactor = 1.01 
)
static

Definition at line 118 of file util.cpp.

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
void TGUtil::Normalize ( TFltPrV PdfV)
static

Definition at line 81 of file util.cpp.

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
void TGUtil::Normalize ( TIntFltKdV PdfV)
static

Definition at line 90 of file util.cpp.

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

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