Go to the documentation of this file.00001 #ifndef GLOBAL
00002 #define GLOBAL
00003
00004 #include <cstdlib>
00005 #include <cstring>
00006 #include <iostream>
00007 #include <vector>
00008 #include <cmath>
00009 #include <ctime>
00010 #include <climits>
00011 #include <cfloat>
00012 #include <algorithm>
00013 #include <sstream>
00014 #include <fstream>
00015
00016 #include <boost/random/uniform_int.hpp>
00017 #include <boost/random/uniform_real.hpp>
00018 #include <boost/random/normal_distribution.hpp>
00019 #include <boost/random/variate_generator.hpp>
00020 #include <boost/random/mersenne_twister.hpp>
00021 #include <boost/math/distributions/normal.hpp>
00022 #include <boost/lexical_cast.hpp>
00023
00024 #define HEADER_CONSTANTS "[CONSTANT SIMULATOR PARAMETERS]"
00025 #define HEADER_NAMES "[VARIABLE SIMULATOR PARAMETER NAMES]"
00026 #define HEADER_MIES "[MIES PARAMETERS]"
00027 #define HEADER_SIMULATOR "[SIMULATOR]"
00028 #define HEADER_PARALLEL "[PARALELLIZATION]"
00029 #define LEN 1024 // Number of characters read per line from input file
00030 #define SPACE "#"
00031 #define REPEAT '%'
00032 #define COMMENT ';'
00033 #define DELIMS " ;\t"
00034
00035 #define DEBUG_FROM_GEN 4000 // In case of slow convergence, show debug info
00036
00037 using namespace std;
00038
00039 typedef boost::mt19937 base_generator_type;
00040
00041 extern base_generator_type randGenerator;
00042 extern boost::uniform_real<> uniDistReal;
00043 extern boost::variate_generator<base_generator_type&, boost::uniform_real<> > uniReal;
00044 extern boost::uniform_int<> uniDistInt;
00045 extern boost::variate_generator<base_generator_type&, boost::uniform_int<> > uniInt;
00046 extern boost::normal_distribution<> normDist;
00047 extern boost::variate_generator<base_generator_type&, boost::normal_distribution<> > normReal;
00048 extern boost::math::normal_distribution<> normDistMath;
00049
00050 void randPerm(vector<int>& A, int n);
00051 string itos(int number);
00052 void skipLinesUntil(ifstream& infile, string text);
00053 char* getValue(ifstream& infile);
00054 string getStringValue(ifstream& infile);
00055 void getBound(ifstream& infile, vector<double>* bound_r, vector<int>* bound_d_z, int n);
00056 void findAndReplace(string& text, const char* find, const char* replace);
00057
00058 #endif