]> git.donarmstrong.com Git - mothur.git/blobdiff - calculator.h
removed "shared" from some of the calculator names and classes
[mothur.git] / calculator.h
index 06c3a2425a2a56cbfce3ac3b19b83591dd288c7c..53e5c5a52578e7babcff8c487329cf320a5aa360 100644 (file)
@@ -3,21 +3,13 @@
 
 using namespace std;
 
-#include <vector>
-#include <cmath>
-#include <iostream>
-#include <fstream>
-#include <math.h>
-#include <string>
-#include <map>
-#include <algorithm>
-#include "utilities.hpp"
+#include "mothur.h"
 #include "sabundvector.hpp"
 #include "sharedsabundvector.h"
 #include "rabundvector.hpp"
 #include "uvest.h"
 
-/* The calculator class is the parent class for all the different estimators implemented in mothur.
+/* 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 
 EstOutput getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2), which compares 2 groups. */ 
 
@@ -54,14 +46,18 @@ class VecCalc
 {
        // The methods seen in the order here is how they are ordered throughout the class.
        public:
+               VecCalc(){};
                void printElements(vector<double>); //This prints the values of the vector on one line with a space between each value.
                void printElements(vector<string>); //This prints the values of the vector on one line with a space between each value.
                int findString(vector<string>, string);//This returns the index of the given string in the given <string> vector, if the string does not exist in the vector it returns -1.
                double mean(vector<double>); //This returns the mean value of the vector.
                double stError(vector<double>); //This returns the standard error of the vector.
+               int sumElements(vector<int>, int);
+               int sumElements(vector<int>);
                double sumElements(vector<double>); //This returns the sum of all the values in the vector.
                double sumElements(vector<double>, int); //This returns the sum of all the values in the vector excluding those whose index is before the given index.  
                double findMax(vector<double>); //This returns the maximum value in the vector.
+               int numNZ(vector<int>); //This returns the number of non-zero values in the vector.
                double numNZ(vector<double>); //This returns the number of non-zero values in the vector.
                double numPos(vector<double>); //This returns the number of positive values in the vector.
                double findMaxDiff(vector<double>, vector<double>); //This returns the absolute value of the maximum difference between the two vectors.
@@ -93,7 +89,7 @@ each combination. It also calculates the overall diversity for Whittaker's measu
 the Marczewski-Steinhaus distance.*/
 
 
-class BDiversity
+/*class BDiversity
 {
        public:
                void doBD(vector<double>, double);//Main method
@@ -102,7 +98,7 @@ class BDiversity
                double getSor(vector<double>, vector<double>);//Sorensen quantitative index
                double getMor(vector<double>, vector<double>);//Morisita-Horn index
                void printD(vector<vector<double> >, int);//This prints a table that represents the given 2D vector, the second paramter specifies which method is to be used (1 for Whitt, 2 for MS, 3 for Sor, and 4 for Mor)
-};
+};*/
 
 /**************************************************************************************************/
 
@@ -122,11 +118,11 @@ class BrokenStick
 It prints the D-Statistic and the critical values for the Kolmogorov-Smirnov
 1-sample test at the 95% confidence interval.*/
 
-class GeometricSeries
+/*class GeometricSeries
 {
        public:
                void doGeomTest(vector<double>);
-};
+};*/
 
 /**************************************************************************************************/
 //This Class calculates the jackknifed estimate of the data and
@@ -152,11 +148,11 @@ class KS2SampleTest
 It then generates a D-Statistic and prints the D-Statistic and
 the critical values for the Kolmogorov-Smirnov 1 sample test.*/
 
-class LogSD
+/*class LogSD
 {
        public:
                void doLogSD(vector<double>, vector<double>);
-};
+};*/
 
 /**************************************************************************************************/
 //This Class calculates and prints the Q-Statistic for the data.
@@ -182,6 +178,14 @@ class TDTable
                double getConfLimit(int,int);
 };
 
+/**************************************************************************************************/
+//This Class stores the table of the confidence limits of the One-Sample Kolmogorov-Smirnov Test.
+class KOSTable
+{
+       public:
+               double getConfLimit(int);
+};
+
 /**************************************************************************************************/
 /*This Class calculates the truncated lognormal for the data.
 It then prints the D-Statistic and the critical values for the