X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sparsematrix.hpp;h=c8a11d70ddfe1fefa640e0e3412cc6f27ba0e579;hb=541bab1dac00688b4c3a8c4a95ab464412663c50;hp=d65771e75a4d8a2785535fd2ae9cd493f2c1aa1f;hpb=c5c7502f435e1413c19e373dab1dfebcaa67588d;p=mothur.git diff --git a/sparsematrix.hpp b/sparsematrix.hpp index d65771e..c8a11d7 100644 --- a/sparsematrix.hpp +++ b/sparsematrix.hpp @@ -2,6 +2,7 @@ #define SPARSEMATRIX_H #include "mothur.h" +#include "mothurout.h" class ListVector; @@ -20,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 @@ -45,6 +49,7 @@ private: vector mins; float smallDist; int minsIndex; + MothurOut* m; }; /***********************************************************************/