mirror of
https://github.com/Z3Prover/z3
synced 2025-07-23 20:58:54 +00:00
extract gomory cut functionality in one method
Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work in hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work in hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work in hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work in hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> prepare calculate U in hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> naive algorithm for HNF and m <= n Signed-off-by: Lev Nachmanson <levnach@hotmail.com> naive algorithm for HNF Signed-off-by: Lev Nachmanson <levnach@hotmail.com> introduces reverse matrix into Hermite Normal Form calculation Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on more efficient hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> use smarter templates in lu.h Signed-off-by: Lev Nachmanson <levnach@hotmail.com> the new lu scheme compiles Signed-off-by: Lev Nachmanson <levnach@hotmail.com> simple test passes with the modified lu Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix the build on windows Signed-off-by: Lev Nachmanson <levnach@hotmail.com> playing with the example from cutting the mix Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf, add extended_gcd_minimal_uv() Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on extended_gcd_minimal_uv Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf, add extended_gcd_minimal_uv() Signed-off-by: Lev Nachmanson <levnach@hotmail.com> more tests and bug fixes in hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf modulo version Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf modulo version, more tests pass Signed-off-by: Lev Nachmanson <levnach@hotmail.com> a rough version of hnf passed the tests Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix build in release Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fixes in determinant calculations Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on hnf Signed-off-by: Lev Nachmanson <levnach@hotmail.com> create a stub for hnf_cuts Signed-off-by: Lev Nachmanson <levnach@hotmail.com> create a stub for hnf_cuts Signed-off-by: Lev Nachmanson <levnach@hotmail.com> create a stub for hnf_cuts Signed-off-by: Lev Nachmanson <levnach@hotmail.com> general_matrix etc. Signed-off-by: Lev Nachmanson <levnach@hotmail.com> general_matrix etc. Signed-off-by: Lev Nachmanson <levnach@hotmail.com> rename cut_solver to chase_cut_solver Signed-off-by: Lev Nachmanson <levnach@hotmail.com> rename cut_solver to chase_cut_solver Signed-off-by: Lev Nachmanson <levnach@hotmail.com> hnf_cutter Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
c04bcb411d
commit
3b5337823a
35 changed files with 2178 additions and 760 deletions
|
@ -22,8 +22,9 @@ Revision History:
|
|||
#include "util/lp/static_matrix.h"
|
||||
#include "util/lp/int_set.h"
|
||||
#include "util/lp/lar_term.h"
|
||||
#include "util/lp/cut_solver.h"
|
||||
#include "util/lp/chase_cut_solver.h"
|
||||
#include "util/lp/lar_constraints.h"
|
||||
#include "util/lp/hnf_cutter.h"
|
||||
|
||||
namespace lp {
|
||||
class lar_solver;
|
||||
|
@ -54,11 +55,12 @@ public:
|
|||
// fields
|
||||
lar_solver * m_lar_solver;
|
||||
unsigned m_branch_cut_counter;
|
||||
cut_solver m_cut_solver;
|
||||
chase_cut_solver m_chase_cut_solver;
|
||||
lar_term* m_t; // the term to return in the cut
|
||||
mpq *m_k; // the right side of the cut
|
||||
explanation *m_ex; // the conflict explanation
|
||||
bool *m_upper; // we have a cut m_t*x <= k if m_upper is true nad m_t*x >= k otherwise
|
||||
hnf_cutter m_hnf_cutter;
|
||||
// methods
|
||||
int_solver(lar_solver* lp);
|
||||
|
||||
|
@ -152,18 +154,18 @@ private:
|
|||
unsigned random();
|
||||
bool has_inf_int() const;
|
||||
lia_move create_branch_on_column(int j);
|
||||
void catch_up_in_adding_constraints_to_cut_solver();
|
||||
void catch_up_in_adding_constraints_to_chase_cut_solver();
|
||||
public:
|
||||
template <typename T>
|
||||
void fill_cut_solver_vars();
|
||||
void fill_chase_cut_solver_vars();
|
||||
template <typename T>
|
||||
void get_int_coeffs_from_constraint(const lar_base_constraint* c, vector<cut_solver::monomial>& coeff, T & rs);
|
||||
void get_int_coeffs_from_constraint(const lar_base_constraint* c, vector<chase_cut_solver::monomial>& coeff, T & rs);
|
||||
bool is_term(unsigned j) const;
|
||||
void add_constraint_to_cut_solver(unsigned,const lar_base_constraint*);
|
||||
void copy_explanations_from_cut_solver();
|
||||
void add_constraint_to_chase_cut_solver(unsigned,const lar_base_constraint*);
|
||||
void copy_explanations_from_chase_cut_solver();
|
||||
void pop(unsigned);
|
||||
void push();
|
||||
void copy_values_from_cut_solver();
|
||||
void copy_values_from_chase_cut_solver();
|
||||
bool left_branch_is_more_narrow_than_right(unsigned);
|
||||
bool find_cube();
|
||||
bool tighten_terms_for_cube();
|
||||
|
@ -174,6 +176,12 @@ public:
|
|||
void find_feasible_solution();
|
||||
int find_inf_int_nbasis_column() const;
|
||||
lia_move run_gcd_test();
|
||||
lia_move call_cut_solver();
|
||||
lia_move call_chase_cut_solver();
|
||||
lia_move gomory_cut();
|
||||
lia_move hnf_cut();
|
||||
lia_move make_hnf_cut();
|
||||
bool prepare_matrix_A_for_hnf_cut();
|
||||
bool hnf_matrix_is_empty() const;
|
||||
void try_add_term_to_A_for_hnf(unsigned term_index);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue