+
+EstOutput Parsimony::getValues(Tree* t, int p, string o) {
+ try {
+ processors = p;
+ outputDir = o;
+ CountTable* ct = t->getCountTable();
+
+ //if the users enters no groups then give them the score of all groups
+ vector<string> mGroups = m->getGroups();
+ int numGroups = mGroups.size();
+
+ //calculate number of comparsions
+ int numComp = 0;
+ vector< vector<string> > namesOfGroupCombos;
+ for (int r=0; r<numGroups; r++) {
+ for (int l = 0; l < r; l++) {
+ numComp++;
+ vector<string> groups; groups.push_back(mGroups[r]); groups.push_back(mGroups[l]);
+ //cout << globaldata->Groups[r] << '\t' << globaldata->Groups[l] << endl;
+ namesOfGroupCombos.push_back(groups);
+ }
+ }
+
+ //numComp+1 for AB, AC, BC, ABC
+ if (numComp != 1) {
+ vector<string> groups;
+ if (numGroups == 0) {
+ //get score for all users groups
+ vector<string> tGroups = ct->getNamesOfGroups();
+ for (int i = 0; i < tGroups.size(); i++) {
+ if (tGroups[i] != "xxx") {
+ groups.push_back(tGroups[i]);
+ //cout << tmap->namesOfGroups[i] << endl;
+ }
+ }
+ namesOfGroupCombos.push_back(groups);
+ }else {
+ for (int i = 0; i < mGroups.size(); i++) {
+ groups.push_back(mGroups[i]);
+ //cout << globaldata->Groups[i] << endl;
+ }
+ namesOfGroupCombos.push_back(groups);
+ }
+ }
+
+ lines.clear();
+ int numPairs = namesOfGroupCombos.size();
+ int numPairsPerProcessor = numPairs / processors;
+
+ for (int i = 0; i < processors; i++) {
+ int startPos = i * numPairsPerProcessor;
+ if(i == processors - 1){ numPairsPerProcessor = numPairs - i * numPairsPerProcessor; }
+ lines.push_back(linePair(startPos, numPairsPerProcessor));
+ }
+
+ data = createProcesses(t, namesOfGroupCombos, ct);
+
+ return data;
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Parsimony", "getValues");
+ exit(1);
+ }
+}
+/**************************************************************************************************/
+
+EstOutput Parsimony::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, CountTable* ct) {