3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

merging with the lp fork

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2017-05-10 16:53:25 -07:00
parent cf695ab876
commit b08f094620
44 changed files with 902 additions and 319 deletions

View file

@ -106,49 +106,49 @@ private:
default_lp_resource_limit m_default_resource_limit;
lp_resource_limit* m_resource_limit;
// used for debug output
std::ostream* m_debug_out = &std::cout;
std::ostream* m_debug_out;
// used for messages, for example, the computation progress messages
std::ostream* m_message_out = &std::cout;
std::ostream* m_message_out;
stats m_stats;
public:
unsigned reps_in_scaler = 20;
unsigned reps_in_scaler;
// when the absolute value of an element is less than pivot_epsilon
// in pivoting, we treat it as a zero
double pivot_epsilon = 0.00000001;
double pivot_epsilon;
// see Chatal, page 115
double positive_price_epsilon = 1e-7;
double positive_price_epsilon;
// a quatation "if some choice of the entering vairable leads to an eta matrix
// whose diagonal element in the eta column is less than e2 (entering_diag_epsilon) in magnitude, the this choice is rejected ...
double entering_diag_epsilon = 1e-8;
int c_partial_pivoting = 10; // this is the constant c from page 410
unsigned depth_of_rook_search = 4;
bool using_partial_pivoting = true;
double entering_diag_epsilon;
int c_partial_pivoting; // this is the constant c from page 410
unsigned depth_of_rook_search;
bool using_partial_pivoting;
// dissertation of Achim Koberstein
// if Bx - b is different at any component more that refactor_epsilon then we refactor
double refactor_tolerance = 1e-4;
double pivot_tolerance = 1e-6;
double zero_tolerance = 1e-12;
double drop_tolerance = 1e-14;
double tolerance_for_artificials = 1e-4;
double can_be_taken_to_basis_tolerance = 0.00001;
double refactor_tolerance;
double pivot_tolerance;
double zero_tolerance;
double drop_tolerance;
double tolerance_for_artificials;
double can_be_taken_to_basis_tolerance;
unsigned percent_of_entering_to_check = 5; // we try to find a profitable column in a percentage of the columns
bool use_scaling = true;
double scaling_maximum = 1;
double scaling_minimum = 0.5;
double harris_feasibility_tolerance = 1e-7; // page 179 of Istvan Maros
double ignore_epsilon_of_harris = 10e-5;
unsigned max_number_of_iterations_with_no_improvements = 2000000;
unsigned max_total_number_of_iterations = 20000000;
double time_limit = std::numeric_limits<double>::max(); // the maximum time limit of the total run time in seconds
unsigned percent_of_entering_to_check; // we try to find a profitable column in a percentage of the columns
bool use_scaling;
double scaling_maximum;
double scaling_minimum;
double harris_feasibility_tolerance; // page 179 of Istvan Maros
double ignore_epsilon_of_harris;
unsigned max_number_of_iterations_with_no_improvements;
unsigned max_total_number_of_iterations;
double time_limit; // the maximum time limit of the total run time in seconds
// dual section
double dual_feasibility_tolerance = 1e-7; // // page 71 of the PhD thesis of Achim Koberstein
double primal_feasibility_tolerance = 1e-7; // page 71 of the PhD thesis of Achim Koberstein
double relative_primal_feasibility_tolerance = 1e-9; // page 71 of the PhD thesis of Achim Koberstein
double dual_feasibility_tolerance; // // page 71 of the PhD thesis of Achim Koberstein
double primal_feasibility_tolerance; // page 71 of the PhD thesis of Achim Koberstein
double relative_primal_feasibility_tolerance; // page 71 of the PhD thesis of Achim Koberstein
bool m_bound_propagation = true;
bool m_bound_propagation;
bool bound_progation() const {
return m_bound_propagation;
@ -158,7 +158,53 @@ public:
return m_bound_propagation;
}
lp_settings() : m_default_resource_limit(*this), m_resource_limit(&m_default_resource_limit) {}
lp_settings() : m_default_resource_limit(*this),
m_resource_limit(&m_default_resource_limit),
m_debug_out( &std::cout),
m_message_out(&std::cout),
reps_in_scaler(20),
pivot_epsilon(0.00000001),
positive_price_epsilon(1e-7),
entering_diag_epsilon ( 1e-8),
c_partial_pivoting ( 10), // this is the constant c from page 410
depth_of_rook_search ( 4),
using_partial_pivoting ( true),
// dissertation of Achim Koberstein
// if Bx - b is different at any component more that refactor_epsilon then we refactor
refactor_tolerance ( 1e-4),
pivot_tolerance ( 1e-6),
zero_tolerance ( 1e-12),
drop_tolerance ( 1e-14),
tolerance_for_artificials ( 1e-4),
can_be_taken_to_basis_tolerance ( 0.00001),
percent_of_entering_to_check ( 5),// we try to find a profitable column in a percentage of the columns
use_scaling ( true),
scaling_maximum ( 1),
scaling_minimum ( 0.5),
harris_feasibility_tolerance ( 1e-7), // page 179 of Istvan Maros
ignore_epsilon_of_harris ( 10e-5),
max_number_of_iterations_with_no_improvements ( 2000000),
max_total_number_of_iterations ( 20000000),
time_limit ( std::numeric_limits<double>::max()), // the maximum time limit of the total run time in seconds
// dual section
dual_feasibility_tolerance ( 1e-7), // // page 71 of the PhD thesis of Achim Koberstein
primal_feasibility_tolerance ( 1e-7), // page 71 of the PhD thesis of Achim Koberstein
relative_primal_feasibility_tolerance ( 1e-9), // page 71 of the PhD thesis of Achim Koberstein
m_bound_propagation ( true),
presolve_with_double_solver_for_lar(true),
m_simplex_strategy(simplex_strategy_enum::tableau_rows),
report_frequency(1000),
print_statistics(false),
column_norms_update_frequency(12000),
scale_with_ratio(true),
density_threshold(0.7),
use_breakpoints_in_feasibility_search(false),
random_seed(1),
max_row_length_for_bound_propagation(300),
backup_costs(true),
column_number_threshold_for_using_lu_in_lar_solver(4000)
{}
void set_resource_limit(lp_resource_limit& lim) { m_resource_limit = &lim; }
bool get_cancel_flag() const { return m_resource_limit->get_cancel_flag(); }
@ -227,8 +273,8 @@ public:
return is_eps_small_general<T>(t, tolerance_for_artificials);
}
// the method of lar solver to use
bool presolve_with_double_solver_for_lar = true;
simplex_strategy_enum m_simplex_strategy = simplex_strategy_enum::tableau_rows;
bool presolve_with_double_solver_for_lar;
simplex_strategy_enum m_simplex_strategy;
simplex_strategy_enum simplex_strategy() const {
return m_simplex_strategy;
}
@ -250,20 +296,20 @@ public:
return m_simplex_strategy == simplex_strategy_enum::tableau_rows;
}
int report_frequency = 1000;
bool print_statistics = false;
unsigned column_norms_update_frequency = 12000;
bool scale_with_ratio = true;
double density_threshold = 0.7; // need to tune it up, todo
int report_frequency;
bool print_statistics;
unsigned column_norms_update_frequency;
bool scale_with_ratio;
double density_threshold; // need to tune it up, todo
#ifdef LEAN_DEBUG
static unsigned ddd; // used for debugging
#endif
bool use_breakpoints_in_feasibility_search = false;
unsigned random_seed = 1;
bool use_breakpoints_in_feasibility_search;
unsigned random_seed;
static unsigned long random_next;
unsigned max_row_length_for_bound_propagation = 300;
bool backup_costs = true;
unsigned column_number_threshold_for_using_lu_in_lar_solver = 4000;
unsigned max_row_length_for_bound_propagation;
bool backup_costs;
unsigned column_number_threshold_for_using_lu_in_lar_solver;
}; // end of lp_settings class