X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/598fe7b7a358769fc1b6c48772f35cf7b719e8b4..061e6469f58f3e3e892f1cd1f6fdd2aad9c644e8:/paraq.cpp?ds=inline diff --git a/paraq.cpp b/paraq.cpp index 773beb4..0892962 100644 --- a/paraq.cpp +++ b/paraq.cpp @@ -41,23 +41,23 @@ string paraq::rangeString() for( map< string, vector >::iterator paraIt = rangeMap.begin(); paraIt != rangeMap.end(); ++paraIt ) if( paraIt->second.size() > 0 ) for( vector::iterator rangeIt = paraIt->second.begin(); rangeIt != paraIt->second.end(); ++rangeIt) - rangestring << "-" << paraIt->first << (*rangeIt)[0] << "_" << (*rangeIt)[1] << "_" << (*rangeIt)[2]; + rangestring << "_" << paraIt->first << (*rangeIt)[0] << "-" << (*rangeIt)[1] << "-" << (*rangeIt)[2]; - for (vector< pair >::iterator linkit = linkedParas.begin(); linkit != linkedParas.end(); ++linkit) - rangestring << "-" << linkit->first << "--" << linkit->second; + for (vector::iterator linkit = linkedParas.begin(); linkit != linkedParas.end(); ++linkit) + rangestring << "_" << linkit->first << "--" << linkit->linktype << "--" << linkit->second; for( map::iterator defIt = defaultPara.begin(); defIt != defaultPara.end(); ++defIt ) if( rangeMap.find(defIt->first) == rangeMap.end() ) { bool linkedpara = false; - for (vector< pair >::iterator linkit = linkedParas.begin(); linkit != linkedParas.end(); ++linkit) + for (vector::iterator linkit = linkedParas.begin(); linkit != linkedParas.end(); ++linkit) if (linkit->first == defIt->first) { linkedpara = true; break; } if (!linkedpara) - rangestring << "-" << defIt->first << defIt->second; + rangestring << "_" << defIt->first << defIt->second; } return rangestring.str(); @@ -98,9 +98,9 @@ void paraq::initJobList() jobList.back()[paraIt->first] = *valIt; /* also set linked parameters */ - for (vector< pair >::iterator linkit = linkedParas.begin(); linkit != linkedParas.end(); ++linkit) + for (vector::iterator linkit = linkedParas.begin(); linkit != linkedParas.end(); ++linkit) if (linkit->second == paraIt->first) - jobList.back()[linkit->first] = *valIt; + jobList.back()[linkit->first] = linkTypeFunction(*valIt, linkit->linktype); } jobList.erase( jobList.begin() ); } @@ -108,6 +108,18 @@ void paraq::initJobList() } } +double paraq::linkTypeFunction (double linkval, int linktype) { + switch (linktype) { + + case LINK_1TO1: + return linkval; + + case LINK_NEGATIVE: + return -linkval; + + } +} + int paraq::nextParas() { if( thisjob == -1 ) {