Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/shared/Interface/AnalyzerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
#include <string.h>


using namespace std;
using std::vector;
using std::ifstream;
using std::ofstream;
using std::endl;

enum DATA_IDX
{
Expand Down
53 changes: 26 additions & 27 deletions src/shared/RealNumberTypes.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
#ifndef REALNUMBERTYPES_H
#define REALNUMBERTYPES_H



using namespace std;

#ifdef GMP_BIGNUM
#include <gmpxx.h>
typedef mpf_class CRealNum;
extern bool pow(mpf_class &res, const mpf_class &base, unsigned long int iExp);
extern bool pow2(mpf_class &res, unsigned long int iExp);
extern bool to_div_2exp(mpf_class &res, const mpf_class &op1, unsigned long int iExp);
extern double to_doubleT(const mpf_class &num);



#else
typedef long double CRealNum;

extern bool pow(CRealNum &res, CRealNum base, unsigned long int iExp);
extern bool pow2(CRealNum &res, unsigned long int iExp);
extern bool to_div_2exp(CRealNum &res, const CRealNum &op1, unsigned long int iExp);
extern long double to_doubleT(const CRealNum &num);
#endif

#endif
#ifndef REALNUMBERTYPES_H
#define REALNUMBERTYPES_H




#ifdef GMP_BIGNUM
#include <gmpxx.h>
typedef mpf_class CRealNum;
extern bool pow(mpf_class &res, const mpf_class &base, unsigned long int iExp);
extern bool pow2(mpf_class &res, unsigned long int iExp);
extern bool to_div_2exp(mpf_class &res, const mpf_class &op1, unsigned long int iExp);
extern double to_doubleT(const mpf_class &num);



#else
typedef long double CRealNum;

extern bool pow(CRealNum &res, CRealNum base, unsigned long int iExp);
extern bool pow2(CRealNum &res, unsigned long int iExp);
extern bool to_div_2exp(CRealNum &res, const CRealNum &op1, unsigned long int iExp);
extern long double to_doubleT(const CRealNum &num);
#endif

#endif
203 changes: 101 additions & 102 deletions src/shared/SomeTime.h
Original file line number Diff line number Diff line change
@@ -1,102 +1,101 @@
#ifndef SOMETIME_H
#define SOMETIME_H

#include<cstdlib>
#include <sys/time.h> // To seed random generator

using namespace std;

extern bool diffTimes(timeval& ret, const timeval &tLater, const timeval &tEarlier);

class CStepTime
{
static int timeVal;

public:

static void makeStart()
{
timeVal = 0;
}

static int getTime()
{
return timeVal;
}

static void stepTime()
{
timeVal++;
}
};



class CStopWatch
{
timeval timeStart;
timeval timeStop;

long int timeBound;

public:

CStopWatch() {}
~CStopWatch() {}

bool timeBoundBroken()
{
timeval actTime;
gettimeofday(&actTime,NULL);

return actTime.tv_sec - timeStart.tv_sec > timeBound;
}

bool markStartTime()
{
return gettimeofday(&timeStart,NULL) == 0;
}

bool markStopTime()
{
return gettimeofday(&timeStop,NULL) == 0;
}


void setTimeBound(long int seconds)
{
timeBound = seconds;
}

long int getTimeBound()
{
return timeBound;
}

double getElapsedTime()
{
timeval r;
double retT;
diffTimes(r,timeStop, timeStart);

retT = r.tv_usec;
retT /= 1000000.0;
retT += (double)r.tv_sec;
return retT;
}

unsigned int getElapsedusecs()
{
unsigned int retT;
timeval r;

diffTimes(r,timeStop, timeStart);

retT = r.tv_usec;

retT += r.tv_sec * 1000000;
return retT;
}
};

#endif
#ifndef SOMETIME_H
#define SOMETIME_H

#include<cstdlib>
#include <sys/time.h> // To seed random generator


extern bool diffTimes(timeval& ret, const timeval &tLater, const timeval &tEarlier);

class CStepTime
{
static int timeVal;

public:

static void makeStart()
{
timeVal = 0;
}

static int getTime()
{
return timeVal;
}

static void stepTime()
{
timeVal++;
}
};



class CStopWatch
{
timeval timeStart;
timeval timeStop;

long int timeBound;

public:

CStopWatch() {}
~CStopWatch() {}

bool timeBoundBroken()
{
timeval actTime;
gettimeofday(&actTime,NULL);

return actTime.tv_sec - timeStart.tv_sec > timeBound;
}

bool markStartTime()
{
return gettimeofday(&timeStart,NULL) == 0;
}

bool markStopTime()
{
return gettimeofday(&timeStop,NULL) == 0;
}


void setTimeBound(long int seconds)
{
timeBound = seconds;
}

long int getTimeBound()
{
return timeBound;
}

double getElapsedTime()
{
timeval r;
double retT;
diffTimes(r,timeStop, timeStart);

retT = r.tv_usec;
retT /= 1000000.0;
retT += (double)r.tv_sec;
return retT;
}

unsigned int getElapsedusecs()
{
unsigned int retT;
timeval r;

diffTimes(r,timeStop, timeStart);

retT = r.tv_usec;

retT += r.tv_sec * 1000000;
return retT;
}
};

#endif
78 changes: 39 additions & 39 deletions src/src_sharpSAT/Basics.cpp
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
#include "Basics.h"
bool CSolverConf::analyzeConflicts = true;
bool CSolverConf::doNonChronBackTracking = true;
bool CSolverConf::allowComponentCaching = true;
bool CSolverConf::allowImplicitBCP = true;
bool CSolverConf::allowPreProcessing = true;
bool CSolverConf::quietMode = false;
bool CSolverConf::smoothNNF = false;
bool CSolverConf::ensureAllLits = true;
bool CSolverConf::disableDynamicDecomp = false;
unsigned int CSolverConf::secsTimeBound = 100000;
unsigned int CSolverConf::maxCacheSize = 0;
int CSolverConf::nodeCount = 0;
char TriValuetoChar(TriValue v)
{
switch (v)
{
case W:
return '1';
case F:
return '0';
case X:
return '.';
};
return '.';
}
#include "Basics.h"


bool CSolverConf::analyzeConflicts = true;
bool CSolverConf::doNonChronBackTracking = true;

bool CSolverConf::allowComponentCaching = true;
bool CSolverConf::allowImplicitBCP = true;

bool CSolverConf::allowPreProcessing = true;

bool CSolverConf::quietMode = false;

bool CSolverConf::smoothNNF = false;

bool CSolverConf::ensureAllLits = true;

bool CSolverConf::disableDynamicDecomp = false;

unsigned int CSolverConf::secsTimeBound = 100000;

size_t CSolverConf::maxCacheSize = 0;

int CSolverConf::nodeCount = 0;


char TriValuetoChar(TriValue v)
{
switch (v)
{
case W:
return '1';
case F:
return '0';
case X:
return '.';
};
return '.';
}
Loading