X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=fullmatrix.cpp;fp=fullmatrix.cpp;h=0255d07f00bbcfef3a9c62658149ec39fd6fc5bf;hb=74844a60d80c6dd06e3fb02ee9b928424f9019b0;hp=5612041528a00e9e0e441422662c6d3738bcb07c;hpb=a218321731df14d231bbc08e79906f757cf1540d;p=mothur.git diff --git a/fullmatrix.cpp b/fullmatrix.cpp index 5612041..0255d07 100644 --- a/fullmatrix.cpp +++ b/fullmatrix.cpp @@ -13,6 +13,7 @@ //This constructor reads a distance matrix file and stores the data in the matrix. FullMatrix::FullMatrix(ifstream& filehandle) { try{ + m = MothurOut::getInstance(); globaldata = GlobalData::getInstance(); groupmap = globaldata->gGroupmap; @@ -25,7 +26,7 @@ FullMatrix::FullMatrix(ifstream& filehandle) { matrix[i].resize(numSeqs, 0.0); } group = groupmap->getGroup(name); - if(group == "not found") { mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); mothurOutEndLine(); exit(1); } + if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } index.resize(numSeqs); index[0].seqName = name; index[0].groupName = group; @@ -62,7 +63,7 @@ FullMatrix::FullMatrix(ifstream& filehandle) { } catch(exception& e) { - errorOut(e, "FullMatrix", "FullMatrix"); + m->errorOut(e, "FullMatrix", "FullMatrix"); exit(1); } } @@ -84,7 +85,7 @@ void FullMatrix::readSquareMatrix(ifstream& filehandle) { index[i].seqName = name; index[i].groupName = group; - if(group == "not found") { mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); mothurOutEndLine(); exit(1); } + if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } for(int j=0;j> matrix[i][j]; @@ -97,7 +98,7 @@ void FullMatrix::readSquareMatrix(ifstream& filehandle) { delete reading; } catch(exception& e) { - errorOut(e, "FullMatrix", "readSquareMatrix"); + m->errorOut(e, "FullMatrix", "readSquareMatrix"); exit(1); } } @@ -119,7 +120,7 @@ void FullMatrix::readLTMatrix(ifstream& filehandle) { index[i].seqName = name; index[i].groupName = group; - if(group == "not found") { mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); mothurOutEndLine(); exit(1); } + if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } for(int j=0;j> distance; @@ -133,7 +134,7 @@ void FullMatrix::readLTMatrix(ifstream& filehandle) { delete reading; } catch(exception& e) { - errorOut(e, "FullMatrix", "readLTMatrix"); + m->errorOut(e, "FullMatrix", "readLTMatrix"); exit(1); } } @@ -176,7 +177,7 @@ void FullMatrix::sortGroups(int low, int high){ } catch(exception& e) { - errorOut(e, "FullMatrix", "sortGroups"); + m->errorOut(e, "FullMatrix", "sortGroups"); exit(1); } } @@ -214,7 +215,7 @@ void FullMatrix::swapRows(int i, int j) { } catch(exception& e) { - errorOut(e, "FullMatrix", "swapRows"); + m->errorOut(e, "FullMatrix", "swapRows"); exit(1); } } @@ -253,7 +254,7 @@ void FullMatrix::printMatrix(ostream& out) { for (int i = 0; i < numSeqs; i++) { out << i << '\t' << index[i].seqName << endl; } } catch(exception& e) { - errorOut(e, "FullMatrix", "printMatrix"); + m->errorOut(e, "FullMatrix", "printMatrix"); exit(1); } }