Skip to content

Commit

Permalink
export lp_data/ from google3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jul 26, 2023
1 parent 038d834 commit fd06968
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ortools/lp_data/mps_reader_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,11 @@ absl::Status MPSReaderTemplate<DataWrapper>::ProcessLine(absl::string_view line,
template <class DataWrapper>
absl::Status MPSReaderTemplate<DataWrapper>::ProcessObjectiveSenseSection(
DataWrapper* data) {
if (fields_.size() != 1 && fields_[0] != "MIN" && fields_[0] != "MAX") {
absl::string_view field = absl::StripAsciiWhitespace(line_);
if (field != "MIN" && field != "MAX") {
return InvalidArgumentError("Expected objective sense (MAX or MIN).");
}
data->SetObjectiveDirection(/*maximize=*/fields_[0] == "MAX");
data->SetObjectiveDirection(/*maximize=*/field == "MAX");
return absl::OkStatus();
}

Expand Down

0 comments on commit fd06968

Please sign in to comment.