]> git.donarmstrong.com Git - mothur.git/blobdiff - suffixtree.cpp
added stricter compilation requirements and fixed resulting errors
[mothur.git] / suffixtree.cpp
index 56ce6ed91829c5d2783e4c42f9c4f7b388340bca..53a6d3f8bc690ffec892d31eec5cb47a59ecd0e2 100644 (file)
@@ -26,7 +26,6 @@
 #include "suffixnodes.hpp"
 #include "suffixtree.hpp"
 
-using namespace std;
 
 //********************************************************************************************************************
 
@@ -42,16 +41,17 @@ SuffixTree::SuffixTree(){}
 
 SuffixTree::~SuffixTree(){
        for(int i=0;i<nodeVector.size();i++){   delete nodeVector[i];   }       
+       nodeVector.clear();
 }
 
 //********************************************************************************************************************
 
-void SuffixTree::loadSequence(Sequence* seq){
+void SuffixTree::loadSequence(Sequence seq){
        nodeCounter = 0;                                                        //      initially there are 0 nodes in the tree
        activeStartPosition = 0;
        activeEndPosition = -1;                                         
-       seqName = seq->getName();
-       sequence = seq->convert2ints();
+       seqName = seq.getName();
+       sequence = seq.convert2ints();
        sequence += '5';                                                        //      this essentially concatenates a '$' to the end of the sequence to
        int seqLength = sequence.length();                      //      make it a cononical suffix tree
        
@@ -75,7 +75,7 @@ string SuffixTree::getSeqName()       {
 void SuffixTree::print(){
        vector<SuffixNode*> hold = nodeVector;
        sort(hold.begin(), hold.end(), compareParents);
-       cout << "Address\t\tParent\tNode\tSuffix\tStartC\tEndC\tSuffix" << endl;
+       mothurOut("Address\t\tParent\tNode\tSuffix\tStartC\tEndC\tSuffix"); mothurOutEndLine();
        for(int i=1;i<=nodeCounter;i++){
                hold[i]->print(sequence, i);
        }