Skip to content

Commit

Permalink
Merge pull request #3482 from JuliaReach/schillic/icp
Browse files Browse the repository at this point in the history
Bring back IntervalConstraintProgramming in tests
  • Loading branch information
schillic authored Apr 22, 2024
2 parents be0807f + dab587a commit 1b38377
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions docs/src/man/optional_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ The package [`IntervalLinearAlgebra`](https://github.com/JuliaIntervals/Interval
|[`IntervalMatrices`](https://github.com/JuliaReach/IntervalMatrices.jl) | Set operations that involve matrices whose coefficients are intervals.|
|[`TaylorModels`](https://github.com/JuliaIntervals/TaylorModels.jl) |Taylor expansion of functions with rigorous interval remainder.|

Note: `IntervalConstraintProgramming` is currently not tested due to compatibility issues.

## Optimization algorithms

Some computations require use of external numerical optimization solvers. The modeling language [`JuMP`](https://github.com/jump-dev/JuMP.jl) is loaded by default, together with the [GLPK](https://en.wikipedia.org/wiki/GNU_Linear_Programming_Kit) solver for linear programs (LPs). Other solvers can be loaded on-demand, even commercial ones, provided that you have the appropriate license. See JuMP's [documentation page on supported solvers](https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers) for further details.
Expand Down
2 changes: 1 addition & 1 deletion src/Approximations/overapproximate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ function load_paving_overapproximation()
converted into hyperrectangles, and then calculates the support function of the
set along each direction in dirs, to compute the `HPolyhedron` constraints.
### Requires IntervalConstraintProgramming
This algorithm requires the IntervalConstraintProgramming package.
"""
function overapproximate(p::Paving{L,N}, dirs::AbstractDirections{N,VN}) where {L,N,VN}
# enclose outer approximation
Expand Down
15 changes: 7 additions & 8 deletions test/Approximations/overapproximate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,12 @@ for N in [Float64]
cap = overapproximate(Z L, OctDirections)
@test (L Z) cap

# NOTE: ICP currently leads to unsatisfiable package requirements
# overapproximate a nonlinear constraint with an HPolyhedron
# dom = IntervalBox(interval(-2, 2), interval(-2, 2))
# C = @constraint x^2 + y^2 <= 1
# p = pave(C, dom, 0.01)
# dirs = OctDirections(2)
# H = overapproximate(p, dirs)
# B2 = Ball2(N[0, 0], N(1))
# @test B2 ⊆ H
dom = IntervalBox(interval(-2, 2), interval(-2, 2))
C = ICP.@constraint x^2 + y^2 <= 1
p = ICP.pave(C, dom, 0.01)
dirs = OctDirections(2)
H = overapproximate(p, dirs)
B2 = Ball2(N[0, 0], N(1))
@test B2 H
end
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ExponentialUtilities = "d4d017d3-3776-5f7e-afef-a10c40355c18"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalConstraintProgramming = "138f1668-1576-5ad7-91b9-7425abbf3153"
IntervalMatrices = "5c1f47dc-42dd-5697-8aaa-4d102d140ba9"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Expand Down Expand Up @@ -37,6 +38,7 @@ ExponentialUtilities = "1"
GLPK = "0.11 - 0.15, 1"
GR = "0"
IntervalArithmetic = "0.15 - 0.21, =0.21.2" # v0.22 removed IntervalBox
IntervalConstraintProgramming = "0.9 - 0.13"
IntervalMatrices = "0.8 - 0.10"
Ipopt = "1"
JuMP = "0.21 - 0.23, 1"
Expand Down
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Random.seed!(1234)
# Optional dependencies
# ========================
import Distributions, ExponentialUtilities, Expokit, IntervalMatrices, Ipopt,
MiniQhull, Optim, RangeEnclosures, SCS, SetProg, TaylorModels
MiniQhull, Optim, PkgVersion, RangeEnclosures, SCS, SetProg, TaylorModels
import IntervalConstraintProgramming as ICP
import IntervalArithmetic as IA
using IntervalArithmetic: IntervalBox, interval
@static if VERSION >= v"1.9"
Expand All @@ -23,8 +24,6 @@ else
end
using IntervalMatrices: ±, IntervalMatrix
using TaylorModels: set_variables, TaylorModelN
# ICP currently leads to unsatisfiable package requirements
# using IntervalConstraintProgramming
using Symbolics

# ==============================
Expand Down

0 comments on commit 1b38377

Please sign in to comment.