#include <cmath>
#include <math.h>
#include <algorithm>
+#include <ctime>
+
+#ifdef _WIN32
+ #define exp(x) (exp((double) x))
+ #define sqrt(x) (sqrt((double) x))
+ #define log10(x) (log10((double) x))
+ #define log2(x) (log10(x)/log10(2))
+#endif
+
typedef unsigned long long ull;
IntNode* left;
IntNode* right;
};
-
+
+struct ThreadNode {
+ int* pid;
+ IntNode* left;
+ IntNode* right;
+};
+
/***********************************************************************/
// snagged from http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.2
f.putback(d);
}
+/***********************************************************************/
+
+inline bool isTrue(string f){
+
+ if ((f == "TRUE") || (f == "T") || (f == "true") || (f == "t")) { return true; }
+ else { return false; }
+}
/***********************************************************************/
return simpleName;
}
+
/***********************************************************************/
inline int factorial(int num){
string rootPathName = longName;
- if(longName.find_last_of("/") != longName.npos){
+ if(longName.find_last_of('/') != longName.npos){
int pos = longName.find_last_of('/')+1;
rootPathName = longName.substr(0, pos);
}
/***********************************************************************/
+inline string getExtension(string longName){
+
+ string extension = longName;
+
+ if(longName.find_last_of('.') != longName.npos){
+ int pos = longName.find_last_of('.');
+ extension = longName.substr(pos, longName.length());
+ }
+
+ return extension;
+}
+
+/***********************************************************************/
+
inline int openInputFile(string fileName, ifstream& fileHandle){
fileHandle.open(fileName.c_str());
}
+/***********************************************************************/
+
+inline int getNumSeqs(ifstream& file){
+
+ int numSeqs = count(istreambuf_iterator<char>(file),istreambuf_iterator<char>(), '>');
+ file.seekg(0);
+ return numSeqs;
+
+}
+
/***********************************************************************/
//This function parses the estimator options and puts them in a vector