]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.h
added help for alignment code and thomas' calcs to project
[mothur.git] / mothur.h
index 8ad1645a57a5345a7f48ca8236d83963d8700afc..2c9595ebe53c4055179f2297372bb1e691fff8ab 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -15,6 +15,7 @@ using namespace std;
 
 /* This file contains all the standard incudes we use in the project as well as some common utilities. */
 
+//#include <cstddef>
 
 //io libraries
 #include <iostream>
@@ -221,6 +222,13 @@ inline int factorial(int num){
        
        return total;
 }
+/**************************************************************************************************
+
+double min(double x, double y)
+{
+    if(x<y){   return x;    }
+    else   {   return y;    }
+}
 
 /***********************************************************************/
 
@@ -265,6 +273,21 @@ inline int openOutputFile(string fileName, ofstream& fileHandle){
        }
 
 }
+/***********************************************************************/
+
+inline int openOutputFileAppend(string fileName, ofstream& fileHandle){
+       
+       fileHandle.open(fileName.c_str(), ios::app);
+       if(!fileHandle) {
+               cerr << "Error: Could not open " << fileName << endl;
+               return 1;
+       }
+       else {
+               return 0;
+       }
+
+}
+
 
 /***********************************************************************/