Skip to content

Commit

Permalink
Fix bug when setting a quadratic objective (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Jan 24, 2023
1 parent de4a6c1 commit 1c7c760
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "HiGHS"
uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
version = "1.4.1"
version = "1.4.2"

[deps]
HiGHS_jll = "8fd58aa0-07eb-5a78-9b36-339c94fd15ea"
Expand Down
1 change: 1 addition & 0 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@ function MOI.set(
)
_check_ret(ret)
model.hessian = Q
model.is_objective_function_set = true
return
end

Expand Down
14 changes: 14 additions & 0 deletions test/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,20 @@ function test_option_type()
end
end

function test_quadratic_sets_objective()
model = HiGHS.Optimizer()
MOI.Utilities.loadfromstring!(
model,
"""
variables: x
minobjective: 1.0 * x * x
""",
)
attr = MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{Float64}}()
@test attr in MOI.get(model, MOI.ListOfModelAttributesSet())
return
end

end

TestMOIHighs.runtests()

2 comments on commit 1c7c760

@odow
Copy link
Member Author

@odow odow commented on 1c7c760 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/76300

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.2 -m "<description of version>" 1c7c760c0e54cfb31f4fa637b3f371c0166347a0
git push origin v1.4.2

Please sign in to comment.