+ copyTree = new Tree();
+
+ //if the users enters no groups then give them the score of all groups
+ int numGroups = globaldata->Groups.size();
+ if (numGroups == 0) {
+ numGroups++;
+ for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
+ globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+ }
+ }
+
+ //calculate number of comparsions
+ int numComp = 0;
+ for (int r=0; r<numGroups; r++) {
+ for (int l = r+1; l < numGroups; l++) {
+ numComp++;
+ }
+ }
+
+ //numComp+1 for AB, AC, BC, ABC
+ data.resize(numComp+1,0);
+ vector<string> groups;
+
+ int count = 0;
+ for (int a=0; a<numGroups; a++) {
+ for (int l = a+1; l < numGroups; l++) {
+ int score = 0;
+
+ //groups in this combo
+ groups.push_back(globaldata->Groups[a]); groups.push_back(globaldata->Groups[l]);
+
+ //copy users tree so that you can redo pgroups
+ copyTree->getCopy(t);
+
+ //create pgroups that reflect the groups the user want to use
+ for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+ copyTree->tree[i].pGroups = (copyTree->mergeUserGroups(i, groups));
+ }
+
+ for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+ int lc = copyTree->tree[i].getLChild();
+ int rc = copyTree->tree[i].getRChild();