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
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 }}
Expand All @@ -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'
Comment on lines -17 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not recommend removing the tests on older Julia versions and only testing on v1.10. It is very easy to introduce changes that break old versions unnoticed (I saw it happening many times), particularly because you presumably do not use them for development anymore. If v1.10 is the lowest supported version, that should be reflected in Project.toml (see the other comment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to just set the lower bound as 1.10 since that's the new LTS version, right?

Copy link
Contributor

@schillic schillic Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally reasonable.
But note that v1.6-v1.9 would still be installing the current release. So if it broke, that would leave the package in a broken state for these Julia versions. (You could retroactively fix the entry in the registry to raise the Julia version in that case.)

- 'nightly'
os:
- ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -2,11 +2,4 @@
*.jl.*.cov
*.jl.mem
docs/build/

*.DS_Store

coverage/

.vscode

Manifest.toml
Manifest.toml
14 changes: 4 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# IntervalConstraintProgramming.jl

# v0.11
#v0.11
## Minimum Julia version
- The minimum Julia version supported is now Julia 1.1

## Functionality's are added
##Functionality's are added
- 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.
Expand All @@ -17,7 +17,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.
Expand All @@ -30,14 +29,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
Expand All @@ -48,7 +45,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
Expand All @@ -57,7 +53,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
Expand Down Expand Up @@ -89,7 +84,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)

Expand All @@ -101,7 +95,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
Expand Down
25 changes: 17 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
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"
IntervalContractors = "0.5"
ReversePropagation = "0.3"
Symbolics = "5, 6"
julia = "1"
Comment on lines -16 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Symbolics v5 already required Julia v1.6, so widening the lower bound from v1.3 to v1.0 seems strange. Maybe you intended to use a higher version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't that get resolved automatically?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, just tried it:

(v1.1) pkg> add IntervalConstraintProgramming
[...]
 Installed IntervalConstraintProgramming ─ v0.12.0
[...]

But I still find it misleading when you look at the Project file to know which version you need at least. Then I would rather omit the julia entry completely.


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

[targets]
test = ["Test", "Symbolics"]
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,14 +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?)

#### ℹ️ Note on ModelingToolkit

ModelingToolkit can be used to conveniently define constraints, as described in the tutorial. However, that package is only compatible up to Julia version 1.9, and it needs to be installed manually and restricted to version 3. Later versions of ModelingToolkit or Julia are not compatible yet.


## Author
Expand Down
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
Expand Up @@ -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`.
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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).
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading