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
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Changes in v0.14.17

* Updated to become compatible with MathOptInterface v0.10, which enables compatibility with the latest version of many solvers
([#467](https://github.com/jump-dev/Convex.jl/pull/467)).
This release drops compatibility with MathOptInterface v0.9, so if you need to use solvers which have not been updated yet,
please stick with an Convex v0.14.16 or earlier.

# Changes in v0.14.16

* Improve numerical stability when evaluating `logsumexp` ([#457](https://github.com/jump-dev/Convex.jl/pull/462)). Thanks @JinraeKim!
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Convex"
uuid = "f65535da-76fb-5f13-bab9-19810c17039a"
version = "0.14.16"
version = "0.14.17"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -16,7 +16,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
AbstractTrees = "0.2, 0.3"
BenchmarkTools = "^0.4, 0.5, 0.6, 0.7, 1.0"
LDLFactorizations = "0.8.1"
MathOptInterface = "~0.9"
MathOptInterface = "0.10"
OrderedCollections = "^1.0"
julia = "^1.0"

Expand Down
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Documenter = "0.26"
MathOptInterface = "~0.9"
Documenter = "0.27"
MathOptInterface = "0.10"
7 changes: 4 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,16 @@ else
out_path = joinpath(build_path, dir, file)
if endswith(file, ".jl")
postprocess = function(content)
block_name = replace(filename(file), r"\s+" => "_")
"""
All of the examples can be found in Jupyter notebook form [here](../$(filename(zip_path)).zip).

```@setup $(filename(file))
```@setup $(block_name)
__START_TIME = time_ns()
@info "Starting example $(filename(file))"
```
""" * content * """
```@setup $(filename(file))
```@setup $(block_name)
__END_TIME = time_ns()
elapsed = string(round((__END_TIME - __START_TIME)*1e-9; sigdigits = 3), "s")
@info "Finished example $(filename(file)) after " * elapsed
Expand All @@ -136,7 +137,7 @@ end

makedocs(;
modules = [Convex],
format = Documenter.HTML(),
format = Documenter.HTML(; ansicolor=true),
pages = [
"Home" => "index.md",
"Installation" => "installation.md",
Expand Down
8 changes: 4 additions & 4 deletions src/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ function load_MOI_model!(model, problem::Problem{T}) where {T}

# the objective: maximize or minimize a scalar variable
objective_index = var_to_indices[objective_var_id][] # get the `MOI.VariableIndex` corresponding to the objective
MOI.set(model, MOI.ObjectiveFunction{MOI.SingleVariable}(), MOI.SingleVariable(objective_index))
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(), objective_index)
MOI.set(model, MOI.ObjectiveSense(), problem.head == :maximize ? MOI.MAX_SENSE : MOI.MIN_SENSE)

# Constraints: Generate a MOI function and a MOI sets for each `ConicConstr` object in the problem
MOI_constr_fn = Union{MOI.VectorAffineFunction{T},MOI.SingleVariable}[]
MOI_constr_fn = Union{MOI.VectorAffineFunction{T},MOI.VariableIndex}[]
MOI_sets = Any[]
for conic_constr in conic_constraints
set, constr_fn = make_MOI_constr(conic_constr, var_to_indices, id_to_variables, T)
Expand All @@ -169,13 +169,13 @@ function load_MOI_model!(model, problem::Problem{T}) where {T}
if vartype(variable) == IntVar
var_indices = var_to_indices[var_id]
for idx = eachindex(var_indices)
push!(MOI_constr_fn, MOI.SingleVariable(var_indices[idx]))
push!(MOI_constr_fn, var_indices[idx])
push!(MOI_sets, MOI.Integer())
end
elseif vartype(variable) == BinVar
var_indices = var_to_indices[var_id]
for idx in eachindex(var_indices)
push!(MOI_constr_fn, MOI.SingleVariable(var_indices[idx]))
push!(MOI_constr_fn, var_indices[idx])
push!(MOI_sets, MOI.ZeroOne())
end
end
Expand Down
15 changes: 10 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ end
include("test_abstract_variable.jl")

@testset "SCS with warmstarts" begin
# We exclude `sdp_sdp_constraints` since it seems to hit a bug https://github.com/jump-dev/SCS.jl/issues/167
run_tests(; exclude=[r"mip", r"sdp_sdp_constraints"]) do p
# "sdp_lieb_ando" is currently (14 Nov 2021) failing with SCS
# on ubuntu in CI (they pass locally on MacOS and in CI with
# MacOS, and have passed on ubuntu in the past). Disabling
# them for now; once COSMO or Hypatia is on MOI v0.10, we can
# try using them, or hope SCS starts solving them again.
run_tests(; exclude=[r"mip", r"sdp_lieb_ando"]) do p
solve!(p, () -> SCS.Optimizer(verbose=0, eps=1e-6); warmstart = true)
end
end

@testset "SCS" begin
# Exclusions same as for "SCS with warmstarts"
run_tests(; exclude=[r"mip", r"sdp_sdp_constraints"]) do p
run_tests(; exclude=[r"mip", r"sdp_lieb_ando"]) do p
solve!(p, () -> SCS.Optimizer(verbose=0, eps=1e-6))
end
end
Expand All @@ -55,7 +58,9 @@ end
end

@testset "GLPK" begin
run_tests(; exclude=[r"exp", r"sdp", r"socp"]) do p
# Note this is an inclusion, not exclusion;
# we only test GLPK with MIPs, since those we can't test elsewhere.
run_tests([r"mip"]) do p
solve!(p, GLPK.Optimizer; silent_solver=true)
end
end
Expand Down
6 changes: 0 additions & 6 deletions test/test_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ end
@test output === nothing
end

@testset "`solve!` with MPB solver errors" begin
x = Variable()
p = satisfy(x >= 0)
@test_throws ErrorException solve!(p, SCSSolver())
end

@testset "Complex objective function errors" begin
x = Variable()
@test_throws ErrorException minimize(x + im*x)
Expand Down