/***********************************************************************/
-SparseMatrix::SparseMatrix() : numNodes(0), minsIndex(0), smallDist(1e6){}
+SparseMatrix::SparseMatrix() : numNodes(0), minsIndex(0), smallDist(1e6){ m = MothurOut::getInstance(); }
/***********************************************************************/
// clustering and the clustering algorithm updates smallDist
}
catch(exception& e) {
- errorOut(e, "SparseMatrix", "rmCell");
+ m->errorOut(e, "SparseMatrix", "rmCell");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "SparseMatrix", "addCell");
+ m->errorOut(e, "SparseMatrix", "addCell");
exit(1);
}
}
smallDist = 1e6;
}
catch(exception& e) {
- errorOut(e, "SparseMatrix", "clear");
+ m->errorOut(e, "SparseMatrix", "clear");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "SparseMatrix", "print");
+ m->errorOut(e, "SparseMatrix", "print");
exit(1);
}
}
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);
}
}
// if the mins vector is empty go here...
if(mins.empty()){
mins.clear();
-
+
smallDist = begin()->dist; //set the first candidate small distance
for(MatData currentCell=begin();currentCell!=end();currentCell++){
return smallCell;
}
catch(exception& e) {
- errorOut(e, "SparseMatrix", "getSmallestCell");
+ m->errorOut(e, "SparseMatrix", "getSmallestCell");
exit(1);
}
}