Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaIntervals/IntervalConstraintProgramming.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.13.0
Choose a base ref
...
head repository: JuliaIntervals/IntervalConstraintProgramming.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.14.0
Choose a head ref
  • 4 commits
  • 30 files changed
  • 3 contributors

Commits on Mar 17, 2024

  1. Update README.md (#211)

    schillic authored Mar 17, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    739bc0a View commit details

Commits on Dec 9, 2024

  1. Rewrite the package to use Symbolics and ReversePropagation (#212)

    * Add source files for rewrite
    
    * Add basic examples
    
    * Add ConstraintProblem
    
    * Bump versions
    
    * Add model.jl
    
    * update Project.toml and workflow
    
    * Update rewrite branch. Working with Symbolics 5,  IntervalArithmetic 0.20
    
    * Pass nanmath=false to build_function
    
    * Fix action of separator on box
    
    * Require Julia 1.10
    
    * Working with new versions of packages
    
    * Add basic usage and image to readme
    
    * Add boundary to plot
    
    * Fix
    
    * Replace PNG with SVG
    
    * Get tests passing with new API
    
    * Clean up by removing unneeded code and MacroTools dep
    
    * Add back missing files after name change
    
    ---------
    
    Co-authored-by: lucaferranti <[email protected]>
    dpsanders and lucaferranti authored Dec 9, 2024
    2

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6b5a070 View commit details
  2. Update NEWS.md

    dpsanders authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    967ccdc View commit details
  3. Bound dependencies in Project.toml

    dpsanders authored Dec 9, 2024
    2

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8032fa9 View commit details
Binary file added .DS_Store
Binary file not shown.
11 changes: 3 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: CI
on:
push:
branches: "master"
tags: ["*"]
pull_request:
release:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -14,9 +11,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.3' # oldest Julia version that works
- '1.8' # newest Julia version that works with ModelingToolkit
- '1'
- '1.10'
- 'nightly'
os:
- ubuntu-latest
1 change: 0 additions & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -12,5 +12,4 @@ jobs:
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,11 +2,4 @@
*.jl.*.cov
*.jl.mem
docs/build/

*.DS_Store

coverage/

.vscode

Manifest.toml
Manifest.toml
17 changes: 9 additions & 8 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# IntervalConstraintProgramming.jl

# v0.14
## New API using Symbolics
- The public API has been completely rewritten
- The previous macros such as `@constraint` have been removed
- The API now uses symbolic variables from `Symbolics.jl`
- See the README for usage examples

# v0.11
## Minimum Julia version
- The minimum Julia version supported is now Julia 1.1
@@ -8,7 +15,7 @@
- Contractor can be make by just function name only
- New type of Contractor named as `BasicContractor` can be construct which only contain fields of useful data.


# v0.10
## Minimum Julia version
- The minimum Julia version supported is now Julia 1.0.
@@ -17,7 +24,6 @@

- By the help of `ModelingToolkit.jl` we can construct contractors and separators without the use of macros.


# v0.9
## Minimum Julia version
- The minimum Julia version supported is now Julia 0.7. The package is fully compatible with Julia 1.0.
@@ -30,14 +36,12 @@
## Minimum Julia version
- The minimum Julia version required has been bumped to 0.6; this will be the last release to support 0.6.


# v0.7

## New dependency: `IntervalContractors.jl`

The reverse functions used for constraint propagation have been factored out into the `IntervalContractors.jl` package.


# v0.6
## Minimum Julia version
- The minimum Julia version required has been bumped to 0.5
@@ -48,7 +52,6 @@ The reverse functions used for constraint propagation have been factored out int
## Dependency change
- The dependency on `ValidatedNumerics.jl` has been replaced by `IntervalArithmetic.jl` and `IntervalRootFinding.jl`


# v0.5
- API change: Contractors now have their dimension as a type parameter
- Refactoring for type stability
@@ -57,7 +60,6 @@ The reverse functions used for constraint propagation have been factored out int
- Generated code uses simpler symbols
- Example notebooks have been split out into a separate repository: https://github.com/dpsanders/IntervalConstraintProgrammingNotebooks


# v0.4
- `@function f(x) = 4x` defines a function
- Functions may be used inside constraints
@@ -89,7 +91,6 @@ C = @constraint (x-$a)^2 + (y-$b)^2
The constraint will *not* change if the constants are changed, but may be
updated (changed) by calling the same `@constraint` command again.


# v0.2
- `setinverse` now returns an object of type `Paving` [#17](https://github.com/dpsanders/IntervalConstraintProgramming.jl/pull/17)

@@ -101,7 +102,7 @@ updated (changed) by calling the same `@constraint` command again.
to eliminate collisions with user-defined variables [#20](https://github.com/dpsanders/IntervalConstraintProgramming.jl/pull/20)


# v0.1.1
## v0.1.1
- Add `sqrtRev` reverse-mode function

- Add solid torus example, including 3D visualization with GLVisualize
27 changes: 19 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
name = "IntervalConstraintProgramming"
uuid = "138f1668-1576-5ad7-91b9-7425abbf3153"
version = "0.13"
version = "0.14.0"

[deps]
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalBoxes = "43d83c95-ebbb-40ec-8188-24586a1458ed"
IntervalContractors = "15111844-de3b-5229-b4ba-526f2f385dc9"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
ReversePropagation = "527681c1-8309-4d3f-8790-caf822a419ba"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]
IntervalArithmetic = "0.16, 0.17, 0.18, 0.19, 0.20"
IntervalContractors = "0.4"
MacroTools = "0.4, 0.5"
Requires = "0.5, 1"
julia = "1.3"
IntervalArithmetic = "0.22.12"
IntervalBoxes = "0.2"
IntervalContractors = "0.5"
ReversePropagation = "0.3"
StaticArrays = "1"
Symbolics = "5, 6"
julia = "1"

[extras]
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Symbolics"]
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@

[![Build Status](https://github.com/JuliaIntervals/IntervalConstraintProgramming.jl/workflows/CI/badge.svg)](https://github.com/JuliaIntervals/IntervalConstraintProgramming.jl/actions/workflows/CI.yml)
[![Docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaintervals.github.io/pages/packages/intervalconstraintprogramming/)
[![coverage](https://codecov.io/gh/JuliaIntervals/IntervalConstraintProgramming.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaIntervals/IntervalConstraintProgramming.jl)

This Julia package allows us to specify a set of constraints on real-valued variables,
given by inequalities, and
@@ -13,10 +12,44 @@ The package is based on interval arithmetic using the
[`IntervalArithmetic.jl`](https://github.com/JuliaIntervals/IntervalArithmetic.jl) package (co-written by the author),
in particular multi-dimensional `IntervalBox`es (i.e. Cartesian products of one-dimensional intervals).

## Documentation
<!-- ## Documentation
Documentation for the package is available [here](https://juliaintervals.github.io/pages/packages/intervalconstraintprogramming/).
The best way to learn how to use the package is to look at the tutorial, available in the organisation webpage [here](https://juliaintervals.github.io/pages/tutorials/tutorialConstraintProgramming/).
The best way to learn how to use the package is to look at the tutorial, available in the organisation webpage [here](https://juliaintervals.github.io/pages/tutorials/tutorialConstraintProgramming/). -->

## Basic usage

```jl
using IntervalArithmetic, IntervalArithmetic.Symbols
using IntervalConstraintProgramming
using IntervalBoxes
using Symbolics

vars = @variables x, y

C1 = constraint(x^2 + 2y^2 1, vars)
C2 = constraint(x^2 + y^2 + x * y 3, vars)
C = C1 C2

X = IntervalBox(-5..5, 2)

tolerance = 0.05
inner, boundary = pave(X, C, tolerance)

# plot the result:
using Plots

plot(collect.(inner), aspectratio=1, lw=0, label="inner");
plot!(collect.(boundary), aspectratio=1, lw=0, label="boundary")
```

- The inner, blue, region is guaranteed to lie *inside* the constraint set.
- The outer, white, region is guaranteed to lie *outside* the constraint set.
- The in-between, red, region is not known at this tolerance.

![Inner and outer ellipse](ellipses.svg?)




## Author
6 changes: 6 additions & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
julia 1.0
ModelingToolkit
IntervalArithmetic 0.15
IntervalRootFinding 0.4
IntervalContractors 0.3
MacroTools 0.4
12 changes: 6 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ julia> using IntervalConstraintProgramming, IntervalArithmetic
julia> S = @constraint x^2 + y^2 <= 1
Separator:
- variables: x, y
- expression: x ^ 2 + y ^ 2 ∈ [-, 1]
- expression: x ^ 2 + y ^ 2 ∈ [-Inf, 1]
```
It works out automatically that `x` and `y` are variables.
The macro creates a `Separator` object, in this case a `ConstraintSeparator`.
@@ -73,7 +73,7 @@ julia> @variables x y
julia> S = Separator(x+y<1)
Separator:
- variables: x, y
- expression: x() + y() == [-, 1]
- expression: x() + y() == [-Inf, 1]

julia> C = Contractor(x+y)
Contractor in 2 dimensions:
@@ -91,7 +91,7 @@ julia> vars = @variables x y z
julia> S = Separator(vars, x+y<1)
Separator:
- variables: x, y, z
- expression: x() + y() == [-, 1]
- expression: x() + y() == [-Inf, 1]

julia> C = Contractor(vars, y+z)
Contractor in 3 dimensions:
@@ -120,7 +120,7 @@ f (generic function with 1 method)
julia> S=Separator(vars, f)
Separator:
- variables: x, y
- expression: x() + y() == [-, 1]
- expression: x() + y() == [-Inf, 1]

julia> using DynamicPolynomials #using polynomial functions

@@ -133,7 +133,7 @@ p (generic function with 1 method)
julia> S=Separator(pvars, f)
Separator:
- variables: x, y
- expression: x() + y() == [-, 1]
- expression: x() + y() == [-Inf, 1]
```
#### BasicContractor
Objects of type `Contractor` have four fields (variables, forward, backward and expression), among them data of two fields (forward, backward) are useful (i.e forward and backward functions) for further usage of that object, thats why it is preferred to use an object of type `BasicContractor` in place of `Contractor` which only contain these two fields for less usage of memory by unloading all the extra stuff.(Note: Like object of `Contractor` type,`BasicContractor`'s object will also have all the properties which are discussed above).
@@ -196,7 +196,7 @@ There are sample 3D calculations in the `examples` directory, in particular in t


## Set operations
Separators may be combined using the operators `!` (complement), `` and `` to make
Separators may be combined using the operators `!` (complement), `` and `` to make
more complicated sets; see the [notebook](https://github.com/JuliaIntervals/IntervalConstraintProgrammingNotebooks/blob/master/Basic%20examples%20of%20separators.ipynb) for several examples. Further examples can be found in the repository [IntervalConstraintProgrammingNotebooks](https://github.com/JuliaIntervals/IntervalConstraintProgrammingNotebooks).

## Author
Loading