+void FullMatrix::swapRows(int i, int j) {
+ try {
+
+ float y;
+ string z, name;
+
+ /* swap rows*/
+ for (int h = 0; h < numSeqs; h++) {
+ y = matrix[i][h];
+ matrix[i][h] = matrix[j][h];
+ matrix[j][h] = y;
+ }
+
+ /* swap columns*/
+ for (int b = 0; b < numSeqs; b++) {
+ y = matrix[b][i];
+ matrix[b][i] = matrix[b][j];
+ matrix[b][j] = y;
+ }
+
+ //swap map elements
+ z = index[i].groupName;
+ index[i].groupName = index[j].groupName;
+ index[j].groupName = z;
+
+ name = index[i].seqName;
+ index[i].seqName = index[j].seqName;
+ index[j].seqName = name;
+
+
+ }
+ catch(exception& e) {
+ errorOut(e, "FullMatrix", "swapRows");
+ exit(1);
+ }
+}
+/**************************************************************************/
+
+float FullMatrix::get(int i, int j){ return matrix[i][j]; }
+
+/**************************************************************************/
+
+vector<string> FullMatrix::getGroups(){ return groups; }
+
+/**************************************************************************/
+
+vector<int> FullMatrix::getSizes(){ return sizes; }
+
+/**************************************************************************/
+
+int FullMatrix::getNumGroups(){ return groups.size(); }
+
+/**************************************************************************/
+
+int FullMatrix::getNumSeqs(){ return numSeqs; }
+
+/**************************************************************************/
+
+void FullMatrix::printMatrix(ostream& out) {
+ try{
+ for (int i = 0; i < numSeqs; i++) {
+ out << "row " << i << " group = " << index[i].groupName << " name = " << index[i].seqName << endl;
+ for (int j = 0; j < numSeqs; j++) {
+ out << i << '\t' << j << '\t' << matrix[i][j] << endl;
+ }
+ out << endl;
+ }
+
+ for (int i = 0; i < numSeqs; i++) { out << i << '\t' << index[i].seqName << endl; }
+ }
+ catch(exception& e) {
+ errorOut(e, "FullMatrix", "printMatrix");
+ exit(1);
+ }
+}
+
+/**************************************************************************/
+