3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +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:
Lev Nachmanson 2018-04-20 11:24:20 -07:00
parent c04bcb411d
commit 3b5337823a
35 changed files with 2178 additions and 760 deletions

View file

@ -23,56 +23,62 @@ Revision History:
#include "util/vector.h"
#include "util/debug.h"
#include "util/lp/lu_def.h"
template double lp::dot_product<double, double>(vector<double> const&, vector<double> const&);
template lp::lu<double, double>::lu(lp::static_matrix<double, double> const&, vector<unsigned int>&, lp::lp_settings&);
template void lp::lu<double, double>::push_matrix_to_tail(lp::tail_matrix<double, double>*);
template void lp::lu<double, double>::replace_column(double, lp::indexed_vector<double>&, unsigned);
template void lp::lu<double, double>::solve_Bd(unsigned int, lp::indexed_vector<double>&, lp::indexed_vector<double>&);
template lp::lu<double, double>::~lu();
template void lp::lu<lp::mpq, lp::mpq>::push_matrix_to_tail(lp::tail_matrix<lp::mpq, lp::mpq>*);
template void lp::lu<lp::mpq, lp::mpq>::solve_Bd(unsigned int, lp::indexed_vector<lp::mpq>&, lp::indexed_vector<lp::mpq>&);
template lp::lu<lp::mpq, lp::mpq>::~lu();
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::push_matrix_to_tail(lp::tail_matrix<lp::mpq, lp::numeric_pair<lp::mpq> >*);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_Bd(unsigned int, lp::indexed_vector<lp::mpq>&, lp::indexed_vector<lp::mpq>&);
template lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::~lu();
template lp::mpq lp::dot_product<lp::mpq, lp::mpq>(vector<lp::mpq > const&, vector<lp::mpq > const&);
template void lp::init_factorization<double, double>(lp::lu<double, double>*&, lp::static_matrix<double, double>&, vector<unsigned int>&, lp::lp_settings&);
template void lp::init_factorization<lp::mpq, lp::mpq>(lp::lu<lp::mpq, lp::mpq>*&, lp::static_matrix<lp::mpq, lp::mpq>&, vector<unsigned int>&, lp::lp_settings&);
template void lp::init_factorization<lp::mpq, lp::numeric_pair<lp::mpq> >(lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >*&, lp::static_matrix<lp::mpq, lp::numeric_pair<lp::mpq> >&, vector<unsigned int>&, lp::lp_settings&);
namespace lp {
template double dot_product<double, double>(vector<double> const&, vector<double> const&);
template lu<static_matrix<double, double>>::lu(static_matrix<double, double> const&, vector<unsigned int>&, lp_settings&);
template void lu<static_matrix<double, double>>::push_matrix_to_tail(tail_matrix<double, double>*);
template void lu<static_matrix<double, double>>::replace_column(double, indexed_vector<double>&, unsigned);
template void lu<static_matrix<double, double>>::solve_Bd(unsigned int, indexed_vector<double>&, indexed_vector<double>&);
template lu<static_matrix<double, double>>::~lu();
template void lu<static_matrix<mpq, mpq>>::push_matrix_to_tail(tail_matrix<mpq, mpq>*);
template void lu<static_matrix<mpq, mpq>>::solve_Bd(unsigned int, indexed_vector<mpq>&, indexed_vector<mpq>&);
template lu<static_matrix<mpq, mpq>>::~lu();
template void lu<static_matrix<mpq, impq>>::push_matrix_to_tail(tail_matrix<mpq, impq >*);
template void lu<static_matrix<mpq, impq>>::solve_Bd(unsigned int, indexed_vector<mpq>&, indexed_vector<mpq>&);
template lu<static_matrix<mpq, impq>>::~lu();
template mpq dot_product<mpq, mpq>(vector<mpq > const&, vector<mpq > const&);
template void init_factorization<static_matrix<double, double>>
(lu<static_matrix<double, double>>*&, static_matrix<double, double>&, vector<unsigned int>&, lp_settings&);
template void init_factorization<static_matrix<mpq, mpq>>
(lu<static_matrix<mpq,mpq>>*&, static_matrix<mpq, mpq>&, vector<unsigned int>&, lp_settings&);
template void init_factorization<static_matrix<mpq, impq>>(lu<static_matrix<mpq, impq> >*&, static_matrix<mpq, impq >&, vector<unsigned int>&, lp_settings&);
#ifdef Z3DEBUG
template void lp::print_matrix<double, double>(lp::sparse_matrix<double, double>&, std::ostream & out);
template void lp::print_matrix<lp::mpq, lp::mpq>(lp::static_matrix<lp::mpq, lp::mpq>&, std::ostream&);
template void lp::print_matrix<lp::mpq, lp::numeric_pair<lp::mpq> >(lp::static_matrix<lp::mpq, lp::numeric_pair<lp::mpq> >&, std::ostream&);
template void lp::print_matrix<double, double>(lp::static_matrix<double, double>&, std::ostream & out);
template bool lp::lu<double, double>::is_correct(const vector<unsigned>& basis);
template bool lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::is_correct( vector<unsigned int> const &);
template lp::dense_matrix<double, double> lp::get_B<double, double>(lp::lu<double, double>&, const vector<unsigned>& basis);
template lp::dense_matrix<lp::mpq, lp::mpq> lp::get_B<lp::mpq, lp::mpq>(lp::lu<lp::mpq, lp::mpq>&, vector<unsigned int> const&);
template void print_matrix<square_sparse_matrix<double, double>>(square_sparse_matrix<double, double>&, std::ostream & out);
template void print_matrix<static_matrix<mpq,mpq>>(static_matrix<mpq, mpq>&, std::ostream&);
template void print_matrix<static_matrix<mpq, impq> >(static_matrix<mpq, impq >&, std::ostream&);
template void print_matrix<static_matrix<double, double>>(static_matrix<double, double>&, std::ostream & out);
template bool lu<static_matrix<double, double>>::is_correct(const vector<unsigned>& basis);
template bool lu<static_matrix<mpq, impq>>::is_correct( vector<unsigned int> const &);
template dense_matrix<double, double> get_B<static_matrix<double, double>>(lu<static_matrix<double, double>>&, const vector<unsigned>& basis);
template dense_matrix<mpq, mpq> get_B<static_matrix<mpq, mpq>>(lu<static_matrix<mpq, mpq>>&, vector<unsigned int> const&);
#endif
template bool lp::lu<double, double>::pivot_the_row(int); // NOLINT
template void lp::lu<double, double>::init_vector_w(unsigned int, lp::indexed_vector<double>&);
template void lp::lu<double, double>::solve_By(vector<double>&);
template void lp::lu<double, double>::solve_By_when_y_is_ready_for_X(vector<double>&);
template void lp::lu<double, double>::solve_yB_with_error_check(vector<double>&, const vector<unsigned>& basis);
template void lp::lu<double, double>::solve_yB_with_error_check_indexed(lp::indexed_vector<double>&, vector<int> const&, const vector<unsigned> & basis, const lp_settings&);
template void lp::lu<lp::mpq, lp::mpq>::replace_column(lp::mpq, lp::indexed_vector<lp::mpq>&, unsigned);
template void lp::lu<lp::mpq, lp::mpq>::solve_By(vector<lp::mpq >&);
template void lp::lu<lp::mpq, lp::mpq>::solve_By_when_y_is_ready_for_X(vector<lp::mpq >&);
template void lp::lu<lp::mpq, lp::mpq>::solve_yB_with_error_check(vector<lp::mpq >&, const vector<unsigned>& basis);
template void lp::lu<lp::mpq, lp::mpq>::solve_yB_with_error_check_indexed(lp::indexed_vector<lp::mpq>&, vector< int > const&, const vector<unsigned> & basis, const lp_settings&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_yB_with_error_check_indexed(lp::indexed_vector<lp::mpq>&, vector< int > const&, const vector<unsigned> & basis, const lp_settings&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::init_vector_w(unsigned int, lp::indexed_vector<lp::mpq>&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::replace_column(lp::mpq, lp::indexed_vector<lp::mpq>&, unsigned);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_Bd_faster(unsigned int, lp::indexed_vector<lp::mpq>&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_By(vector<lp::numeric_pair<lp::mpq> >&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_By_when_y_is_ready_for_X(vector<lp::numeric_pair<lp::mpq> >&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_yB_with_error_check(vector<lp::mpq >&, const vector<unsigned>& basis);
template void lp::lu<lp::mpq, lp::mpq>::solve_By(lp::indexed_vector<lp::mpq>&);
template void lp::lu<double, double>::solve_By(lp::indexed_vector<double>&);
template void lp::lu<double, double>::solve_yB_indexed(lp::indexed_vector<double>&);
template void lp::lu<lp::mpq, lp::mpq>::solve_yB_indexed(lp::indexed_vector<lp::mpq>&);
template void lp::lu<lp::mpq, lp::numeric_pair<lp::mpq> >::solve_yB_indexed(lp::indexed_vector<lp::mpq>&);
template void lp::lu<lp::mpq, lp::mpq>::solve_By_for_T_indexed_only(lp::indexed_vector<lp::mpq>&, lp::lp_settings const&);
template void lp::lu<double, double>::solve_By_for_T_indexed_only(lp::indexed_vector<double>&, lp::lp_settings const&);
template bool lu<static_matrix<double, double>>::pivot_the_row(int); // NOLINT
template void lu<static_matrix<double, double>>::init_vector_w(unsigned int, indexed_vector<double>&);
template void lu<static_matrix<double, double>>::solve_By(vector<double>&);
template void lu<static_matrix<double, double>>::solve_By_when_y_is_ready_for_X(vector<double>&);
template void lu<static_matrix<double, double>>::solve_yB_with_error_check(vector<double>&, const vector<unsigned>& basis);
template void lu<static_matrix<double, double>>::solve_yB_with_error_check_indexed(indexed_vector<double>&, vector<int> const&, const vector<unsigned> & basis, const lp_settings&);
template void lu<static_matrix<mpq, mpq>>::replace_column(mpq, indexed_vector<mpq>&, unsigned);
template void lu<static_matrix<mpq, mpq>>::solve_By(vector<mpq >&);
template void lu<static_matrix<mpq, mpq>>::solve_By_when_y_is_ready_for_X(vector<mpq >&);
template void lu<static_matrix<mpq, mpq>>::solve_yB_with_error_check(vector<mpq >&, const vector<unsigned>& basis);
template void lu<static_matrix<mpq, mpq>>::solve_yB_with_error_check_indexed(indexed_vector<mpq>&, vector< int > const&, const vector<unsigned> & basis, const lp_settings&);
template void lu<static_matrix<mpq, impq> >::solve_yB_with_error_check_indexed(indexed_vector<mpq>&, vector< int > const&, const vector<unsigned> & basis, const lp_settings&);
template void lu<static_matrix<mpq, impq> >::init_vector_w(unsigned int, indexed_vector<mpq>&);
template void lu<static_matrix<mpq, impq> >::replace_column(mpq, indexed_vector<mpq>&, unsigned);
template void lu<static_matrix<mpq, impq> >::solve_Bd_faster(unsigned int, indexed_vector<mpq>&);
template void lu<static_matrix<mpq, impq> >::solve_By(vector<impq >&);
template void lu<static_matrix<mpq, impq> >::solve_By_when_y_is_ready_for_X(vector<impq >&);
template void lu<static_matrix<mpq, impq> >::solve_yB_with_error_check(vector<mpq >&, const vector<unsigned>& basis);
template void lu<static_matrix<mpq, mpq>>::solve_By(indexed_vector<mpq>&);
template void lu<static_matrix<double, double>>::solve_By(indexed_vector<double>&);
template void lu<static_matrix<double, double>>::solve_yB_indexed(indexed_vector<double>&);
template void lu<static_matrix<mpq, impq> >::solve_yB_indexed(indexed_vector<mpq>&);
template void lu<static_matrix<mpq, mpq>>::solve_By_for_T_indexed_only(indexed_vector<mpq>&, lp_settings const&);
template void lu<static_matrix<double, double>>::solve_By_for_T_indexed_only(indexed_vector<double>&, lp_settings const&);
#ifdef Z3DEBUG
template void print_matrix<tail_matrix<double, double>>(tail_matrix<double, double>&, std::ostream&);
#endif
}