]> git.donarmstrong.com Git - mothur.git/blobdiff - utilities.hpp
fixed unweighted calculator
[mothur.git] / utilities.hpp
index 8f5009ffc4f0306a5da950e75a541aaa56cfb572..90d10c1cc4e96f34561c37f81738015158957488 100644 (file)
@@ -3,14 +3,8 @@
 
 using namespace std;
 
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <sstream>
-#include <cmath>
-#include <vector>
-#include <stdexcept>
-#include <set>
+#include "mothur.h"
+#include "treemap.h"
 
 typedef unsigned long long ull;
 
@@ -340,8 +334,23 @@ inline void splitAtEquals(string& key, string& value){
        }
 
 }
-/*******************************************************/
-
+/**************************************************************************************************/
 
+inline bool inUsersGroups(string groupname, vector<string> Groups) {
+       try {
+               for (int i = 0; i < Groups.size(); i++) {
+                       if (groupname == Groups[i]) { return true; }
+               }
+               return false;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the utilities class Function inUsersGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the utilities class function inUsersGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
 
 #endif