9 if (DescStr.
Empty()) { DescStr = FNmPref; }
15 const int NBuckets = 50;
17 for (
int f = 1; EigValV.
Empty() && f < 4; f++) {
22 double Step = (EigValV.
Last()-EigValV[0]) /
double(NBuckets-1);
23 for (
int i = 0; i < NBuckets; i++) {
24 BucketCntH.
AddDat(EigValV[0]+Step*(i+0.5), 0);
26 for (
int i = 0; i < EigValV.
Len(); i++) {
27 const int Bucket = (int) floor((EigValV[i]-EigValV[0]) / Step);
28 BucketCntH[Bucket] += 1;
32 if (DescStr.
Empty()) { DescStr = FNmPref; }
42 if (DescStr.
Empty()) { DescStr = FNmPref; }
43 if (EigIprV.
Empty()) { DescStr+=
". FAIL"; EigIprV.
Add(
TFltPr(-1,-1));
return; }
45 DescStr.
CStr(), Graph->GetNodes(), Graph->GetEdges(), EigIprV.
Last().Val1(), EigIprV.
Len()),
46 "Eigenvalue",
"Inverse Participation Ratio of corresponding Eigenvector",
gpsLog10Y,
false,
gpwPoints);
53 if (DescStr.
Empty()) { DescStr = FNmPref; }
59 const int NBuckets = 50;
61 for (
int f = 1; SngValV.
Empty() && f < 4; f++) {
66 double Step = (SngValV.
Last()-SngValV[0]) /
double(NBuckets-1);
67 for (
int i = 0; i < NBuckets; i++) {
68 BucketCntH.
AddDat(SngValV[0]+Step*(i+0.5), 0);
70 for (
int i = 0; i < SngValV.
Len(); i++) {
71 const int Bucket = (int) floor((SngValV[i]-SngValV[0]) / Step);
72 BucketCntH[Bucket] += 1;
76 if (DescStr.
Empty()) { DescStr = FNmPref; }
82 TFltV LeftSV, RightSV;
87 if (DescStr.
Empty()) { DescStr = FNmPref; }
void GetEigVals(const PUNGraph &Graph, const int &EigVals, TFltV &EigValV)
Computes top EigVals eigenvalues of the adjacency matrix representing a given undirected Graph...
void GetInvParticipRat(const PUNGraph &Graph, int MaxEigVecs, int TimeLimit, TFltPrV &EigValIprV)
int GetEdges() const
Returns the number of edges in the graph.
TSizeTy Len() const
Returns the number of elements in the vector.
int GetNodes() const
Returns the number of nodes in the graph.
void PlotSngValRank(const PNGraph &Graph, const int &SngVals, const TStr &FNmPref, TStr DescStr)
Plots the rank distribution of singular values of the Graph adjacency matrix. Plots first SngVals val...
static void MakeExpBins(const TFltPrV &XYValV, TFltPrV &ExpXYValV, const double &BinFactor=2, const double &MinYVal=1)
void PlotEigValRank(const PUNGraph &Graph, const int &EigVals, const TStr &FNmPref, TStr DescStr)
Plots the eigen-value rank distribution of the Graph adjacency matrix. Plots first EigVals eigenvalue...
void PlotEigValDistr(const PUNGraph &Graph, const int &EigVals, const TStr &FNmPref, TStr DescStr)
Plots the distribution of components of the leading eigen-vector of the Graph adjacency matrix...
void PlotInvParticipRat(const PUNGraph &Graph, const int &MaxEigVecs, const int &TimeLimit, const TStr &FNmPref, TStr DescStr)
bool Empty() const
Tests whether the vector is empty.
void GetSngVec(const PNGraph &Graph, TFltV &LeftSV, TFltV &RightSV)
Computes the leading left and right singular vector of the adjacency matrix representing a directed G...
void Sort(const bool &Asc=true)
Sorts the elements of the vector.
const TVal & Last() const
Returns a reference to the last element of the vector.
void PlotSngValDistr(const PNGraph &Graph, const int &SngVals, const TStr &FNmPref, TStr DescStr)
Plots the rank distribution of singular values of the Graph adjacency matrix. Plots first SngVals val...
TPair< TFlt, TFlt > TFltPr
void PlotSngVec(const PNGraph &Graph, const TStr &FNmPref, TStr DescStr)
Plots the distribution of the values of the leading left singular vector of the Graph adjacency matri...
void GetSngVals(const PNGraph &Graph, const int &SngVals, TFltV &SngValV)
Computes largest SngVals singular values of the adjacency matrix representing a directed Graph...
static void PlotValV(const TVec< TPair< TVal1, TVal2 > > &ValV, const TStr &OutFNmPref, const TStr &Desc="", const TStr &XLabel="", const TStr &YLabel="", const TGpScaleTy &ScaleTy=gpsAuto, const bool &PowerFit=false, const TGpSeriesTy &SeriesTy=gpwLinesPoints)
static TStr Fmt(const char *FmtStr,...)
void GetKeyDatPrV(TVec< TPair< TKey, TDat > > &KeyDatPrV) const
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
TDat & AddDat(const TKey &Key)
Vector is a sequence TVal objects representing an array that can change in size.