]> git.donarmstrong.com Git - mothur.git/blobdiff - suffixnodes.hpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / suffixnodes.hpp
index 863a3ae523787530c454aeda1ef6b4632fe9a34f..1e078a63a759a99b4b47ed123526da752e2404bd 100644 (file)
@@ -17,8 +17,7 @@
  */
 
 #include "mothur.h"
-
-using namespace std;
+#include "mothurout.h"
 
 //********************************************************************************************************************
 
@@ -26,6 +25,8 @@ class SuffixNode {
        
 public:
        SuffixNode(int, int, int);
+       SuffixNode(const SuffixNode& sn) : parentNode(sn.parentNode), startCharPosition(sn.startCharPosition), endCharPosition(sn.endCharPosition) {m = MothurOut::getInstance();}
+       virtual ~SuffixNode() {}
        virtual void print(string, int) = 0;
        virtual void setChildren(char, int);
        virtual int getNumChildren();
@@ -43,6 +44,7 @@ protected:
        int parentNode;
        int startCharPosition;
        int endCharPosition;
+       MothurOut* m;
 };
 
 //********************************************************************************************************************
@@ -51,6 +53,7 @@ class SuffixLeaf : public SuffixNode {        //      most of the methods are already set in
        
 public:
        SuffixLeaf(int, int, int);              //      we just need to define a constructor and
+       ~SuffixLeaf() {}
        void print(string, int);                //      print method
 };
 
@@ -60,6 +63,8 @@ class SuffixBranch : public SuffixNode {
        
 public:
        SuffixBranch(int, int, int);
+       SuffixBranch(const SuffixBranch& sb) : suffixNode(sb.suffixNode), childNodes(sb.childNodes), SuffixNode(sb.parentNode, sb.startCharPosition, sb.endCharPosition) {}
+       ~SuffixBranch() {}
        void print(string, int);                //      need a special method for printing the node because there are children
        void eraseChild(char);                  //      need a special method for erasing the children
        void setChildren(char, int);    //      need a special method for setting children