Skip to content

Commit

Permalink
Network naming fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
luav committed May 24, 2017
1 parent 3496148 commit 337c470
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Sources/benchm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@ int print_network(deque<set<int> > & E, const deque<deque<int> > & member_list,
ofstream out1(fnameNetwork.c_str());
// Output the header
out1 << "# Nodes: " << num_nodes << ", " << (directed ? "Arcs" : "Edges") << ": "
<< (directed ? arcs : arcs / 2) << " Weighted: 1" << endl;
<< (directed ? arcs : arcs / 2) << ", Weighted: 1" << endl;
for (int u=0; u<E.size(); u++) {

set<int>::iterator itb=E[u].begin();

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


Expand Down
3 changes: 2 additions & 1 deletion Sources/set_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ bool Parameters::arrange() {


cout<<"\n**************************************************************"<<endl;
cout<<"network:\t"<<fnameNetwork<<endl;
cout<<"number of nodes:\t"<<num_nodes<<endl;
cout<<"average degree:\t"<<average_k<<endl;
cout<<"maximum degree:\t"<<max_degree<<endl;
Expand Down Expand Up @@ -390,7 +391,7 @@ bool Parameters::set(string & flag, string & num) {
directed=cast_int(err);
string ext = directed ? ".nsa" : ".nse";
size_t iext = fnameNetwork.rfind('.');
if(iext != string::npos && fnameNetwork.substr(iext) == ext) {
if(iext != string::npos && fnameNetwork.substr(iext) != ext) {
fnameNetwork.resize(iext);
fnameNetwork += ext;
}
Expand Down

0 comments on commit 337c470

Please sign in to comment.