Skip to content

Commit

Permalink
Now to refine kIisDevReport
Browse files Browse the repository at this point in the history
  • Loading branch information
jajhall committed Aug 27, 2024
1 parent 4ab6ce2 commit 414e9ce
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/lp_data/HighsIis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,26 +249,31 @@ HighsStatus HighsIis::compute(const HighsLp& lp, const HighsOptions& options,
bool drop_lower = false;

HighsInt num_run_call = 0;
const HighsInt check_run_call = kHighsIInf;
const HighsInt check_run_call = 153;//kHighsIInf;

// Lambda for gathering data when solving an LP
auto solveLp = [&]() -> HighsStatus {
HighsIisInfo iis_info;
iis_info.simplex_time = -highs.getRunTime();
iis_info.simplex_iterations = -info.simplex_iteration_count;
bool output_flag;
highs.getOptionValue("output_flag", output_flag);
HighsInt log_dev_level;
HighsInt highs_analysis_level;
highs.getOptionValue("output_flag", output_flag);
highs.getOptionValue("log_dev_level", log_dev_level);
highs.getOptionValue("highs_analysis_level", highs_analysis_level);

num_run_call++;
if (num_run_call >= check_run_call) {
if (num_run_call == check_run_call) {
highs.setOptionValue("output_flag", true);
highs.setOptionValue("log_dev_level", 2);
highs.setOptionValue("log_dev_level", 3);
highs.setOptionValue("highs_analysis_level", 4);
highs.writeModel("form.mps");
}
run_status = highs.run();
highs.setOptionValue("output_flag", output_flag);
highs.setOptionValue("log_dev_level", log_dev_level);
highs.setOptionValue("highs_analysis_level", highs_analysis_level);
if (run_status != HighsStatus::kOk) {
printf("HighsIis::compute highs.run() %d returns status %s\n",
int(num_run_call), highsStatusToString(run_status).c_str());
Expand Down Expand Up @@ -378,6 +383,8 @@ HighsStatus HighsIis::compute(const HighsLp& lp, const HighsOptions& options,

// Pass twice: rows before columns, or columns before rows, according to
// row_priority
std::string check_type = "Col";
HighsInt check_ix = 81;
for (HighsInt k = 0; k < 2; k++) {
row_deletion = (row_priority && k == 0) || (!row_priority && k == 1);
std::string type = row_deletion ? "Row" : "Col";
Expand All @@ -393,6 +400,9 @@ HighsStatus HighsIis::compute(const HighsLp& lp, const HighsOptions& options,
double upper = row_deletion ? lp.row_upper_[iX] : lp.col_upper_[iX];
// Record whether the upper bound has been dropped due to the lower bound
// being kept
if (check_type == type && check_ix == iX) {
printf("CheckType %s, index %d, num_run_call = %d\n", check_type.c_str(), int(check_ix), int(num_run_call));
}
if (lower > -kHighsInf) {
// Drop the lower bound temporarily
bool drop_lower = true;
Expand Down

0 comments on commit 414e9ce

Please sign in to comment.