mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
replace lean to lp
Signed-off-by: Lev Nachmanson <levnach@microsoft.com>
This commit is contained in:
parent
f6a75600c2
commit
cc32e45471
117 changed files with 1726 additions and 1726 deletions
|
@ -17,7 +17,7 @@ Author:
|
|||
#include "gparams.h"
|
||||
#include <signal.h>
|
||||
|
||||
static lean::lp_solver<double, double>* g_solver = 0;
|
||||
static lp::lp_solver<double, double>* g_solver = 0;
|
||||
|
||||
static void display_statistics() {
|
||||
if (g_solver && g_solver->settings().print_statistics) {
|
||||
|
@ -42,7 +42,7 @@ static void on_timeout() {
|
|||
}
|
||||
}
|
||||
|
||||
struct front_end_resource_limit : public lean::lp_resource_limit {
|
||||
struct front_end_resource_limit : public lp::lp_resource_limit {
|
||||
reslimit& m_reslim;
|
||||
|
||||
front_end_resource_limit(reslimit& lim):
|
||||
|
@ -64,14 +64,14 @@ void run_solver(lp_params & params, char const * mps_file_name) {
|
|||
scoped_timer timer(timeout, &eh);
|
||||
|
||||
std::string fn(mps_file_name);
|
||||
lean::mps_reader<double, double> reader(fn);
|
||||
lp::mps_reader<double, double> reader(fn);
|
||||
reader.set_message_stream(&std::cout); // can be redirected
|
||||
reader.read();
|
||||
if (!reader.is_ok()) {
|
||||
std::cerr << "cannot process " << mps_file_name << std::endl;
|
||||
return;
|
||||
}
|
||||
lean::lp_solver<double, double> * solver = reader.create_solver(false); // false - to create the primal solver
|
||||
lp::lp_solver<double, double> * solver = reader.create_solver(false); // false - to create the primal solver
|
||||
solver->settings().set_resource_limit(lp_limit);
|
||||
g_solver = solver;
|
||||
if (params.min()) {
|
||||
|
@ -80,11 +80,11 @@ void run_solver(lp_params & params, char const * mps_file_name) {
|
|||
solver->settings().set_message_ostream(&std::cout);
|
||||
solver->settings().report_frequency = params.rep_freq();
|
||||
solver->settings().print_statistics = params.print_stats();
|
||||
solver->settings().simplex_strategy() = lean::simplex_strategy_enum::lu;
|
||||
solver->settings().simplex_strategy() = lp::simplex_strategy_enum::lu;
|
||||
solver->find_maximal_solution();
|
||||
|
||||
*(solver->settings().get_message_ostream()) << "status is " << lp_status_to_string(solver->get_status()) << std::endl;
|
||||
if (solver->get_status() == lean::OPTIMAL) {
|
||||
if (solver->get_status() == lp::OPTIMAL) {
|
||||
if (params.min()) {
|
||||
solver->flip_costs();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue