Skip to content

Commit

Permalink
fix add_clauses in Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
fanosta committed Dec 20, 2023
1 parent 23fe3e7 commit 4bbbb36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/src/pyapproxmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ static int _add_clauses_from_array(Counter *self, const size_t array_length, con
lits.push_back(CMSat::Lit(var, sign));
}
if (!lits.empty()) {
if (max_var >= (long int)self->appmc->nVars()) {
self->appmc->new_vars(max_var-(long int)self->appmc->nVars()+1);
if (max_var >= (long int)self->arjun->nVars()) {
self->arjun->new_vars(max_var-(long int)self->arjun->nVars()+1);
}
self->appmc->add_clause(lits);
self->arjun->add_clause(lits);
}
}
return 1;
Expand Down

0 comments on commit 4bbbb36

Please sign in to comment.