Skip to content

Commit

Permalink
Removed redundant LpInvertRequirementError and added unit test for ge…
Browse files Browse the repository at this point in the history
…tCoeff when matrix is rowwise
  • Loading branch information
jajhall committed Feb 27, 2025
1 parent dac434c commit ca0d691
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 4 additions & 0 deletions check/TestLpValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ TEST_CASE("LP-validation", "[highs_data]") {
REQUIRE(highs.getCoeff(check_row, check_col, check_value) ==
HighsStatus::kOk);
REQUIRE(check_value == to_value);
REQUIRE(highs.ensureRowwise() == HighsStatus::kOk);
REQUIRE(highs.getCoeff(check_row, check_col, check_value) ==
HighsStatus::kOk);
REQUIRE(check_value == to_value);
}

TEST_CASE("LP-row-index-duplication", "[highs_data]") {
Expand Down
1 change: 0 additions & 1 deletion src/Highs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,6 @@ class Highs {
HighsStatus checkOptimality(const std::string& solver_type,
HighsStatus return_status);
HighsStatus invertRequirementError(std::string method_name) const;
HighsStatus lpInvertRequirementError(std::string method_name) const;

HighsStatus handleInfCost();
void restoreInfCost(HighsStatus& return_status);
Expand Down
8 changes: 0 additions & 8 deletions src/lp_data/HighsInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2486,14 +2486,6 @@ HighsStatus Highs::invertRequirementError(std::string method_name) const {
return HighsStatus::kError;
}

HighsStatus Highs::lpInvertRequirementError(std::string method_name) const {
assert(!ekk_instance_.status_.has_invert);
if (model_.isMip() || model_.isQp()) return HighsStatus::kOk;
highsLogUser(options_.log_options, HighsLogType::kError,
"No LP invertible representation for %s\n", method_name.c_str());
return HighsStatus::kError;
}

HighsStatus Highs::handleInfCost() {
HighsLp& lp = this->model_.lp_;
if (!lp.has_infinite_cost_) return HighsStatus::kOk;
Expand Down

0 comments on commit ca0d691

Please sign in to comment.