]> git.donarmstrong.com Git - mothur.git/blobdiff - calculator.h
added phylip as output file type for commands that output distance matrices. added...
[mothur.git] / calculator.h
index ffc92b929f75fe7164301f94f969e384ad9d907a..6791d830f01c69492251b6110ebe5ba3d04a50a0 100644 (file)
@@ -7,6 +7,7 @@
 #include "sharedsabundvector.h"
 #include "rabundvector.hpp"
 #include "uvest.h"
+#include "mothurout.h"
 
 /* The calculator class is the parent class for all the different estimators implemented in mothur except the tree calculators.
 It has 2 pure functions EstOutput getValues(SAbundVector*), which works on a single group, and 
@@ -20,9 +21,10 @@ typedef vector<double> EstOutput;
 class Calculator {
 
 public:
-       Calculator(){};
+       Calculator(){ m = MothurOut::getInstance(); needsAll = false; }
        virtual ~Calculator(){};
-       Calculator(string n, int c, bool m) : name(n), cols(c), multiple(m) {};
+       Calculator(string n, int c, bool f) : name(n), cols(c), multiple(f) { m = MothurOut::getInstance(); needsAll = false; };
+       Calculator(string n, int c, bool f, bool a) : name(n), cols(c), multiple(f), needsAll(a) { m = MothurOut::getInstance(); };
        virtual EstOutput getValues(SAbundVector*) = 0; 
        virtual EstOutput getValues(vector<SharedRAbundVector*>) = 0;
        virtual void print(ostream& f)  { f.setf(ios::fixed, ios::floatfield); f.setf(ios::showpoint);
@@ -30,11 +32,16 @@ public:
        virtual string getName()                {       return name;    }
        virtual int getCols()           {       return cols;    }
        virtual bool getMultiple()  {   return multiple;   }
+       virtual bool getNeedsAll()  {   return needsAll;   }
+       virtual string getCitation() = 0;
+       void citation() { m->mothurOut(getCitation()); m->mothurOutEndLine(); }
 protected:
+       MothurOut* m;
        EstOutput data;
        string name;
        int cols;
        bool multiple;
+       bool needsAll;
 
 };
 
@@ -93,7 +100,7 @@ class BrokenStick
                void doBStick(vector<double>);
 };
 
-/**************************************************************************************************/
+//**************************************************************************************************/
 /*This Class calculates the geometric series distribution for the data.
 It prints the D-Statistic and the critical values for the Kolmogorov-Smirnov
 1-sample test at the 95% confidence interval.*/