Skip to content

Commit 337c470

Browse files
committed
Network naming fixed
1 parent 3496148 commit 337c470

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Sources/benchm.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,12 @@ int print_network(deque<set<int> > & E, const deque<deque<int> > & member_list,
107107
ofstream out1(fnameNetwork.c_str());
108108
// Output the header
109109
out1 << "# Nodes: " << num_nodes << ", " << (directed ? "Arcs" : "Edges") << ": "
110-
<< (directed ? arcs : arcs / 2) << " Weighted: 1" << endl;
110+
<< (directed ? arcs : arcs / 2) << ", Weighted: 1" << endl;
111111
for (int u=0; u<E.size(); u++) {
112112

113-
set<int>::iterator itb=E[u].begin();
114-
115-
while (itb!=E[u].end())
113+
for(set<int>::iterator itb=E[u].begin(); itb != E[u].end(); ++itb)
116114
if(directed || u <= *itb)
117-
out1<<u+1<<"\t"<<*(itb++)+1<<"\t"<<neigh_weigh[u][*(itb)]<<endl;
115+
out1<<u+1<<"\t"<<*itb+1<<"\t"<<neigh_weigh[u][*(itb)]<<endl;
118116
}
119117

120118

Sources/set_parameters.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ bool Parameters::arrange() {
216216

217217

218218
cout<<"\n**************************************************************"<<endl;
219+
cout<<"network:\t"<<fnameNetwork<<endl;
219220
cout<<"number of nodes:\t"<<num_nodes<<endl;
220221
cout<<"average degree:\t"<<average_k<<endl;
221222
cout<<"maximum degree:\t"<<max_degree<<endl;
@@ -390,7 +391,7 @@ bool Parameters::set(string & flag, string & num) {
390391
directed=cast_int(err);
391392
string ext = directed ? ".nsa" : ".nse";
392393
size_t iext = fnameNetwork.rfind('.');
393-
if(iext != string::npos && fnameNetwork.substr(iext) == ext) {
394+
if(iext != string::npos && fnameNetwork.substr(iext) != ext) {
394395
fnameNetwork.resize(iext);
395396
fnameNetwork += ext;
396397
}

0 commit comments

Comments
 (0)