Skip to content

Commit

Permalink
Working with new versions of packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders committed Sep 2, 2024
1 parent d867bf0 commit aae4823
Show file tree
Hide file tree
Showing 18 changed files with 166 additions and 1,702 deletions.
14 changes: 8 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name = "IntervalConstraintProgramming"
uuid = "138f1668-1576-5ad7-91b9-7425abbf3153"
version = "0.14"
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"
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"
IntervalArithmetic = "0.22.12"
IntervalContractors = "0.5"
MacroTools = "0.4, 0.5"
ReversePropagation = "0.2"
Symbolics = "1, 2, 3, 4, 5"
julia = "1.10"
ReversePropagation = "0.3"
Symbolics = "5, 6"
julia = "1"

[extras]
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Expand Down
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
4 changes: 2 additions & 2 deletions examples/basic_examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ p1 = pave(X, S1, 0.1)
p2 = pave(X, S2, 0.1)


S = S1 S2
S = S1 S2

p3 = pave(X, S, 0.1)

Expand All @@ -66,7 +66,7 @@ plot_paving!(p4; plot_options...)

typeof(S)

# SS = S1 (!S2);
# SS = S1 (!S2);

SS = setdiff(S1, S2);

Expand Down
2 changes: 1 addition & 1 deletion examples/sliced_solid_torus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ half_space = @constraint (x + y) + z <= 1
x = interval(-5, 5)
Y = IntervalBox(x, 3)

@time paving = pave(solid_torus half_space, Y, 0.1);
@time paving = pave(solid_torus half_space, Y, 0.1);

inner = paving.inner
boundary = paving.boundary;
Expand Down
15 changes: 9 additions & 6 deletions src/IntervalConstraintProgramming.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ __precompile__()

module IntervalConstraintProgramming

using IntervalArithmetic,
IntervalContractors
using IntervalArithmetic, IntervalArithmetic.Symbols
using IntervalContractors
using IntervalBoxes

using Symbolics
using Symbolics: operation, value, arguments, toexpr, Sym

using Symbolics: @register_symbolic

using StaticArrays

using ReversePropagation

# using MacroTools

import IntervalArithmetic.Symbols: ,

import Base:
show, , , !, , setdiff, symdiff, &, |,
show, !, , setdiff, symdiff, &, |,

import IntervalArithmetic: sqr, setindex
import IntervalArithmetic: mid, interval, emptyinterval, isinf, isinterior, hull, mince


@register_symbolic ¬(x)
# @register_symbolic x & y
# @register_symbolic x | y
@register_symbolic x y::Interval
@register_symbolic x y
@register_symbolic x y
Expand Down
Loading

0 comments on commit aae4823

Please sign in to comment.