Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/FileFormats/MPS/MPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1444,14 +1444,15 @@ end
function parse_rows_line(data::TempMPSModel{T}, items::Vector{String}) where {T}
if length(items) < 2
error("Malformed ROWS line: $(join(items, " "))")
elseif length(items) > 2
# We could throw an error here, but it seems like other solvers just
# happily ignore the extra fields.
#
# See https://github.com/jump-dev/MathOptInterface.jl/issues/2792
#
# Oscar dislikes the poorly standardized nature of MPS.
end
# if length(items) > 2
# We could throw an error here, but it seems like other solvers just
# happily ignore the extra fields.
#
# See https://github.com/jump-dev/MathOptInterface.jl/issues/2792
#
# Oscar dislikes the poorly standardized nature of MPS.
# end
sense, name = Sense(items[1]), items[2]
if haskey(data.name_to_row, name)
error("Duplicate row encountered: $(join(items, " ")).")
Expand Down
11 changes: 11 additions & 0 deletions test/Bridges/Constraint/IntervalToHyperRectangleBridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ function test_runtests(T)
return
end

function test_modify_ScalarCoefficientChange(T)
inner = MOI.Utilities.Model{T}()
model = MOI.Bridges.Constraint.IntervalToHyperRectangle{T}(inner)
x = MOI.add_variable(model)
c = MOI.add_constraint(model, T(1) * x, MOI.Interval(T(0), T(1)))
@test ≈(MOI.get(model, MOI.ConstraintFunction(), c), T(1) * x)
MOI.modify(model, c, MOI.ScalarCoefficientChange(x, T(2)))
@test ≈(MOI.get(model, MOI.ConstraintFunction(), c), T(2) * x)
return
end

end # module

TestConstraintIntervalToHyperRectangle.runtests()
Loading