Skip to content

Commit

Permalink
Now using solution_.hasUndefined(); updated FEATURES.md and silenced …
Browse files Browse the repository at this point in the history
…unti tests
  • Loading branch information
jajhall committed Jul 14, 2024
1 parent 6e9f9bd commit 3c34353
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 7 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@

Added `int64_t mip_total_lp_iterations` to `HighsCallbackDataOut` and modified accessor function

`Highs::writeSolution` and `Highs::writeBasis` now being done via `HighsIO` logging, so can be redirected to logging callback.

Introduced `const double kHighsUndefined` as value of undefined values in a user solution. It's equal to `kHighsInf`

Added `Highs::setSolution(const HighsInt num_entries, const HighsInt* index, const double* value);` to allow a sparse primal solution to be defined.


4 changes: 2 additions & 2 deletions check/TestCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ TEST_CASE("highs-callback-solution-basis-logging", "[highs-callback]") {
highs.run();
highs.setCallback(userInterruptCallback, p_user_callback_data);
highs.startCallback(kCallbackLogging);
highs.writeSolution("", kSolutionStylePretty);
highs.writeBasis("");
if (dev_run) highs.writeSolution("", kSolutionStylePretty);
if (dev_run) highs.writeBasis("");
}

TEST_CASE("highs-callback-simplex-interrupt", "[highs-callback]") {
Expand Down
10 changes: 2 additions & 8 deletions src/lp_data/Highs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3406,14 +3406,7 @@ HighsStatus Highs::completeSolutionFromDiscreteAssignment() {
HighsLp& lp = model_.lp_;
// Determine whether the solution contains undefined values, in
// order to decide whether to check its feasibility
bool contains_undefined_values = false;
for (HighsInt iCol = 0; iCol < lp.num_col_; iCol++) {
if (solution_.col_value[iCol] == kHighsUndefined) {
contains_undefined_values = true;
break;
}
}
assert(solution_.hasUndefined() == contains_undefined_values);
const bool contains_undefined_values = solution_.hasUndefined();
if (!contains_undefined_values) {
bool valid, integral, feasible;
// Determine whether this solution is integer feasible
Expand Down Expand Up @@ -3466,6 +3459,7 @@ HighsStatus Highs::completeSolutionFromDiscreteAssignment() {
}
}
}
assert(!solution_.hasUndefined());
const HighsInt num_discrete_variable =
num_unfixed_discrete_variable + num_fixed_discrete_variable;
const HighsInt num_continuous_variable = lp.num_col_ - num_discrete_variable;
Expand Down

0 comments on commit 3c34353

Please sign in to comment.