Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for order of start values #3315

Merged
merged 3 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
MathOptInterface = "1.13"
MathOptInterface = "1.14"
MutableArithmetics = "1"
OrderedCollections = "1"
SnoopPrecompile = "1"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Ipopt = "=1.2.0"
JSON = "0.21"
JSONSchema = "1"
Literate = "2.8"
MathOptInterface = "=1.13.2"
MathOptInterface = "=1.14.0"
odow marked this conversation as resolved.
Show resolved Hide resolved
MultiObjectiveAlgorithms = "=0.1.5"
Plots = "1"
SCS = "=1.1.3"
Expand Down
20 changes: 20 additions & 0 deletions test/test_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,26 @@ function test_set_start_values()
return
end

function test_model_quad_to_soc_start_values()
inner = MOI.Utilities.MockOptimizer(
MOI.Bridges.Constraint.QuadtoSOC{Float64}(
MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()),
)
odow marked this conversation as resolved.
Show resolved Hide resolved
)
model = direct_model(inner)
@variable(model, x)
@constraint(model, c, x^2 <= 0)
@test_throws ErrorException set_start_value(c, 0.0)
set_start_values(
model;
variable_primal_start = x -> 1.0,
constraint_primal_start = x -> 1.0,
constraint_dual_start = x -> 1.0,
)
@test start_value(c) == 1.0
return
end

function test_keyword_getindex()
err = JuMP._get_index_keyword_indexing_error()
model = Model()
Expand Down