]> git.donarmstrong.com Git - mothur.git/blobdiff - sparsematrix.hpp
changed random forest output filename
[mothur.git] / sparsematrix.hpp
index bcd78997bc3e2450da6373cc3bb760effdbeb4e1..c8a11d70ddfe1fefa640e0e3412cc6f27ba0e579 100644 (file)
@@ -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<PCell>::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<PCell>::iterator);
+       MatData rmCell(MatData);
        void addCell(PCell);
        void clear();
-       list<PCell>::iterator begin();
-       list<PCell>::iterator end();
+       MatData begin();
+       MatData end();
 
 private:
        PCell* smallCell;                               //The cell with the smallest distance
@@ -46,6 +49,7 @@ private:
        vector<PCell*> mins;
        float smallDist;
        int minsIndex;
+       MothurOut* m;
 };
 
 /***********************************************************************/