/************************************************************************/ /* */ /* Free software: Progressive edge-growth (PEG) algorithm */ /* Created by Xiaoyu Hu */ /* Evangelos Eletheriou */ /* Dieter Arnold */ /* IBM Research, Zurich Research Lab., Switzerland */ /* */ /* The C++ sources files have been compiled using xlC compiler */ /* at IBM RS/6000 running AIX. For other compilers and platforms,*/ /* minor changes might be needed. */ /* */ /* Bug reporting to: xhu@zurich.ibm.com */ /**********************************************************************/ //// // Modified by F. P. Beekhof; 2008 / 08 / 19 //// #include #include #include #include #include #include #include #include #include "BigGirth.h" #include "Random.h" #include "CyclesOfGraph.h" const double EPS = 1e-6; using namespace std; void usage() { cout<<"*******************************************************************************************"< " <= argc) usage(); M=atoi(argv[i]); } else if(strcmp(argv[i], "-numN")==0) { if (++i >= argc) usage(); N=atoi(argv[i]); } else if(strcmp(argv[i], "-codeName")==0) { if (++i >= argc) usage(); codeName = argv[i]; } else if(strcmp(argv[i], "-degFileName")==0) { if (++i >= argc) usage(); degFileName = argv[i]; } else if(strcmp(argv[i], "-sglConcent")==0) { if (++i >= argc) usage(); sglConcent=atoi(argv[i]); } else if(strcmp(argv[i], "-tgtGirth")==0) { if (++i >= argc) usage(); targetGirth=atoi(argv[i]); } else if(strcmp(argv[i], "-outputMode")==0) { if (++i >= argc) usage(); output_mode=atoi(argv[i]); } else if(strcmp(argv[i], "-q")==0) { verbose=false; } else{ usage(); } } if (M == -1 || N == -1) { cout<<"Error: M or N not specified!"<N) { cout<<"Error: M must be smaller than N!"< degSeq(N); ifstream infn(degFileName.c_str()); if (!infn) {cout << "\nCannot open file " << degFileName << endl; exit(-1); } int m; infn >>m; std::vector deg(m); std::vector degFrac(m); for(int i=0;i>deg[i]; for(int i=0;i>degFrac[i]; infn.close(); double dtmp=0.0; for(int i=0;iEPS) { cout.setf(ios::fixed, ios::floatfield); cout <<"\n Invalid degree distribution (node perspective): sum != 1.0 but "<=0;--j) { if(dtmp>degFrac[j]) break; } if(dtmp