mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
more refactoring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
29cc9025cb
commit
6caee5e3ca
8 changed files with 34 additions and 177 deletions
|
@ -187,6 +187,13 @@ namespace opt {
|
|||
m_objective_values.reset();
|
||||
}
|
||||
|
||||
opt_solver& opt_solver::to_opt(solver& s) {
|
||||
if (typeid(opt_solver) != typeid(s)) {
|
||||
throw default_exception("BUG: optimization context has not been initialized correctly");
|
||||
}
|
||||
return dynamic_cast<opt_solver&>(s);
|
||||
}
|
||||
|
||||
opt_solver::toggle_objective::toggle_objective(opt_solver& s, bool new_value): s(s), m_old_value(s.m_objective_enabled) {
|
||||
s.m_objective_enabled = new_value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue