Skip to content

Commit

Permalink
more work on mps reader
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Jul 27, 2023
1 parent 5b8cdcd commit a3d549f
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 a3d549f

Please sign in to comment.