11#ifndef _USE_MATH_DEFINES
12#define _USE_MATH_DEFINES
15#define drand48() (double(rand()) / RAND_MAX)
17#define srand48(seed) srand(seed)
30#ifdef SINGLE_PRECISION
31#define REAL_TYPE float
32#define REAL_TYPE_STRING "float"
33#define REAL_MAX FLT_MAX
35#define REAL_TYPE double
36#define REAL_TYPE_STRING "double"
37#define REAL_MAX DBL_MAX
40#define DBL_SIGNIFICANT_DIGITS 14
41#define FLT_SIGNIFICANT_DIGITS 7
43#ifdef SINGLE_PRECISION
44#define REAL_SIGNIFICANT_DIGITS FLT_SIGNIFICANT_DIGITS
46#define REAL_SIGNIFICANT_DIGITS DBL_SIGNIFICANT_DIGITS
50#define M_PI 3.14159265358979323846
55#ifdef SINGLE_PRECISION
71 static std::vector<std::string>
73 const std::string &extension);
75 static int mkDir(
const std::string &directoryName);
79 static int rmDir(
const std::string &directoryName);
81 static int rmFile(
const std::string &fileName);
87 const double upperBound = ceil(val);
88 const double lowerBound = floor(val);
90 if(upperBound - val <= val - lowerBound) {
91 return (
int)upperBound;
93 return (
int)lowerBound;
float getInitialMemoryUsage()
static float getTotalMemoryUsage()
static int getCurrentDirectory(std::string &directoryPath)
static std::vector< std::string > listFilesInDirectory(const std::string &directoryName, const std::string &extension)
static float getMemoryInstantUsage()
static int nearbyint(const double &x)
static int rmDir(const std::string &directoryName)
static int roundToNearestInt(const double &val)
static int mkDir(const std::string &directoryName)
static int getNumberOfCores()
static int rmFile(const std::string &fileName)