/* This file contains all the standard incudes we use in the project as well as some common utilities. */
+//#include <cstddef>
//io libraries
#include <iostream>
typedef unsigned long long ull;
-
+struct IntNode {
+ int lvalue;
+ int rvalue;
+ int lcoef;
+ int rcoef;
+ IntNode* left;
+ IntNode* right;
+};
+
/***********************************************************************/
// snagged from http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.2
return output.str();
}
-
//**********************************************************************************************************************
template<typename T>
return simpleName;
}
+/***********************************************************************/
+
+inline int factorial(int num){
+ int total = 1;
+
+ for (int i = 1; i <= num; i++) {
+ total *= i;
+ }
+
+ return total;
+}
+/**************************************************************************************************
+
+double min(double x, double y)
+{
+ if(x<y){ return x; }
+ else { return y; }
+}
/***********************************************************************/
}
}
+/***********************************************************************/
+
+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;
+ }
+
+}
+
/***********************************************************************/