Skip to content

Commit 1b38377

Browse files
authored
Merge pull request #3482 from JuliaReach/schillic/icp
Bring back IntervalConstraintProgramming in tests
2 parents be0807f + dab587a commit 1b38377

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

docs/src/man/optional_dependencies.md

-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ The package [`IntervalLinearAlgebra`](https://github.com/JuliaIntervals/Interval
5858
|[`IntervalMatrices`](https://github.com/JuliaReach/IntervalMatrices.jl) | Set operations that involve matrices whose coefficients are intervals.|
5959
|[`TaylorModels`](https://github.com/JuliaIntervals/TaylorModels.jl) |Taylor expansion of functions with rigorous interval remainder.|
6060

61-
Note: `IntervalConstraintProgramming` is currently not tested due to compatibility issues.
62-
6361
## Optimization algorithms
6462

6563
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.

src/Approximations/overapproximate.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ function load_paving_overapproximation()
641641
converted into hyperrectangles, and then calculates the support function of the
642642
set along each direction in dirs, to compute the `HPolyhedron` constraints.
643643
644-
### Requires IntervalConstraintProgramming
644+
This algorithm requires the IntervalConstraintProgramming package.
645645
"""
646646
function overapproximate(p::Paving{L,N}, dirs::AbstractDirections{N,VN}) where {L,N,VN}
647647
# enclose outer approximation

test/Approximations/overapproximate.jl

+7-8
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,12 @@ for N in [Float64]
513513
cap = overapproximate(Z L, OctDirections)
514514
@test (L Z) cap
515515

516-
# NOTE: ICP currently leads to unsatisfiable package requirements
517516
# overapproximate a nonlinear constraint with an HPolyhedron
518-
# dom = IntervalBox(interval(-2, 2), interval(-2, 2))
519-
# C = @constraint x^2 + y^2 <= 1
520-
# p = pave(C, dom, 0.01)
521-
# dirs = OctDirections(2)
522-
# H = overapproximate(p, dirs)
523-
# B2 = Ball2(N[0, 0], N(1))
524-
# @test B2 ⊆ H
517+
dom = IntervalBox(interval(-2, 2), interval(-2, 2))
518+
C = ICP.@constraint x^2 + y^2 <= 1
519+
p = ICP.pave(C, dom, 0.01)
520+
dirs = OctDirections(2)
521+
H = overapproximate(p, dirs)
522+
B2 = Ball2(N[0, 0], N(1))
523+
@test B2 H
525524
end

test/Project.toml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ExponentialUtilities = "d4d017d3-3776-5f7e-afef-a10c40355c18"
77
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
88
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
99
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
10+
IntervalConstraintProgramming = "138f1668-1576-5ad7-91b9-7425abbf3153"
1011
IntervalMatrices = "5c1f47dc-42dd-5697-8aaa-4d102d140ba9"
1112
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
1213
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
@@ -37,6 +38,7 @@ ExponentialUtilities = "1"
3738
GLPK = "0.11 - 0.15, 1"
3839
GR = "0"
3940
IntervalArithmetic = "0.15 - 0.21, =0.21.2" # v0.22 removed IntervalBox
41+
IntervalConstraintProgramming = "0.9 - 0.13"
4042
IntervalMatrices = "0.8 - 0.10"
4143
Ipopt = "1"
4244
JuMP = "0.21 - 0.23, 1"

test/runtests.jl

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Random.seed!(1234)
1010
# Optional dependencies
1111
# ========================
1212
import Distributions, ExponentialUtilities, Expokit, IntervalMatrices, Ipopt,
13-
MiniQhull, Optim, RangeEnclosures, SCS, SetProg, TaylorModels
13+
MiniQhull, Optim, PkgVersion, RangeEnclosures, SCS, SetProg, TaylorModels
14+
import IntervalConstraintProgramming as ICP
1415
import IntervalArithmetic as IA
1516
using IntervalArithmetic: IntervalBox, interval
1617
@static if VERSION >= v"1.9"
@@ -23,8 +24,6 @@ else
2324
end
2425
using IntervalMatrices: ±, IntervalMatrix
2526
using TaylorModels: set_variables, TaylorModelN
26-
# ICP currently leads to unsatisfiable package requirements
27-
# using IntervalConstraintProgramming
2827
using Symbolics
2928

3029
# ==============================

0 commit comments

Comments
 (0)