Libshuff::Libshuff(FullMatrix* D, int it, float step, float co) : matrix(D), iters(it), stepSize(step), cutOff(co){
try{
+ m = MothurOut::getInstance();
groupNames = matrix->getGroups();
groupSizes = matrix->getSizes();
numGroups = matrix->getNumGroups();
-
initializeGroups(matrix);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the Libshuff class Function Libshuff. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "Libshuff", "Libshuff");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the Libshuff class function Libshuff. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-
}
/***********************************************************************/
}
int index=0;
for(int i=0;i<numGroups;i++){
+
for(int j=0;j<groupSizes[i];j++){
savedGroups[i][j] = groups[i][j] = index++;
}
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the Libshuff class Function initializeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "Libshuff", "initializeGroups");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the Libshuff class function initializeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-
}
/***********************************************************************/
try{
vector<double> minX(groupSizes[x], 0);
for(int i=0;i<groupSizes[x];i++){
- minX[i] = (groupSizes[x] > 1 ? (i==0 ? matrix->get(groups[x][0], groups[x][1]) : matrix->get(groups[x][i], groups[x][0])) : 0.0);
+ minX[i] = (groupSizes[x] > 1 ? (i==0 ? matrix->get(groups[x][0], groups[x][1]) : matrix->get(groups[x][i], groups[x][0])) : 0.0); //get the first value in row i of this block
+ //minX[i] = matrix->get(groups[x][i], groups[x][0]);
for(int j=0;j<groupSizes[x];j++){
if(i != j) {
double dx = matrix->get(groups[x][i], groups[x][j]);
return minX;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the Libshuff class Function getMinX. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "Libshuff", "getMinX");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the Libshuff class function getMinX. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-
}
/***********************************************************************/
return minXY;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the Libshuff class Function getMinXY. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "Libshuff", "getMinXY");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the Libshuff class function getMinXY. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
for(int k=0;k<groupSizes[y];k++) { groups[y][k]=v[index++]; }
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the Libshuff class Function randomizeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "Libshuff", "randomizeGroups");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the Libshuff class function randomizeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/