Skip to content

Commit

Permalink
Small changes toward a compilation under MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
marekpiotrow committed Nov 2, 2021
1 parent 4765a10 commit 3173c59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ADTs/Int.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Int {
mpz_init_set_si(*data, x);
}

Int(long x) {
explicit Int(int64_t x) {
data = xmalloc<mpz_t>(1); assert(((intp)data & 1) == 0);
mpz_init_set_si(*data, x);
}
Expand Down
2 changes: 1 addition & 1 deletion PbParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ void parse_PB_file(cchar* filename, PbSolver& solver, bool old_format, bool abor
template<class B, class S>
static bool parse_WCNF(B& in, S& solver, bool abort_on_error)
{
Int hard_bound = WEIGHT_MAX;
Int hard_bound = Int(WEIGHT_MAX);
bool wcnf_format = true;

try{
Expand Down
4 changes: 2 additions & 2 deletions Pre_separator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ void separationIndex(const vec<weight_t>& cs, vec<int>& separation_points) {
lw.push(cs[0]);
for(int i=1; i<cs.size(); i++) { lw.push(cs[i] + lw[i-1]); }

weight_t rdiff = LONG_MAX, rgcd = cs[cs.size()-1];
weight_t rdiff = WEIGHT_MAX, rgcd = cs[cs.size()-1];

// search for separation points (generalized Boolean multilevel optimization points)
for (int i = cs.size() - 2; i > 1; i--) {
rgcd = gcd(cs[i], rgcd);
rdiff = min(rdiff, cs[i] == cs[i+1] ? LONG_MAX : cs[i+1] - cs[i]);
rdiff = min(rdiff, cs[i] == cs[i+1] ? WEIGHT_MAX : cs[i+1] - cs[i]);
bool final_split = lw[i-1] <= rgcd;
bool potential_split = lw[i-1] <= cs[i] && lw[i-1] <= rdiff;
char res = 'N';
Expand Down

0 comments on commit 3173c59

Please sign in to comment.