SNAP Library 4.0, Developer Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <cascnetinf.h>
Public Member Functions | |
TNetInfBs () | |
TNetInfBs (bool bo, bool cgt) | |
TNetInfBs (TSIn &SIn) | |
void | Save (TSOut &SOut) const |
void | LoadCascadesTxt (TSIn &SIn, const int &Model, const double &alpha) |
void | LoadGroundTruthTxt (TSIn &SIn) |
void | AddGroundTruth (PNGraph >) |
void | AddCasc (const TStr &CascStr, const int &Model=0, const double &alpha=1.0) |
void | AddCasc (const TCascade &Cascade) |
void | GenCascade (TCascade &C, const int &TModel, const double &window, TIntPrIntH &EdgesUsed, const double &delta, const double &std_waiting_time=0, const double &std_beta=0) |
TCascade & | GetCasc (int c) |
int | GetCascs () |
int | GetNodes () |
void | AddNodeNm (const int &NId, const TNodeInfo &Info) |
TStr | GetNodeNm (const int &NId) const |
TNodeInfo | GetNodeInfo (const int &NId) const |
bool | IsNodeNm (const int &NId) const |
void | Init () |
double | GetAllCascProb (const int &EdgeN1, const int &EdgeN2) |
TIntPr | GetBestEdge (double &CurProb, double &LastGain, bool &msort, int &attempts) |
double | GetBound (const TIntPr &Edge, double &CurProb) |
void | GreedyOpt (const int &MxEdges) |
void | SavePajek (const TStr &OutFNm) |
void | SavePlaneTextNet (const TStr &OutFNm) |
void | SaveEdgeInfo (const TStr &OutFNm) |
void | SaveObjInfo (const TStr &OutFNm) |
void | SaveGroundTruth (const TStr &OutFNm) |
void | SaveCascades (const TStr &OutFNm) |
Public Attributes | |
TVec< TCascade > | CascV |
THash< TInt, TNodeInfo > | NodeNmH |
THash< TIntPr, TEdgeInfo > | EdgeInfoH |
TVec< TPair< TFlt, TIntPr > > | EdgeGainV |
THash< TIntPr, TIntV > | CascPerEdge |
PNGraph | Graph |
PNGraph | GroundTruth |
bool | BoundOn |
bool | CompareGroundTruth |
TFltPrV | PrecisionRecall |
TIntPrFltH | Alphas |
TIntPrFltH | Betas |
Definition at line 82 of file cascnetinf.h.
|
inline |
|
inline |
|
inline |
Definition at line 99 of file cascnetinf.h.
void TNetInfBs::AddCasc | ( | const TStr & | CascStr, |
const int & | Model = 0 , |
||
const double & | alpha = 1.0 |
||
) |
Definition at line 98 of file cascnetinf.cpp.
References TCascade::Add(), TVec< TVal, TSizeTy >::Add(), CascV, GetNodeInfo(), TVec< TVal, TSizeTy >::Len(), TCascade::Sort(), TStr::SplitOnAllCh(), and TNodeInfo::Vol.
Referenced by LoadCascadesTxt().
|
inline |
Definition at line 108 of file cascnetinf.h.
References TVec< TVal, TSizeTy >::Add(), and CascV.
|
inline |
|
inline |
Definition at line 115 of file cascnetinf.h.
References THash< TKey, TDat, THashFunc >::AddDat(), and NodeNmH.
Referenced by LoadCascadesTxt().
void TNetInfBs::GenCascade | ( | TCascade & | C, |
const int & | TModel, | ||
const double & | window, | ||
TIntPrIntH & | EdgesUsed, | ||
const double & | delta, | ||
const double & | std_waiting_time = 0 , |
||
const double & | std_beta = 0 |
||
) |
Definition at line 113 of file cascnetinf.cpp.
References TCascade::Add(), THash< TKey, TDat, THashFunc >::AddDat(), Alphas, THash< TKey, TDat, THashFunc >::BegI(), Betas, TCascade::Clr(), THash< TKey, TDat, THashFunc >::Clr(), THash< TKey, TDat, THashFunc >::EndI(), THashKeyDatI< TKey, TDat >::GetDat(), THash< TKey, TDat, THashFunc >::GetDat(), TRnd::GetExpDev(), THashKeyDatI< TKey, TDat >::GetKey(), TFlt::GetMx(), TNGraph::GetNI(), TNGraph::GetNodes(), TNGraph::TNodeI::GetOutDeg(), TNGraph::TNodeI::GetOutNId(), TRnd::GetPowerDev(), TRnd::GetRayleigh(), TNGraph::GetRndNId(), GroundTruth, THash< TKey, TDat, THashFunc >::IsKey(), TCascade::Len(), TInt::Rnd, TFlt::Rnd, TCascade::Sort(), THash< TKey, TDat, THashFunc >::SortByDat(), and TInt::Val.
double TNetInfBs::GetAllCascProb | ( | const int & | EdgeN1, |
const int & | EdgeN2 | ||
) |
Definition at line 255 of file cascnetinf.cpp.
References CascPerEdge, CascV, and TVec< TVal, TSizeTy >::Len().
Referenced by GetBestEdge(), GetBound(), and GreedyOpt().
TIntPr TNetInfBs::GetBestEdge | ( | double & | CurProb, |
double & | LastGain, | ||
bool & | msort, | ||
int & | attempts | ||
) |
Definition at line 271 of file cascnetinf.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeGainV, GetAllCascProb(), TNGraph::GetEdges(), Graph, TNGraph::IsEdge(), TVec< TVal, TSizeTy >::Len(), TMath::Mn(), TFlt::Mn, TVec< TVal, TSizeTy >::Sort(), TPair< TVal1, TVal2 >::Val1, and TPair< TVal1, TVal2 >::Val2.
Referenced by GreedyOpt().
double TNetInfBs::GetBound | ( | const TIntPr & | Edge, |
double & | CurProb | ||
) |
Definition at line 356 of file cascnetinf.cpp.
References TVec< TVal, TSizeTy >::Add(), EdgeGainV, GetAllCascProb(), TNGraph::GetEdges(), Graph, TNGraph::IsEdge(), TVec< TVal, TSizeTy >::Len(), TVec< TVal, TSizeTy >::Sort(), TPair< TVal1, TVal2 >::Val1, and TPair< TVal1, TVal2 >::Val2.
|
inline |
|
inline |
Definition at line 112 of file cascnetinf.h.
References CascV, and TVec< TVal, TSizeTy >::Len().
|
inline |
Definition at line 117 of file cascnetinf.h.
References THash< TKey, TDat, THashFunc >::GetDat(), and NodeNmH.
Referenced by AddCasc().
|
inline |
Definition at line 116 of file cascnetinf.h.
References THash< TKey, TDat, THashFunc >::GetDat(), TNodeInfo::Name, and NodeNmH.
|
inline |
Definition at line 114 of file cascnetinf.h.
References TNGraph::GetNodes(), and Graph.
void TNetInfBs::GreedyOpt | ( | const int & | MxEdges | ) |
Definition at line 374 of file cascnetinf.cpp.
References TVec< TVal, TSizeTy >::Add(), TNGraph::AddEdge(), CascPerEdge, CascV, CompareGroundTruth, EdgeGainV, EdgeInfoH, GetAllCascProb(), GetBestEdge(), TNGraph::GetEdges(), Graph, GroundTruth, TNGraph::IsEdge(), TVec< TVal, TSizeTy >::Len(), TFlt::Mx, PrecisionRecall, TVec< TVal, TSizeTy >::Sort(), TPair< TVal1, TVal2 >::Val1, and TPair< TVal1, TVal2 >::Val2.
void TNetInfBs::Init | ( | ) |
Definition at line 216 of file cascnetinf.cpp.
References TVec< TVal, TSizeTy >::Add(), THash< TKey, TDat, THashFunc >::AddDat(), TNGraph::AddNode(), TNGraph::BegNI(), CascPerEdge, CascV, TVec< TVal, TSizeTy >::Clr(), EdgeGainV, TNGraph::EndNI(), THash< TKey, TDat, THashFunc >::GetDat(), Graph, THash< TKey, TDat, THashFunc >::IsKey(), TNGraph::IsNode(), TVec< TVal, TSizeTy >::Len(), TFlt::Mx, TNGraph::New(), and PrecisionRecall.
|
inline |
Definition at line 118 of file cascnetinf.h.
References THash< TKey, TDat, THashFunc >::IsKey(), and NodeNmH.
void TNetInfBs::LoadCascadesTxt | ( | TSIn & | SIn, |
const int & | Model, | ||
const double & | alpha | ||
) |
Definition at line 62 of file cascnetinf.cpp.
References AddCasc(), AddNodeNm(), TSIn::Eof(), TSIn::GetNextLn(), and TStr::SplitOnAllCh().
void TNetInfBs::LoadGroundTruthTxt | ( | TSIn & | SIn | ) |
Definition at line 75 of file cascnetinf.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), TNGraph::AddEdge(), TNGraph::AddNode(), Alphas, TSIn::Eof(), TNGraph::GetEdges(), TSIn::GetNextLn(), TNGraph::GetNodes(), GroundTruth, TVec< TVal, TSizeTy >::Len(), TNGraph::New(), and TStr::SplitOnAllCh().
|
inline |
Definition at line 100 of file cascnetinf.h.
References CascV, NodeNmH, THash< TKey, TDat, THashFunc >::Save(), and TVec< TVal, TSizeTy >::Save().
void TNetInfBs::SaveCascades | ( | const TStr & | OutFNm | ) |
Definition at line 524 of file cascnetinf.cpp.
References THash< TKey, TDat, THashFunc >::BegI(), TNGraph::BegNI(), CascV, THash< TKey, TDat, THashFunc >::EndI(), TNGraph::EndNI(), TStr::Fmt(), GroundTruth, TCascade::Len(), TVec< TVal, TSizeTy >::Len(), TCascade::NIdHitH, and TSOut::PutStr().
void TNetInfBs::SaveEdgeInfo | ( | const TStr & | OutFNm | ) |
Definition at line 470 of file cascnetinf.cpp.
References TEdgeInfo::AverageTimeDiff, TStr::CStr(), EdgeInfoH, THash< TKey, TDat, THashFunc >::GetDat(), TEdgeInfo::MarginalGain, TEdgeInfo::MedianTimeDiff, NodeNmH, TInt::Val, TFlt::Val, and TEdgeInfo::Vol.
void TNetInfBs::SaveGroundTruth | ( | const TStr & | OutFNm | ) |
Definition at line 502 of file cascnetinf.cpp.
References Alphas, TNGraph::BegEI(), TNGraph::BegNI(), TNGraph::EndEI(), TNGraph::EndNI(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), GroundTruth, THash< TKey, TDat, THashFunc >::IsKey(), TSOut::PutStr(), and TFlt::Val.
void TNetInfBs::SaveObjInfo | ( | const TStr & | OutFNm | ) |
Definition at line 485 of file cascnetinf.cpp.
References TVec< TVal, TSizeTy >::Add(), TGnuPlot::AddPlot(), EdgeInfoH, TVec< TVal, TSizeTy >::GetDat(), gpwLinesPoints, TVec< TVal, TSizeTy >::Len(), and TGnuPlot::SavePng().
void TNetInfBs::SavePajek | ( | const TStr & | OutFNm | ) |
Definition at line 439 of file cascnetinf.cpp.
References TNGraph::BegEI(), THash< TKey, TDat, THashFunc >::BegI(), TStr::CStr(), TNGraph::EndEI(), THash< TKey, TDat, THashFunc >::EndI(), Graph, THashSet< TKey, THashFunc >::Len(), TNodeInfo::Name, NodeNmH, and TNodeInfo::Vol.
void TNetInfBs::SavePlaneTextNet | ( | const TStr & | OutFNm | ) |
Definition at line 455 of file cascnetinf.cpp.
References TNGraph::BegEI(), THash< TKey, TDat, THashFunc >::BegI(), TStr::CStr(), TNGraph::EndEI(), THash< TKey, TDat, THashFunc >::EndI(), Graph, and NodeNmH.
TIntPrFltH TNetInfBs::Alphas |
Definition at line 94 of file cascnetinf.h.
Referenced by GenCascade(), LoadGroundTruthTxt(), and SaveGroundTruth().
TIntPrFltH TNetInfBs::Betas |
Definition at line 94 of file cascnetinf.h.
Referenced by GenCascade().
bool TNetInfBs::BoundOn |
Definition at line 91 of file cascnetinf.h.
Referenced by TNetInfBs().
Definition at line 89 of file cascnetinf.h.
Referenced by GetAllCascProb(), GreedyOpt(), and Init().
Definition at line 84 of file cascnetinf.h.
Referenced by AddCasc(), GetAllCascProb(), GetCasc(), GetCascs(), GreedyOpt(), Init(), Save(), and SaveCascades().
bool TNetInfBs::CompareGroundTruth |
Definition at line 91 of file cascnetinf.h.
Referenced by GreedyOpt(), and TNetInfBs().
Definition at line 87 of file cascnetinf.h.
Referenced by GetBestEdge(), GetBound(), GreedyOpt(), and Init().
Definition at line 86 of file cascnetinf.h.
Referenced by GreedyOpt(), SaveEdgeInfo(), and SaveObjInfo().
PNGraph TNetInfBs::Graph |
Definition at line 90 of file cascnetinf.h.
Referenced by GetBestEdge(), GetBound(), GetNodes(), GreedyOpt(), Init(), SavePajek(), and SavePlaneTextNet().
PNGraph TNetInfBs::GroundTruth |
Definition at line 90 of file cascnetinf.h.
Referenced by AddGroundTruth(), GenCascade(), GreedyOpt(), LoadGroundTruthTxt(), SaveCascades(), and SaveGroundTruth().
Definition at line 85 of file cascnetinf.h.
Referenced by AddNodeNm(), GetNodeInfo(), GetNodeNm(), IsNodeNm(), Save(), SaveEdgeInfo(), SavePajek(), and SavePlaneTextNet().
TFltPrV TNetInfBs::PrecisionRecall |
Definition at line 92 of file cascnetinf.h.
Referenced by GreedyOpt(), and Init().