8 if (Line==
"") {
break; }
12 printf(
"All nodes read!\n");
15 printf(
"All cascades read!\n");
27 if (Line==
"") {
break; }
42 if (FieldsV.
Len() == 3) {
43 Alphas.
AddDat(0.0) = FieldsV[2].GetFlt();
45 for (
int i=2; i<FieldsV.
Len()-1; i+=2) {
46 Alphas.
AddDat(FieldsV[i].GetFlt()) = FieldsV[i+1].GetFlt();
53 printf(
"Edge %d -> %d: ", FieldsV[0].GetInt(), FieldsV[1].GetInt());
55 for (
int i=0; i<AlphasE.
Len(); i+=2) { printf(
"(%f, %f)", AlphasE.
GetKey(i).Val, AlphasE[i].Val); }
71 if (Line==
"") {
break; }
92 if (Line==
"") {
break; }
98 if (verbose) { printf(
"Node:%s\n", NIdV[1].CStr()); }
107 if (FieldsV.
Len() == 3) {
108 Alphas.
AddDat(0.0) = FieldsV[2].GetFlt();
110 for (
int i=2; i<FieldsV.
Len()-1; i+=2) {
111 Alphas.
AddDat(FieldsV[i].GetFlt()) = FieldsV[i+1].GetFlt();
118 printf(
"Edge %d -> %d: ", FieldsV[0].GetInt(), FieldsV[1].GetInt());
120 for (
int i=0; i<AlphasE.
Len(); i+=2) { printf(
"(%f, %f)", AlphasE.
GetKey(i).Val, AlphasE[i].Val); }
136 if (Line==
"") {
break; }
152 if (FieldsV.
Len()==2) { CId = FieldsV[0].GetInt(); }
155 TStrV NIdV; FieldsV[FieldsV.
Len()-1].SplitOnAllCh(
',', NIdV);
157 for (
int i = 0; i < NIdV.
Len(); i+=2) {
160 NId = NIdV[i].GetInt();
161 Tm = NIdV[i+1].GetFlt();
174 C.
Add(NI.GetKey(), NI.GetDat());
181 bool verbose =
false;
183 double GlobalTime, InitTime;
193 while (C.
Len() < 2) {
199 GlobalTime = InitTime;
202 InfectedNIdH.
AddDat(StartNId) = GlobalTime;
207 const int& NId = InfectedNIdH.
BegI().
GetKey();
215 C.
Add(NId, GlobalTime);
217 if (verbose) { printf(
"GlobalTime:%f, infected node:%d\n", GlobalTime, NId); }
221 for (
int e = 0; e < NI.GetOutDeg(); e++) {
222 const int DstNId = NI.GetOutNId(e);
226 for (
int j=0; j<Alphas.
Len() && Alphas.
GetKey(j)<GlobalTime; j++) { alpha = Alphas[j]; }
227 if (verbose) { printf(
"GlobalTime:%f, nodes:%d->%d, alpha:%f\n", GlobalTime, NId, DstNId, alpha); }
229 if (alpha<1e-9) {
continue; }
232 if (InfectedBy.
IsKey(NId) && InfectedBy.
GetDat(NId).
Val == DstNId)
259 if (InfectedNIdH.
IsKey(DstNId)) {
260 double t2 = InfectedNIdH.
GetDat(DstNId);
262 InfectedNIdH.
GetDat(DstNId) = t1;
263 InfectedBy.
GetDat(DstNId) = NId;
266 InfectedNIdH.
AddDat(DstNId) = t1;
267 InfectedBy.
AddDat(DstNId) = NId;
287 if (EI().IsKey(Step)) { Alpha = EI().GetDat(Step); }
290 GraphAtT->
AddEdge(EI.GetSrcNId(), EI.GetDstNId());
303 if (EI().IsKey(Step)) { Alpha = EI().GetDat(Step); }
306 NetworkAtT->AddEdge(EI.GetSrcNId(), EI.GetDstNId(), Alpha);
319 double inferredAlpha = 0.0;
320 if (EI().IsKey(Step)) { inferredAlpha = EI().GetDat(Step); }
323 GraphAtT->
AddEdge(EI.GetSrcNId(), EI.GetDstNId());
332 NetworkAtT->AddNode(NI.GetKey(), NI.GetDat().Name);
338 double inferredAlpha = 0.0;
339 if (EI().IsKey(Step)) { inferredAlpha = EI().GetDat(Step); }
342 NetworkAtT->AddEdge(EI.GetSrcNId(), EI.GetDstNId(), inferredAlpha);
362 for (
int i=0; i<Steps.
Len()-1; i++) {
381 void TNIBs::SG(
const int& NId,
const int& Iters,
const TFltV& Steps,
const TSampling& Sampling,
const TStr& ParamSampling,
const bool& PlotPerformance) {
382 bool verbose =
false;
383 int currentCascade = -1;
389 printf(
"Node %d\n", NId);
392 for (
int t=1; t<Steps.
Len(); t++) {
395 int num_infections = 0;
397 if (
CascH[i].LenBeforeT(Steps[t]) > 1 &&
399 (Sampling==
WIN_SAMPLING && (Steps[t]-
CascH[i].GetMinTm()) <= ParamSamplingV[0].GetFlt()) ||
401 num_infections +=
CascH[i].LenBeforeT(Steps[t]);
407 if (CascadesIdx.
Len()==0) {
408 printf(
"WARNING: No cascades recorded by %f!\n", Steps[t].Val);
416 printf(
"Solving step %f: %d cascades, %d infections\n", Steps[t].Val, CascadesIdx.
Len(), num_infections);
417 SampledCascades.
Clr();
420 for (
int i=0; i < Iters; i++) {
432 currentCascade = (int)
TFlt::Rnd.GetExpDev(ParamSamplingV[0].GetFlt());
433 }
while (currentCascade > CascadesIdx.
Len()-1);
438 currentCascade = (int)
TFlt::Rnd.GetExpDev(ParamSamplingV[1].GetFlt());
439 }
while (currentCascade > CascadesIdx.
Len()-1);
444 currentCascade = (int)
TFlt::Rnd.GetRayleigh(ParamSamplingV[0].GetFlt());
445 }
while (currentCascade > CascadesIdx.
Len()-1);
449 if (!SampledCascades.
IsKey(currentCascade)) { SampledCascades.
AddDat(currentCascade) = 0; }
450 SampledCascades.
GetDat(currentCascade)++;
452 if (verbose) { printf(
"Cascade %d sampled!\n", currentCascade); }
462 for (
int j=0; j<AlphasToUpdate.
Len(); j++) {
481 if (verbose) { printf(
"%d transmission rates updated!\n", AlphasToUpdate.
Len()); }
484 printf(
"%d different cascades have been sampled for step %f!\n", SampledCascades.
Len(), Steps[t].Val);
489 if (EI().IsKey(Steps[t]) || t == 0 || !EI().IsKey(Steps[t-1])) {
continue; }
491 EI().AddDat(Steps[t]) =
Aging*EI().GetDat(Steps[t-1]);
494 if (verbose) { printf(
"%d transmission rates that did not changed were 'aged' by %f!\n", unchanged,
Aging.
Val); }
501 void TNIBs::BSG(
const int& NId,
const int& Iters,
const TFltV& Steps,
const int& BatchLen,
const TSampling& Sampling,
const TStr& ParamSampling,
const bool& PlotPerformance) {
502 bool verbose =
false;
503 int currentCascade = -1;
512 for (
int t=1; t<Steps.
Len(); t++) {
515 int num_infections = 0;
516 for (
int i = 0; i <
CascH.
Len(); i++) {
517 if (
CascH[i].LenBeforeT(Steps[t]) > 1 &&
519 (Sampling==
WIN_SAMPLING && (Steps[t]-
CascH[i].GetMinTm()) <= ParamSamplingV[0].GetFlt()) ||
521 num_infections +=
CascH[i].LenBeforeT(Steps[t]);
527 if (CascadesIdx.
Len() == 0) {
528 printf(
"WARNING: No cascades recorded by %f!\n", Steps[t].Val);
533 printf(
"Solving step %f (%d cascades, %d infections)\n", Steps[t].Val,
534 CascadesIdx.
Len(), num_infections);
540 for (
int i=0; i < Iters; i++) {
548 for (
int c=0; c<BatchLen; c++) {
560 currentCascade = (int)
TFlt::Rnd.GetExpDev(ParamSamplingV[0].GetFlt());
561 }
while (currentCascade > CascadesIdx.
Len()-1);
566 currentCascade = (int)
TFlt::Rnd.GetExpDev(ParamSamplingV[1].GetFlt());
567 }
while (currentCascade > CascadesIdx.
Len()-1);
572 currentCascade = (int)
TFlt::Rnd.GetRayleigh(ParamSamplingV[0].GetFlt());
573 }
while (currentCascade > CascadesIdx.
Len()-1);
580 if (!SampledCascades.
IsKey(currentCascade)) { SampledCascades.
AddDat(currentCascade) = 0; }
581 SampledCascades.
GetDat(currentCascade)++;
588 for (
int j=0; j<AlphasToUpdate.
Len(); j++) {
616 if (EI().IsKey(Steps[t]) || t == 0 || !EI().IsKey(Steps[t-1])) {
continue; }
618 EI().AddDat(Steps[t]) = EI().GetDat(Steps[t-1]);
621 if (verbose) { printf(
"%d unchanged transmission rates updated!\n", unchanged); }
624 printf(
"%d different cascades have been sampled for step %f!\n", SampledCascades.
Len(), Steps[t].Val);
632 bool verbose =
false;
639 for (
int t=1; t<Steps.
Len(); t++) {
642 int num_infections = 0;
644 if (
CascH[i].LenBeforeT(Steps[t]) > 1) {
645 num_infections +=
CascH[i].LenBeforeT(Steps[t]);
651 if (CascadesIdx.
Len()==0) {
652 printf(
"WARNING: No cascades recorded by %f!\n", Steps[t].Val);
657 printf(
"Solving step %f (%d cascades, %d infections)\n", Steps[t].Val, CascadesIdx.
Len(), num_infections);
663 for (
int i=0; i < Iters; i++) {
671 for (
int c=0; c<CascadesIdx.
Len(); c++) {
680 for (
int j=0; j<AlphasToUpdate.
Len(); j++) {
708 if (EI().IsKey(Steps[t]) || t == 0 || !EI().IsKey(Steps[t-1])) {
continue; }
710 EI().AddDat(Steps[t]) = EI().GetDat(Steps[t-1]);
713 if (verbose) { printf(
"%d unchanged transmission rates updated!\n", unchanged); }
727 if (Cascade.
IsNode(NId) && Cascade.
GetTm(NId) <= CurrentTime) {
730 if ( (Cascade.
GetTm(NId)<=NI.GetDat().Tm) ||
734 TIntPr Pair(NI.GetKey(), NId);
761 if ( Cascade.
IsNode(NId) && (Cascade.
GetTm(NId)<=NI.GetDat().Tm ||
766 if (NI.GetDat().Tm > CurrentTime) {
break; }
768 TIntPr Pair(NI.GetKey(), NId);
772 if (Cascade.
IsNode(NId) && Cascade.
GetTm(NId) <= CurrentTime) {
777 val = (Cascade.
GetTm(NId) - NI.GetDat().Tm) - 1.0/sum;
780 val = log((Cascade.
GetTm(NId) - NI.GetDat().Tm)/
Delta) - 1.0/((Cascade.
GetTm(NId)-NI.GetDat().Tm)*sum);
789 IAssert((CurrentTime - NI.GetDat().Tm) >= 0.0);
793 val = (CurrentTime-NI.GetDat().Tm);
829 AlphasToUpdate.
Add(Pair);
836 if ( t >= x.
Len() )
return;
841 for (
int j = 0; j < k; j++){
842 double alpha = ( (x.
Len() ) / T ) * pow( s, j );
843 double term_1 = -log(alpha) + alpha * x[t];
846 term_2 = j * log(n) * gamma;
850 for (
int l = 0; l < k; l++){
851 double my_val = C(t-1, l);
852 if ( j > l ) my_val += (j - l) * log(n) * gamma;
853 if ( !first || my_val < term_2 ){
859 C( t, j ) = term_1 + term_2;
862 find_C( t + 1, x, C, k, s, gamma, T );
869 for (
int t = C.
GetRows() - 1; t > 0; t --){
872 for (
int j = 0; j < C.
GetCols(); j++){
873 double c_state = C( t, j );
874 if ( t < C.
GetRows() - 2 && states[t+1] > j ){
875 c_state += ( states[t+1] - j ) * gamma * log(n);
877 if ( best_state == -1 || best_val > c_state ){
882 states[t] = best_state;
890 for (
int i=0; i<LinksEdge.
Len(); i++) {
894 if (tsecs > MaxTime || tsecs < MinTime) {
continue; }
895 arrival_times.
Add(tsecs);
899 if ( arrival_times.
Len() < 2 )
return;
903 arrival_times.
Sort(
true);
904 double T = ((double)arrival_times.
Last().
GetAbsSecs()) - ((
double)arrival_times[0].GetAbsSecs());
905 for (
int i = 1; i < arrival_times.
Len(); i++){
906 x.
Add( ((
double)arrival_times[i].GetAbsSecs()) - ((
double)arrival_times[i-1].GetAbsSecs()) );
910 find_C( 0, x, Cost_matrix, k, s, gamma, T);
914 for (
int i=0; i<state_labels.
Len(); i++) { state_times.
Add((
double)arrival_times[i].GetAbsSecs()); }
919 double CurrentMAE = 0.0;
920 double CurrentMSE = 0.0;
921 TFltPr CurrentPrecisionRecall(0.0, 0.0);
922 double CurrentAccD = 0.0;
925 for (
int i=0; i<NI.GetInDeg(); i++) {
928 double trueAlpha = 0.0;
932 CurrentAccD += (double) (inferredAlpha >
MinAlpha);
940 for (
int i=0; i<NI.GetInDeg(); i++) {
941 TIntPr Pair(NI.GetInNId(i), NId);
944 double inferredAlpha = 0.0;
950 double trueAlpha = 0.0;
972 if (CurrentAccD > 0) {
985 if (NIdV.
Len() > 0 && !NIdV.
IsIn(NI.GetKey())) {
continue; }
987 FOut.
PutStr(
TStr::Fmt(
"%d \"%s\" ic Blue\r\n", NI.GetKey().Val+1, NI.GetDat().Name.CStr()));
991 if (NIdV.
Len() > 0 && (!NIdV.
IsIn(EI.GetSrcNId()) || !NIdV.
IsIn(EI.GetDstNId()))) {
continue; }
994 double inferredAlpha = 0.0;
995 if (EI().IsKey(Step)) { inferredAlpha = EI().GetDat(Step); }
1008 if (NIdV.
Len() > 0 && !NIdV.
IsIn(NI.GetKey())) {
continue; }
1010 FOut.
PutStr(
TStr::Fmt(
"%d,%s\r\n", NI.GetKey().Val, NI.GetDat().Name.CStr()));
1017 if (NIdV.
Len() > 0 && (!NIdV.
IsIn(EI.GetSrcNId()) || !NIdV.
IsIn(EI.GetDstNId()))) {
continue; }
1021 if (EI.GetSrcNId() != EI.GetDstNId()) {
1022 if (EI().Len() > 0) {
1023 TStr Line;
bool IsEdge =
false;
1024 for (
int i=0; i<EI().Len(); i++) {
1029 Line +=
TStr::Fmt(
",%f,0.0", EI().GetKey(i).Val);
1040 FOut.
PutStr(
TStr::Fmt(
"%d,%d,1\r\n", EI.GetSrcNId(), EI.GetDstNId()));
1050 if (NIdV.
Len() > 0 && !NIdV.
IsIn(NI.GetKey())) {
continue; }
1052 FOut.
PutStr(
TStr::Fmt(
"%d,%s\r\n", NI.GetKey().Val, NI.GetDat().Name.CStr()));
1058 if (NIdV.
Len() > 0 && (!NIdV.
IsIn(EI.GetSrcNId()) || !NIdV.
IsIn(EI.GetDstNId()))) {
continue; }
1062 if (EI.GetSrcNId() != EI.GetDstNId()) {
1063 double inferredAlpha = 0.0;
1064 if (EI().IsKey(Step)) { inferredAlpha = EI().GetDat(Step); }
1081 if (EI.GetSrcNId() != EI.GetDstNId()) {
1082 if (EI().Len() > 0) {
1083 TStr Line;
bool IsEdge =
false;
1084 for (
int i=0; i<EI().Len(); i++) {
1089 Line +=
TStr::Fmt(
",%f,0.0", EI().GetKey(i).Val);
1100 FOut.
PutStr(
TStr::Fmt(
"%d,%d,1\r\n", EI.GetSrcNId(), EI.GetDstNId()));
1110 FOut.
PutStr(
TStr::Fmt(
"%d,%s\r\n", NI.GetKey().Val, NI.GetDat().Name.CStr()));
1120 if (EI.GetSrcNId() != EI.GetDstNId()) {
1121 if (EI().Len() > 0) {
1123 for (
int i=0; i<EI().Len()-1; i++) { FOut.
PutStr(
TStr::Fmt(
"%f,%f,", EI().GetKey(i).Val, EI()[i].Val)); }
1124 FOut.
PutStr(
TStr::Fmt(
"%f,%f", EI().GetKey(EI().Len()-1).Val, EI()[EI().Len()-1].Val));
1128 FOut.
PutStr(
TStr::Fmt(
"%d,%d,1\r\n", EI.GetSrcNId(), EI.GetDstNId()));
1138 FOut.
PutStr(
TStr::Fmt(
"%d \"%s\" ic Blue\r\n", NI.GetKey().Val+1, NI.GetDat().Name.CStr()));
1140 FOut.
PutStr(
"*Arcs\r\n");
1143 double trueAlpha = 0.0;
1144 if (EI().IsKey(Step)) { trueAlpha = EI().GetDat(Step); }
1145 else {
for (
int j=0; j<EI().Len() && EI().GetKey(j)<=Step; j++) { trueAlpha = EI()[j]; } }
1158 FOut.
PutStr(
TStr::Fmt(
"%d,%s", NI.GetKey().Val, NI.GetDat().Name.CStr()));
1159 if (CascadesPerNode.
IsKey(NI.GetKey().Val)) {
1160 for (
int i=0; i<CascadesPerNode.
GetDat(NI.GetKey().Val).Len(); i++) {
1173 FOut.
PutStr(
TStr::Fmt(
"%d,%s\r\n", NI.GetKey().Val, NI.GetDat().Name.CStr()));
1184 if (j > 0) { FOut.
PutStr(
TStr::Fmt(
",%d,%f", NI.GetDat().NId.Val, NI.GetDat().Tm.Val)); }
1185 else { FOut.
PutStr(
TStr::Fmt(
"%d;%d,%f", CI.GetKey().Val, NI.GetDat().NId.Val, NI.GetDat().Tm.Val)); }
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
void BSG(const int &NId, const int &Iters, const TFltV &Steps, const int &BatchLen, const TSampling &Sampling, const TStr &ParamSampling=TStr(""), const bool &PlotPerformance=false)
void SaveGroundTruth(const TStr &OutFNm)
void SaveInferred(const TStr &OutFNm, const TIntV &NIdV=TIntV())
TNodeInfo GetNodeInfo(const int &NId) const
TIntIntPrH SampledCascadesH
void SaveGroundTruthPajek(const TStr &OutFNm, const double &Step)
int GetEdges() const
Returns the number of edges in the network.
TEdgeI EndEI() const
Returns an iterator referring to the past-the-end edge in the network.
static const T & Mx(const T &LVal, const T &RVal)
static PNGraph New()
Static constructor that returns a pointer to the graph. Call: PNGraph Graph = TNGraph::New().
bool IsIn(const TVal &Val) const
Checks whether element Val is a member of the vector.
void Init(const TFltV &Steps)
THash< TInt, TCascade > CascH
THash< TInt, THitInfo >::TIter EndI() const
int AddNode(int NId=-1)
Adds a node of ID NId to the network.
TStrFltFltHNEDNet Network
TStrFltFltHNEDNet InferredNetwork
void LoadInferredNodesTxt(TSIn &SIn)
void LoadCascadesTxt(TSIn &SIn)
TSizeTy Len() const
Returns the number of elements in the vector.
THash< TInt, TNodeInfo > NodeNmH
void AddCasc(const TStr &CascStr, const TModel &Model=EXP)
void LoadGroundTruthTxt(TSIn &SIn)
double GetRayleigh(const double &Sigma)
int AddNode(int NId=-1)
Adds a node of ID NId to the graph.
THash< TInt, THitInfo > NIdHitH
const TDat & GetDat(const TKey &Key) const
bool GetEDat(const int &SrcNId, const int &DstNId, TEdgeData &EdgeDat) const
Returns edge data in Data for the edge from node IDs SrcNId to DstNId.
void GetInferredGraphAtT(const double &Step, PNGraph &GraphAtT)
const TKey & GetKey() const
void SaveInferredPajek(const TStr &OutFNm, const double &Step, const TIntV &NIdV=TIntV())
static PNet New()
Static constructor that returns a pointer to the network. Call: TPt > Net = TNodeEDatNet::New().
double GetTm(const int &NId) const
int AddEdge(const int &SrcNId, const int &DstNId)
Adds an edge from node IDs SrcNId to node DstNId to the network.
void Clr(const bool &DoDel=true, const bool &ResetDat=true)
Deletes all nodes and edges from the network.
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
const TDat & GetDat() const
TNodeI GetNI(const int &NId) const
Returns an iterator referring to the node of ID NId in the network.
void Sort(const bool &Asc=true)
Sorts the elements of the vector.
TEdgeI BegEI() const
Returns an iterator referring to the first edge in the network.
int AddEdge(const int &SrcNId, const int &DstNId)
Adds an edge from node IDs SrcNId to node DstNId to the graph.
bool IsEdge(const int &SrcNId, const int &DstNId, const bool &IsDir=true) const
Tests whether an edge from node IDs SrcNId to DstNId exists in the network.
void SG(const int &NId, const int &Iters, const TFltV &Steps, const TSampling &Sampling, const TStr &ParamSampling=TStr(""), const bool &PlotPerformance=false)
static double Power(const double &Base, const double &Exponent)
void LoadInferredTxt(TSIn &SIn)
const TVal & Last() const
Returns a reference to the last element of the vector.
void GenCascade(TCascade &C)
void ComputePerformanceNId(const int &NId, const int &Step, const TFltV &Steps)
void FG(const int &NId, const int &Iters, const TFltV &Steps)
int GetRndNId(TRnd &Rnd=TInt::Rnd)
Returns an ID of a random node in the network.
TPair< TFlt, TFlt > TFltPr
void SaveSites(const TStr &OutFNm, const TIntFltVH &CascadesPerNode=TIntFltVH())
void SaveInferredEdges(const TStr &OutFNm)
void GetInferredNetworkAtT(const double &Step, PStrFltNEDNet &NetworkAtT)
bool IsNodeNm(const int &NId) const
void GetGroundTruthNetworkAtT(const double &Step, PStrFltNEDNet &NetworkAtT)
static double GetMn(const double &Flt1, const double &Flt2)
void UpdateDiff(const TOptMethod &OptMethod, const int &NId, TCascade &Cascade, TIntPrV &AlphasToUpdate, const double &CurrentTime=TFlt::Mx)
void find_C(int t, TFltV &x, TFltVV &C, const int &k, const double &s, const double &gamma, const double &T)
THash< TInt, THitInfo >::TIter BegI() const
void LoadGroundTruthNodesTxt(TSIn &SIn)
static TStr Fmt(const char *FmtStr,...)
void Add(const int &NId, const double &HitTm)
int PutStr(const char *CStr)
void SplitOnAllCh(const char &SplitCh, TStrV &StrV, const bool &SkipEmpty=true) const
void LabelBurstAutomaton(const int &SrcId, const int &DstId, TIntV &state_labels, TFltV &state_times, const bool &inferred=false, const int &k=5, const double &s=2.0, const double &gamma=1.0, const TSecTm &MinTime=TSecTm(), const TSecTm &MaxTime=TSecTm())
void Clr(const bool &DoDel=true, const int &NoDelLim=-1, const bool &ResetDat=true)
void SaveCascades(const TStr &OutFNm)
int GetUniDevInt(const int &Range=0)
bool IsKey(const TKey &Key) const
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
TDat & AddDat(const TKey &Key)
void AddNodeNm(const int &NId, const TNodeInfo &Info)
THash< TInt, TIntFltH > DiffAlphas
const TKey & GetKey(const int &KeyId) const
void GetGroundTruthGraphAtT(const double &Step, PNGraph &GraphAtT)
bool IsNode(const int &NId) const
double GetPowerDev(const double &AlphaSlope)
void find_min_state(TFltVV &C, TIntV &states, const int &k, const double &s, const double &gamma, const double &T)
int GetNodes() const
Returns the number of nodes in the network.
bool GetNextLn(TStr &LnStr)
TIntFltH TotalCascadesAlpha
void SortByDat(const bool &Asc=true)