X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sparsematrix.hpp;h=c8a11d70ddfe1fefa640e0e3412cc6f27ba0e579;hp=bcd78997bc3e2450da6373cc3bb760effdbeb4e1;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=bfbc55964f1977da72c2cea984288a427d370a59 diff --git a/sparsematrix.hpp b/sparsematrix.hpp index bcd7899..c8a11d7 100644 --- a/sparsematrix.hpp +++ b/sparsematrix.hpp @@ -1,8 +1,8 @@ #ifndef SPARSEMATRIX_H #define SPARSEMATRIX_H -#include "utilities.hpp" #include "mothur.h" +#include "mothurout.h" class ListVector; @@ -21,21 +21,24 @@ class ListVector; /***********************************************************************/ +typedef list::iterator MatData; + class SparseMatrix { public: SparseMatrix(); + ~SparseMatrix(){ while(!mins.empty() && mins.back() == NULL){ mins.pop_back(); } } int getNNodes(); void print(); //Print the contents of the matrix - void print(ListVector*); //Print the contents of the matrix + void print(ListVector*); //Print the contents of the matrix PCell* getSmallestCell(); //Return the cell with the smallest distance float getSmallDist(); - void rmCell(list::iterator); + MatData rmCell(MatData); void addCell(PCell); void clear(); - list::iterator begin(); - list::iterator end(); + MatData begin(); + MatData end(); private: PCell* smallCell; //The cell with the smallest distance @@ -46,6 +49,7 @@ private: vector mins; float smallDist; int minsIndex; + MothurOut* m; }; /***********************************************************************/