-}
-/**************************************************************************/
-vector<float> FullMatrix::getMins(int x) {
- try{
- //clear out old data
- minsForRows.clear();
-
- /************************************************************/
- //fill the minsForRows vector for the box the user wants
- /************************************************************/
- int count = 0;
- int lowBoundx = bounds[0]; //where first group starts
- int lowBoundy = bounds[0];
- int highBoundx = bounds[1]; //where second group starts
- int highBoundy = bounds[1];
-
- int countx = 1; //index in bound
- int county = 1; //index in bound
-
- //find the bounds for the box the user wants
- for (int i = 0; i < (numGroups * numGroups); i++) {
-
- //are you at the box?
- if (count == x) { break; }
- else { count++; }
-
- //move to next box
- if (county < numGroups) {
- county++;
- highBoundy = bounds[county];
- lowBoundy = bounds[county-1];
- }else{ //you are moving to a new row of "boxes"
- county = 1;
- countx++;
- highBoundx = bounds[countx];
- lowBoundx = bounds[countx-1];
- highBoundy = bounds[county];
- lowBoundy = bounds[county-1];
- }
- }
-
- //each row in the box
- for (int x = lowBoundx; x < highBoundx; x++) {
- float min4Row = 100000.0;
- //each entry in that row
- for (int y = lowBoundy; y < highBoundy; y++) {
- //if you are not on the diagonal and you are less than previous minimum
- if ((x != y) && (matrix[x][y] < min4Row)) {
- min4Row = matrix[x][y];
- }
- }
- //save minimum value for that row in minsForRows vector of vectors
- minsForRows.push_back(min4Row);
- }
-
- return minsForRows;
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the FullMatrix class Function getMins. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the FullMatrix class function getMins. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-/**************************************************************************/
-void FullMatrix::getBounds(int& higher, string group) {
- try{
- bool gotLower = false;
-
- //for each group find bounds of subgroup/comparison
- for (it = index.begin(); it != index.end(); it++) {
- if (it->second.groupname == group) {
- gotLower = true;
- }else if ((gotLower == true) && (it->second.groupname != group)) { higher = it->first; break; }
- }
-
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the FullMatrix class Function getBounds. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the FullMatrix class function getBounds. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }