X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sparsematrix.cpp;fp=sparsematrix.cpp;h=bd54433458982de8689d48a483bfe44e806bd66e;hb=74844a60d80c6dd06e3fb02ee9b928424f9019b0;hp=7477bd9365fa2f8c77319c0b6c0cb1f94ac85f24;hpb=a218321731df14d231bbc08e79906f757cf1540d;p=mothur.git diff --git a/sparsematrix.cpp b/sparsematrix.cpp index 7477bd9..bd54433 100644 --- a/sparsematrix.cpp +++ b/sparsematrix.cpp @@ -5,7 +5,7 @@ /***********************************************************************/ -SparseMatrix::SparseMatrix() : numNodes(0), minsIndex(0), smallDist(1e6){} +SparseMatrix::SparseMatrix() : numNodes(0), minsIndex(0), smallDist(1e6){ m = MothurOut::getInstance(); } /***********************************************************************/ @@ -34,7 +34,7 @@ MatData SparseMatrix::rmCell(MatData data){ // clustering and the clustering algorithm updates smallDist } catch(exception& e) { - errorOut(e, "SparseMatrix", "rmCell"); + m->errorOut(e, "SparseMatrix", "rmCell"); exit(1); } } @@ -50,7 +50,7 @@ void SparseMatrix::addCell(PCell value){ } } catch(exception& e) { - errorOut(e, "SparseMatrix", "addCell"); + m->errorOut(e, "SparseMatrix", "addCell"); exit(1); } } @@ -66,7 +66,7 @@ void SparseMatrix::clear(){ smallDist = 1e6; } catch(exception& e) { - errorOut(e, "SparseMatrix", "clear"); + m->errorOut(e, "SparseMatrix", "clear"); exit(1); } } @@ -97,7 +97,7 @@ void SparseMatrix::print(){ } } catch(exception& e) { - errorOut(e, "SparseMatrix", "print"); + m->errorOut(e, "SparseMatrix", "print"); exit(1); } } @@ -108,15 +108,15 @@ void SparseMatrix::print(ListVector* list){ try { int index = 0; - mothurOutEndLine(); mothurOut("Index\tRow\tColumn\tDistance"); mothurOutEndLine(); + m->mothurOutEndLine(); m->mothurOut("Index\tRow\tColumn\tDistance"); m->mothurOutEndLine(); for(MatData currentCell=matrix.begin();currentCell!=matrix.end();currentCell++){ - mothurOut(toString(index) + "\t" + toString(list->get(currentCell->row)) + "\t" + toString(list->get(currentCell->column)) + "\t" + toString(currentCell->dist)); mothurOutEndLine(); + m->mothurOut(toString(index) + "\t" + toString(list->get(currentCell->row)) + "\t" + toString(list->get(currentCell->column)) + "\t" + toString(currentCell->dist)); m->mothurOutEndLine(); index++; } } catch(exception& e) { - errorOut(e, "SparseMatrix", "print"); + m->errorOut(e, "SparseMatrix", "print"); exit(1); } } @@ -168,7 +168,7 @@ PCell* SparseMatrix::getSmallestCell(){ return smallCell; } catch(exception& e) { - errorOut(e, "SparseMatrix", "getSmallestCell"); + m->errorOut(e, "SparseMatrix", "getSmallestCell"); exit(1); } }