try {
processors = p;
outputDir = o;
-
+
+ CountTable* ct = t->getCountTable();
+
//if the users enters no groups then give them the score of all groups
int numGroups = m->getNumGroups();
vector<string> groups;
if (numGroups == 0) {
//get score for all users groups
- for (int i = 0; i < (tmap->getNamesOfGroups()).size(); i++) {
- if ((tmap->getNamesOfGroups())[i] != "xxx") {
- groups.push_back((tmap->getNamesOfGroups())[i]);
+ for (int i = 0; i < (ct->getNamesOfGroups()).size(); i++) {
+ if ((ct->getNamesOfGroups())[i] != "xxx") {
+ groups.push_back((ct->getNamesOfGroups())[i]);
}
}
namesOfGroupCombos.push_back(groups);
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
- data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
+ data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), ct);
}else{
int numPairs = namesOfGroupCombos.size();
lines.push_back(linePair(startPos, numPairsPerProcessor));
}
- data = createProcesses(t, namesOfGroupCombos);
+ data = createProcesses(t, namesOfGroupCombos, ct);
lines.clear();
}
#else
- data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
+ data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), ct);
#endif
return data;
}
/**************************************************************************************************/
-EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos) {
+EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, CountTable* ct) {
try {
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
process++;
}else if (pid == 0){
EstOutput myresults;
- myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num);
+ myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, ct);
if (m->control_pressed) { exit(0); }
}
}
- results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num);
+ results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, ct);
//force parent to wait until all the processes are done
for (int i=0;i<(processors-1);i++) {
}
}
/**************************************************************************************************/
-EstOutput Unweighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num) {
+EstOutput Unweighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num, CountTable* ct) {
try {
processors = p;
outputDir = o;
+ CountTable* ct = t->getCountTable();
+
//if the users enters no groups then give them the score of all groups
int numGroups = m->getNumGroups();
vector<string> groups;
if (numGroups == 0) {
//get score for all users groups
- for (int i = 0; i < (tmap->getNamesOfGroups()).size(); i++) {
- if ((tmap->getNamesOfGroups())[i] != "xxx") {
- groups.push_back((tmap->getNamesOfGroups())[i]);
+ for (int i = 0; i < (ct->getNamesOfGroups()).size(); i++) {
+ if ((ct->getNamesOfGroups())[i] != "xxx") {
+ groups.push_back((ct->getNamesOfGroups())[i]);
}
}
namesOfGroupCombos.push_back(groups);
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
- data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), true);
+ data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), true, ct);
}else{
int numPairs = namesOfGroupCombos.size();
lines.push_back(linePair(startPos, numPairsPerProcessor));
}
- data = createProcesses(t, namesOfGroupCombos, true);
+ data = createProcesses(t, namesOfGroupCombos, true, ct);
lines.clear();
}
#else
- data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), true);
+ data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), true, ct);
#endif
return data;
}
/**************************************************************************************************/
-EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, bool usingGroups) {
+EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, bool usingGroups, CountTable* ct) {
try {
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
process++;
}else if (pid == 0){
EstOutput myresults;
- myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, usingGroups);
+ myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, usingGroups, ct);
if (m->control_pressed) { exit(0); }
}
}
- results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, usingGroups);
+ results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, usingGroups, ct);
//force parent to wait until all the processes are done
for (int i=0;i<(processors-1);i++) {
}
}
/**************************************************************************************************/
-EstOutput Unweighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num, bool usingGroups) {
+EstOutput Unweighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num, bool usingGroups, CountTable* ct) {
try {
EstOutput results; results.resize(num);
int count = 0;
- Tree* copyTree = new Tree(tmap);
+ Tree* copyTree = new Tree(ct);
for (int h = start; h < (start+num); h++) {