mirror of
https://github.com/Z3Prover/z3
synced 2025-08-25 12:35:59 +00:00
remove deprecated maxsat solvers, adjust values inline
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
770d0d58fe
commit
a96fa0c555
13 changed files with 66 additions and 408 deletions
|
@ -36,30 +36,31 @@ namespace opt {
|
|||
|
||||
typedef inf_eps_rational<inf_rational> inf_eps;
|
||||
|
||||
// Adjust bound bound |-> (m_negate?-1:1)*(m_offset + bound)
|
||||
class bound_adjustment {
|
||||
// Adjust bound bound |-> m_offset + (m_negate?-1:1)*bound
|
||||
class adjust_value {
|
||||
rational m_offset;
|
||||
bool m_negate;
|
||||
public:
|
||||
bound_adjustment(rational const& offset, bool neg):
|
||||
adjust_value(rational const& offset, bool neg):
|
||||
m_offset(offset),
|
||||
m_negate(neg)
|
||||
{}
|
||||
bound_adjustment(): m_offset(0), m_negate(false) {}
|
||||
adjust_value(): m_offset(0), m_negate(false) {}
|
||||
void set_offset(rational const& o) { m_offset = o; }
|
||||
void set_negate(bool neg) { m_negate = neg; }
|
||||
rational const& get_offset() const { return m_offset; }
|
||||
bool get_negate() { return m_negate; }
|
||||
inf_eps add_neg(rational const& r) const {
|
||||
rational result = r + m_offset;
|
||||
inf_eps operator()(inf_eps const& r) const {
|
||||
inf_eps result = r;
|
||||
if (m_negate) result.neg();
|
||||
return inf_eps(result);
|
||||
result += m_offset;
|
||||
return result;
|
||||
}
|
||||
inf_eps neg_add(rational const& r) const {
|
||||
rational operator()(rational const& r) const {
|
||||
rational result = r;
|
||||
if (m_negate) result.neg();
|
||||
result += m_offset;
|
||||
return inf_eps(result);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue