From: Alex Schmidt Date: Wed, 17 Apr 2013 10:07:47 +0000 (+0200) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/7ebf4164400b973bba97887d7852bc07801206b7 ... --- diff --git a/paraq.cpp b/paraq.cpp index b1e3292..381941f 100644 --- a/paraq.cpp +++ b/paraq.cpp @@ -60,6 +60,8 @@ void paraq::addRange(const string& paraid, double min, double max, double step) for( double paraval = min; paraval <= max+0.5*step; paraval += step+(step==0) ) if( ! inParas(paraMap[paraid], paraval) ) paraMap[paraid].push_back( paraval ); + + uniqueAllParaIdsAdd(paraid); } bool paraq::inParas( vector& paraVec, double& tofind ) @@ -119,3 +121,11 @@ int paraq::getTotalJobs() { initJobList(); return jobList.size(); } + +void paraq::uniqueAllParaIdsAdd(const string& paraid) { + for (vector::iterator allparait = allParaIds.begin(); allparait != allParaIds.end(); ++allparait) + if ( *allparait == paraid ) + return; + + allParaIds.push_back(paraid); +} diff --git a/paraq.h b/paraq.h index ef4376b..fbb6dab 100644 --- a/paraq.h +++ b/paraq.h @@ -15,9 +15,10 @@ class paraq { double& operator[] (string paraid); void addRange(const string& paraid, double range[3]) { addRange(paraid, range[0], range[1], range[2]); } void addRange(const string& paraid, char *range); - void setDefault(const string& paraid, double value) { defaultPara[paraid] = value; } + void setDefault(const string& paraid, double value) { defaultPara[paraid] = value; uniqueAllParaIdsAdd(paraid); } int getTotalJobs(); string rangeString(); + //map* getAllParas() {}; private: int nprocs, rank; @@ -30,6 +31,8 @@ class paraq { bool inParas(vector& paraVec, double& tofind); double masterdefault; bool jobListInitialized; + vector allParaIds; + void uniqueAllParaIdsAdd(const string& paraid); }; #endif