X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/a5f05e337d18c193ac57b4da0013d1cdc69f8faa..a2b065a04a23009d81caab4ce169497b042b352b:/paraq.h?ds=inline diff --git a/paraq.h b/paraq.h index 6dc582d..70070f3 100644 --- a/paraq.h +++ b/paraq.h @@ -5,9 +5,19 @@ #include #include +#define LINK_1TO1 0 +#define LINK_NEGATIVE 1 + using namespace std; class paraq { + private: + struct paralink { + string first; + string second; + int linktype; + }; + public: paraq(int nprocs, int rank); void addRange(const string& paraid, double min, double max, double step); @@ -16,6 +26,17 @@ class paraq { 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; uniqueAllParaIdsAdd(paraid); } + + void linkParas(const string& paraid1, const string ¶id2, int linktype=LINK_1TO1) { + paralink tmpLink; + + tmpLink.first = paraid1; + tmpLink.second = paraid2; + tmpLink.linktype = linktype; + + linkedParas.push_back( tmpLink ); + //linkedParas.push_back( make_pair(paraid1,paraid2) ); + } int getTotalJobs(); string rangeString(); vector allParaIds; @@ -28,12 +49,14 @@ class paraq { map defaultPara; map< string, vector > paraMap; map< string, vector > rangeMap; + vector linkedParas; vector< map > jobList; void initJobList(); bool inParas(vector& paraVec, double& tofind); double masterdefault; bool jobListInitialized; void uniqueAllParaIdsAdd(const string& paraid); + double linkTypeFunction (double linkval, int linktype); }; #endif