9 paraq::paraq(int _nprocs, const int _rank)
15 jobListInitialized = false;
18 void paraq::addRange(const string& paraid, double min, double max, double step)
20 for( double paraval = min; paraval <= max+0.5*step; paraval += step+(step==0) )
21 if( ! inParas(paraMap[paraid], paraval) ) paraMap[paraid].push_back( paraval );
24 bool paraq::inParas( vector<double>& paraVec, double& tofind )
26 for( vector<double>::iterator it = paraVec.begin(); it < paraVec.end(); ++it)
27 if( fabs(*it - tofind) < 0.0000000001 ) return true;
31 void paraq::initJobList()
33 if( ! jobListInitialized ) {
34 map<string,double> jobZero;
35 jobList.push_back( jobZero );
37 for( map< string, vector< double > >::iterator paraIt = paraMap.begin(); paraIt != paraMap.end(); ++paraIt )
38 while( jobList.begin()->find(paraIt->first) == jobList.begin()->end() ) {
39 for( vector<double>::iterator valIt = paraIt->second.begin(); valIt != paraIt->second.end(); ++valIt ) {
40 jobList.push_back( *jobList.begin() );
41 jobList.back()[paraIt->first] = *valIt;
43 jobList.erase( jobList.begin() );
45 jobListInitialized = true;
49 int paraq::nextParas()
58 if( jobList.begin()->size() == 0 ) return 0;
60 if( thisjob < jobList.size() ) return 1;
65 double& paraq::operator[] (string paraid) {
66 if( jobList[thisjob].find(paraid) != jobList[thisjob].end() ) {
67 return jobList[thisjob][paraid];
70 if( defaultPara.find(paraid) != defaultPara.end() ) {
71 return defaultPara[paraid];
77 int paraq::getTotalJobs() {
79 return jobList.size();