From c6454f29ef79042ed67296d6b6ff597ce56628ba Mon Sep 17 00:00:00 2001 From: David Sanders Date: Sat, 8 Apr 2017 19:01:49 -0500 Subject: [PATCH 1/7] Move to IntervalArithmetic.jl --- src/IntervalConstraintProgramming.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IntervalConstraintProgramming.jl b/src/IntervalConstraintProgramming.jl index 0db6710..21bf82b 100644 --- a/src/IntervalConstraintProgramming.jl +++ b/src/IntervalConstraintProgramming.jl @@ -2,14 +2,14 @@ __precompile__() module IntervalConstraintProgramming -using ValidatedNumerics, ValidatedNumerics.RootFinding +using IntervalArithmetic, IntervalRootFinding using MacroTools using Compat import Base: show, ∩, ∪, !, ⊆, setdiff -import ValidatedNumerics: sqr +import IntervalArithmetic: sqr export @contractor, From 18de6c9a592db62ce3cc67cbf49ee6453727a609 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Sat, 8 Apr 2017 19:31:07 -0500 Subject: [PATCH 2/7] Change ValidatedNumerics to IntervalArithmetic --- NEWS.md | 6 +++--- README.md | 2 +- REQUIRE | 2 +- docs/make.jl | 2 +- docs/src/index.md | 10 +++++----- src/IntervalConstraintProgramming.jl | 3 ++- test/runtests.jl | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/NEWS.md b/NEWS.md index adbdbfd..04b6dbc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,8 +3,8 @@ # v0.5 - API change: Contractors now have their dimension as a type parameter - Refactoring for type stability -- Removed reference to FixedSizeArrays; everything (including `bisect`) is now provided by `ValidatedNumerics` -- Removed all functions acting directly on `Interval`s and `IntervalBox`es that should belong to `ValidatedNumerics` +- Removed reference to FixedSizeArrays; everything (including `bisect`) is now provided by `IntervalArithmetic` +- Removed all functions acting directly on `Interval`s and `IntervalBox`es that should belong to `IntervalArithmetic` - Generated code uses simpler symbols - Example notebooks have been split out into a separate repository: https://github.com/dpsanders/IntervalConstraintProgrammingNotebooks @@ -15,7 +15,7 @@ - Functions may be multi-dimensional - Local variables may be introduced - Simple plotting solution for the results of `pave` using `Plots.jl` recipes -(via `ValidatedNumerics.jl`): +(via `IntervalArithmetic.jl`): ``` using Plots gr() # preferred (fast) backed for `Plots.jl` diff --git a/README.md b/README.md index 6dded09..0d885cd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ rigorously calculate (inner and outer approximations to) the *feasible set*, i.e. the set that satisfies the constraints. The package is based on interval arithmetic using the author's -[`ValidatedNumerics.jl`](https://github.com/dpsanders/ValidatedNumerics.jl) package, +[`IntervalArithmetic.jl`](https://github.com/dpsanders/IntervalArithmetic.jl) package, in particular multi-dimensional `IntervalBox`es (i.e. Cartesian products of one-dimensional intervals). ## Documentation diff --git a/REQUIRE b/REQUIRE index 2f8b274..9d20561 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,4 @@ julia 0.4 -ValidatedNumerics 0.7 +IntervalArithmetic 0.7 MacroTools 0.3 Compat 0.7.14 diff --git a/docs/make.jl b/docs/make.jl index dcfcf70..3fc3266 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,5 @@ using Documenter -using IntervalConstraintProgramming, ValidatedNumerics +using IntervalConstraintProgramming, IntervalArithmetic makedocs( modules = [IntervalConstraintProgramming], diff --git a/docs/src/index.md b/docs/src/index.md index ae7c898..3478b96 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -5,7 +5,7 @@ rigorously calculate inner and outer approximations to the *feasible set*, i.e. the set that satisfies the constraints. This uses interval arithmetic provided by the author's -[`ValidatedNumerics.jl`](https://github.com/dpsanders/ValidatedNumerics.jl) package, +[`IntervalArithmetic.jl`](https://github.com/dpsanders/IntervalArithmetic.jl) package, in particular multi-dimensional `IntervalBox`es, i.e. Cartesian products of one-dimensional intervals. To do this, *interval constraint programming* is used, in particular the @@ -14,14 +14,14 @@ so-called "forward--backward contractor". This is implemented in terms of *separ ```@meta DocTestSetup = quote - using IntervalConstraintProgramming, ValidatedNumerics + using IntervalConstraintProgramming, IntervalArithmetic end ``` ## Usage Let's define a constraint, using the `@constraint` macro: ```jldoctest -julia> using IntervalConstraintProgramming, ValidatedNumerics +julia> using IntervalConstraintProgramming, IntervalArithmetic julia> S = @constraint x^2 + y^2 <= 1 Separator: @@ -33,7 +33,7 @@ The macro creates a `Separator` object, in this case a `ConstraintSeparator`. We now create an initial interval box in the $x$--$y$ plane: ```julia -julia> x = y = -100..100 # notation for creating an interval with `ValidatedNumerics.jl` +julia> x = y = -100..100 # notation for creating an interval with `IntervalArithmetic.jl` julia> X = IntervalBox(x, y) ``` @@ -81,7 +81,7 @@ an `inner` approximation, of type `SubPaving`, which is an alias for a `Vector` a `SubPaving` representing the boxes on the boundary that could not be assigned either to the inside or outside of the set; and the tolerance. -We may draw the result using a plot recipe from `ValidatedNumerics`. Either a +We may draw the result using a plot recipe from `IntervalArithmetic`. Either a single `IntervalBox`, or a `Vector` of `IntervalBox`es (which a `SubPaving` is) maybe be drawn using `plot` from `Plots.jl`: ```julia diff --git a/src/IntervalConstraintProgramming.jl b/src/IntervalConstraintProgramming.jl index 21bf82b..7521cbc 100644 --- a/src/IntervalConstraintProgramming.jl +++ b/src/IntervalConstraintProgramming.jl @@ -3,13 +3,14 @@ __precompile__() module IntervalConstraintProgramming using IntervalArithmetic, IntervalRootFinding + using MacroTools using Compat import Base: show, ∩, ∪, !, ⊆, setdiff -import IntervalArithmetic: sqr +import IntervalArithmetic: sqr, setindex export @contractor, diff --git a/test/runtests.jl b/test/runtests.jl index 08ca971..972e895 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,7 +7,7 @@ else end using IntervalConstraintProgramming -using ValidatedNumerics #, ValidatedNumerics.RootFinding +using IntervalArithmetic #, IntervalArithmetic.RootFinding #using Base.Test From b3e9768d4146c8ad83880949a9acae8eec320df3 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 18 Apr 2017 08:23:51 -0500 Subject: [PATCH 3/7] Bump minimum Julia version to 0.5 --- REQUIRE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/REQUIRE b/REQUIRE index 9d20561..76e8bb9 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,4 @@ -julia 0.4 -IntervalArithmetic 0.7 +julia 0.5 +IntervalArithmetic 0.9 MacroTools 0.3 Compat 0.7.14 From c218c66a26fbb9df226d8300ceebc80b2c0b0a09 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 18 Apr 2017 08:29:52 -0500 Subject: [PATCH 4/7] Remove 0.4 from .travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e49fa7f..14cdf55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,14 +6,15 @@ os: - osx julia: - - 0.4 - 0.5 + - 0.6 - nightly matrix: allow_failures: - julia: 0.5 + notifications: email: false From ea24f87736bd9f84d2d6e509409672147c6adaf6 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 18 Apr 2017 10:56:10 -0500 Subject: [PATCH 5/7] Add IntervalRootFinding to REQUIRE --- REQUIRE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/REQUIRE b/REQUIRE index 76e8bb9..efc5e6d 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,5 @@ julia 0.5 IntervalArithmetic 0.9 +IntervalRootFinding 0.1 MacroTools 0.3 -Compat 0.7.14 + From 80178b0daee3d654f7beabe37982aed36c4ebf68 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 18 Apr 2017 10:57:46 -0500 Subject: [PATCH 6/7] Remove Compat and uses of @compat --- src/IntervalConstraintProgramming.jl | 1 - src/contractor.jl | 4 ++-- src/separator.jl | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/IntervalConstraintProgramming.jl b/src/IntervalConstraintProgramming.jl index 7521cbc..936e75a 100644 --- a/src/IntervalConstraintProgramming.jl +++ b/src/IntervalConstraintProgramming.jl @@ -5,7 +5,6 @@ module IntervalConstraintProgramming using IntervalArithmetic, IntervalRootFinding using MacroTools -using Compat import Base: show, ∩, ∪, !, ⊆, setdiff diff --git a/src/contractor.jl b/src/contractor.jl index 376edae..027a8f3 100644 --- a/src/contractor.jl +++ b/src/contractor.jl @@ -43,7 +43,7 @@ end -@compat function (C::Contractor{N,Nout,F1,F2}){N,Nout,F1,F2,T}( +function (C::Contractor{N,Nout,F1,F2}){N,Nout,F1,F2,T}( A::IntervalBox{Nout,T}, X::IntervalBox{N,T}) output, intermediate = C.forward(X) @@ -69,7 +69,7 @@ end end # allow 1D contractors to take Interval instead of IntervalBox for simplicty: -@compat (C::Contractor{N,1,F1,F2}){N,F1,F2,T}(A::Interval{T}, X::IntervalBox{N,T}) = C(IntervalBox(A), X) +(C::Contractor{N,1,F1,F2}){N,F1,F2,T}(A::Interval{T}, X::IntervalBox{N,T}) = C(IntervalBox(A), X) function make_contractor(expr::Expr) # println("Entering Contractor(ex) with ex=$ex") diff --git a/src/separator.jl b/src/separator.jl index 63b3a6c..ffedba5 100644 --- a/src/separator.jl +++ b/src/separator.jl @@ -23,7 +23,7 @@ immutable CombinationSeparator{F} <: Separator expression::Expr end -@compat function (S::ConstraintSeparator)(X::IntervalBox) +function (S::ConstraintSeparator)(X::IntervalBox) C = S.contractor a, b = S.constraint.lo, S.constraint.hi @@ -162,7 +162,7 @@ function show(io::IO, S::Separator) end -@compat (S::CombinationSeparator)(X) = S.separator(X) +(S::CombinationSeparator)(X) = S.separator(X) doc"Unify the variables of two separators" From b44e18d420a1cbd6495f81bd6386aec70ccf8b72 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 18 Apr 2017 11:10:02 -0500 Subject: [PATCH 7/7] Remove BaseTestNext --- test/REQUIRE | 1 - 1 file changed, 1 deletion(-) diff --git a/test/REQUIRE b/test/REQUIRE index 94e516f..e69de29 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -1 +0,0 @@ -BaseTestNext