#include "calculator.h"
-/***********************************************************************/
+/***********************************************************************
void VecCalc::printElements(vector<double> vec){
try {
for(int i = 0; i < vec.size(); i++)
}
}
-/***********************************************************************/
+/***********************************************************************
void VecCalc::printElements(vector<string> vec){
try {
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
int VecCalc::findString(vector<string> vec, string str){
try {
for(int i = 0; i < vec.size(); i++)
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
double VecCalc::mean(vector<double> vec){
return sumElements(vec)/vec.size();
}
-/***********************************************************************/
+/***********************************************************************
double VecCalc::stError(vector<double> vec){
try {
double sum = 0;
return sumElements(vec,0);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the VecCalc class Function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "VecCalc", "sumElements");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the VecCalc class function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
int VecCalc::sumElements(vector<int> vec, int index){
return sum;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the VecCalc class Function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "VecCalc", "sumElements");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the VecCalc class function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
return sum;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the VecCalc class Function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "VecCalc", "sumElements");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the VecCalc class function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
double VecCalc::sumElements(vector<double> vec, int index){
return sum;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the VecCalc class Function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "VecCalc", "sumElements");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the VecCalc class function sumElements. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
-/***********************************************************************/
+/***********************************************************************
double VecCalc::findMax(vector<double> vec){
try {
double max = -1000000.0;
return numNZ;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the VecCalc class Function numNZ. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "VecCalc", "numNZ");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the VecCalc class function numNZ. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
/***********************************************************************/
double VecCalc::numNZ(vector<double> vec){
return numNZ;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the VecCalc class Function numNZ. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "VecCalc", "numNZ");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the VecCalc class function numNZ. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
-/***********************************************************************/
+/***********************************************************************
double VecCalc::numPos(vector<double> vec){
try {
double numPos = 0;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
double VecCalc::findMaxDiff(vector<double> vec1, vector<double> vec2){
try {
double maxDiff = -10000000000.0;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
double VecCalc::findDStat(vector<double> vec1, vector<double> vec2, double num){
try {
double mDiff = findMaxDiff(vec1, vec2);
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<int> VecCalc::findQuartiles(vector<double> vec){
try {
vector<int> quartiles;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::add(vector<double> vec, double x){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::multiply(vector<double> vec, double x){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::power(vector<double> vec, double p){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::addVecs(vector<double> vec1, vector<double> vec2) //Vectors must be the same size.
{ try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::multVecs(vector<double> vec1, vector<double> vec2) //Vectors must be the same size.
{ try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::remDup(vector<double> vec){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::genCVec(vector<double> vec1){
try {
vector<double> vec2;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::genRelVec(vector<double> vec){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::genDiffVec(vector<double> vec1, vector<double> vec2){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::genCSVec(vector<double> vec){
try {
vector<double> newVec;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::genTotVec(vector<vector<double> > vec){
try {
vector<double> newVec = vec.at(0);
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<double> VecCalc::quicksort(vector<double> vec){
try {
sort(vec.rbegin(), vec.rend());
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<vector<double> > VecCalc::gen2DVec(vector<double> vec, int div, int type){
try {
vector<vector<double> > vec2D;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
vector<string> VecCalc::getSData(char name[]){
try {
vector<string> vec;
}
/***********************************************************************/
-/***********************************************************************/
+/***********************************************************************
void BrokenStick::doBStick(vector<double> vec)//vec = The data vector.
{ try {
VecCalc vecCalc;
}
}
-/***********************************************************************/
+/***********************************************************************
double kEq(double k, double spec)
{
return k/(1-k)*pow(1-k, spec)/(1-pow(1-k, spec));
}
}*/
-/***********************************************************************/
+/***********************************************************************
void Jackknifing::doJK(vector<double> vec, double cols)//vec = the data vector if the data table was read left-to-right, top-to-bottom. cols = The number of columns in the data table.
{ try {
VecCalc vecCalc;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
void KS2SampleTest::doKSTest(vector<double> abun1, vector<double> abun2)//abun1 = 1st vector of abundances, abun2 = 2nd vector of abundances
{ try {
VecCalc vecCalc;
}
}
-/***********************************************************************/
+/***********************************************************************
void QStatistic::doQStat(vector<double> vec)//vec = The data vector.
{ try {
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
double SSBPDiversityIndices::getShan(vector<double> vec)//vec = The data vector.
{ try {
VecCalc vecCalc;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
double SSBPDiversityIndices::getSimp(vector<double> vec)//vec = The data vector.
{ try {
VecCalc vecCalc;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
double SSBPDiversityIndices::getBP(vector<double> vec)//vec = The data vector.
{ try {
VecCalc vecCalc;
exit(1);
}
}
-/***********************************************************************/
+/***********************************************************************
void SSBPDiversityIndices::doSSBP(vector<double> vec)//vec = The data vector.
{ try {
VecCalc vecCalc;
//Found on http://www.vgtu.lt/leidiniai/elektroniniai/Probability.pdf/Table%203.pdf
//Confidence Level .90 .95 .975 .99 .995 .999 .9995
- double values[33][7] = {{3.078, 6.314, 12.706, 31.821, 63.656, 318.289, 636.578},
+ double values[30][7] = {{3.078, 6.314, 12.706, 31.821, 63.656, 318.289, 636.578},
{1.886, 2.920, 4.303, 6.965, 9.925, 22.328, 31.600},
{1.638, 2.353, 3.182, 4.541, 5.841, 10.214, 12.924},
{1.533, 2.132, 2.776, 3.747, 4.604, 7.173, 8.610},
{1.314, 1.703, 2.052, 2.473, 2.771, 3.421, 3.689},
{1.313, 1.701, 2.048, 2.467, 2.763, 3.408, 3.674},
{1.311, 1.699, 2.045, 2.462, 2.756, 3.396, 3.660},
- {1.310, 1.697, 2.042, 2.457, 2.750, 3.385, 3.646},
- {1.296, 1.671, 2.000, 2.390, 2.660, 3.232, 3.460},
- {1.289, 1.658, 1.980, 2.358, 2.617, 3.160, 3.373},
- {1.282, 1.645, 1.960, 2.326, 2.576, 3.091, 3.291}};
+ {1.310, 1.697, 2.042, 2.457, 2.750, 3.385, 3.646}};
+
return values[row][col];
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the TDTable class Function getConfLimit. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ errorOut(e, "TDTable", "getConfLimit");
exit(1);
}
- catch(...) {
- cout << "An unknown error has occurred in the TDTable class function getConfLimit. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
}
-/***********************************************************************/
+/***********************************************************************
double KOSTable::getConfLimit(int index) //Table of Critical values for N = 4-20 for One-Sample Kolmogorov-Smirnov Test
{ try {
//Confidence Level = .05