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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TGUtil Class Reference

Graph Utilities. More...

#include <util.h>

List of all members.

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.

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

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

                                                              {
  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]

Definition at line 51 of file util.cpp.

                                           {
  TIntPrV CCdfV;
  GetCCdf(PdfV, CCdfV);
  return CCdfV;
}
TFltPrV TGUtil::GetCCdf ( const TFltPrV PdfV) [static]

Definition at line 57 of file util.cpp.

                                           {
  TFltPrV CCdfV;
  GetCCdf(PdfV, CCdfV);
  return CCdfV;
}
void TGUtil::GetCdf ( const TIntPrV PdfV,
TIntPrV CdfV 
) [static]

Definition at line 3 of file util.cpp.

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

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

                                                            {
  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]

Definition at line 21 of file util.cpp.

                                          {
  TIntPrV CdfV;
  GetCdf(PdfV, CdfV);
  return CdfV;
}
TFltPrV TGUtil::GetCdf ( const TFltPrV PdfV) [static]

Definition at line 27 of file util.cpp.

                                          {
  TFltPrV CdfV;
  GetCdf(PdfV, CdfV);
  return CdfV;
}
void TGUtil::GetPdf ( const TIntPrV CdfV,
TIntPrV PdfV 
) [static]

Definition at line 63 of file util.cpp.

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

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

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

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

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

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

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

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

                                       {
  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; }
}

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