Skip to content

Commit

Permalink
Added decomposed overapproximate for lazy intersection between CPA an…
Browse files Browse the repository at this point in the history
…d Polyhedron

Squashed commit of the following:

commit ac50169
Author: Unknown <[email protected]>
Date:   Sat Jun 15 17:40:24 2019 +1000

    added one more test for old overapproximate of lazy intersection

commit 509b7f8
Author: Unknown <[email protected]>
Date:   Sat Jun 15 04:08:49 2019 +1000

    added using project

commit 795f593
Author: Unknown <[email protected]>
Date:   Sat Jun 15 03:46:50 2019 +1000

    fixed tests

commit b722c3c
Author: Unknown <[email protected]>
Date:   Fri Jun 14 19:01:32 2019 +1000

    small refactoring in unit_overapproximate

commit 89fe48f
Merge: 8f6f735 a5545ae
Author: Unknown <[email protected]>
Date:   Fri Jun 14 16:29:31 2019 +1000

    Merge remote-tracking branch 'origin/master' into kostemkin/1041_new

commit 8f6f735
Author: Unknown <[email protected]>
Date:   Fri Jun 14 16:28:19 2019 +1000

    fixed tests

commit 8448622
Author: Unknown <[email protected]>
Date:   Fri Jun 14 14:38:23 2019 +1000

    try to push the test

commit a5545ae
Author: Marcelo Forets <[email protected]>
Date:   Thu Jun 13 15:15:09 2019 -0300

    Update Project.toml (#1437)

commit 9dd9cc9
Author: Marcelo Forets <[email protected]>
Date:   Thu Jun 13 13:41:53 2019 -0300

    Pr/1408 (#1433)

    * Add TaylorModels optional requirement
    * Linear case
    * Nonlinear case

commit 413743e
Author: Unknown <[email protected]>
Date:   Fri Jun 14 01:39:07 2019 +1000

    fixed tests

commit 47f9226
Author: Unknown <[email protected]>
Date:   Thu Jun 13 16:54:11 2019 +1000

    added new tests for decomposed overapproximate and minor refactoring

commit a7e8305
Author: Sebastián Guadalupe <[email protected]>
Date:   Wed Jun 12 18:29:49 2019 -0300

    remove redundant vertices of LinearMap (#1428)

commit c0fb6d6
Author: Unknown <[email protected]>
Date:   Thu Jun 13 02:58:12 2019 +1000

    some code clean ups according to Christian`s comments

commit 6d58c75
Merge: 02916e5 c52a2c4
Author: Christian Schilling <[email protected]>
Date:   Wed Jun 12 09:56:12 2019 +0200

    Merge pull request #1432 from JuliaReach/schillic/times

    Export 'times' symbol

commit c52a2c4
Author: schillic <[email protected]>
Date:   Wed Jun 12 08:42:55 2019 +0200

    export 'times' symbol

commit d70ddef
Merge: 6427a29 0aa9825
Author: Unknown <[email protected]>
Date:   Wed Jun 12 14:18:06 2019 +1000

    Merge remote-tracking branch 'origin/master' into kostemkin/1041_new

commit 6427a29
Author: Unknown <[email protected]>
Date:   Wed Jun 12 04:03:30 2019 +1000

    fixed docs

commit 02916e5
Merge: 19b51ea 32a6cfa
Author: Christian Schilling <[email protected]>
Date:   Tue Jun 11 12:17:22 2019 +0200

    Merge pull request #1425 from JuliaReach/schillic/merge

    Simplifications in overapproximate

commit b33cab8
Author: Unknown <[email protected]>
Date:   Tue Jun 11 20:10:58 2019 +1000

    further changes in documentation and removing redundant code and comments

commit 19b51ea
Author: Marcelo Forets <[email protected]>
Date:   Tue Jun 11 06:34:19 2019 -0300

    Update README.md (#1423)

    * Update README.md

    * update README and About

commit 5f17132
Author: Unknown <[email protected]>
Date:   Tue Jun 11 15:49:43 2019 +1000

    exporting common intersection preprocess part

commit b965fb3
Author: Unknown <[email protected]>
Date:   Tue Jun 11 03:13:14 2019 +1000

    export common intersection preprocess part

commit 1d55f57
Author: Unknown <[email protected]>
Date:   Tue Jun 11 02:47:23 2019 +1000

    better functions definition in docs and minor refactoring

commit 77640db
Author: Unknown <[email protected]>
Date:   Mon Jun 10 19:27:27 2019 +1000

    add missing docs

commit 133e962
Author: Unknown <[email protected]>
Date:   Mon Jun 10 18:59:09 2019 +1000

    updated doc

commit f67024f
Author: Unknown <[email protected]>
Date:   Mon Jun 10 18:54:06 2019 +1000

    correct import

commit 8b14a4a
Author: Unknown <[email protected]>
Date:   Mon Jun 10 18:51:16 2019 +1000

    small refactoring and updated doc

commit 0aa9825
Merge: 847ffe8 a56ebc3
Author: Christian Schilling <[email protected]>
Date:   Fri Jun 7 13:19:45 2019 +0200

    Merge pull request #1426 from JuliaReach/schillic/aspectratio

    Set default aspect ratio in plot recipes to :none

commit 06bc249
Author: Unknown <[email protected]>
Date:   Fri Jun 7 21:00:27 2019 +1000

    refactoring to use Vector{Tuple{Int, Int}} for block indices

commit a56ebc3
Author: schillic <[email protected]>
Date:   Fri Jun 7 07:52:54 2019 +0200

    set default aspectratio in plot recipes to :none

commit 32a6cfa
Author: schillic <[email protected]>
Date:   Thu Jun 6 17:01:58 2019 +0200

    simplifications in overapproximate

commit 847ffe8
Merge: 2770dd6 af32212
Author: Christian Schilling <[email protected]>
Date:   Thu Jun 6 13:20:05 2019 +0200

    Merge pull request #1414 from JuliaReach/schillic/empty_polytope_intersection

    Check for emptiness in concrete intersection using Polyhedra

commit 2770dd6
Merge: 875ecaf 03823d1
Author: Christian Schilling <[email protected]>
Date:   Thu Jun 6 13:02:08 2019 +0200

    Merge pull request #1419 from JuliaReach/kostemkin/1091

    Decomposed linear map of CartesianProductArray

commit 875ecaf
Merge: 9bc6422 fd2f305
Author: Christian Schilling <[email protected]>
Date:   Thu Jun 6 12:26:06 2019 +0200

    Merge pull request #1409 from JuliaReach/schillic/378

    #378 - Add isapprox between sets

commit 03823d1
Author: Unknown <[email protected]>
Date:   Thu Jun 6 18:15:10 2019 +1000

    updated tests due to sparse

commit 9b8f5be
Author: Unknown <[email protected]>
Date:   Thu Jun 6 18:11:07 2019 +1000

    Code clean up

commit 16f4a71
Author: Unknown <[email protected]>
Date:   Thu Jun 6 16:34:15 2019 +1000

    fixed tests and function signature

commit 2c48134
Author: Unknown <[email protected]>
Date:   Thu Jun 6 16:27:08 2019 +1000

    Moved intersection to overapproximation

commit e20224a
Author: Unknown <[email protected]>
Date:   Thu Jun 6 15:50:32 2019 +1000

    added new tests and refactoring

    added functionality to keep the original structure and preallocate corresponding  set

commit 9bc6422
Author: Marcelo Forets <[email protected]>
Date:   Wed Jun 5 19:16:55 2019 -0300

    Update README.md

commit 617de10
Author: Sebastián Guadalupe <[email protected]>
Date:   Wed Jun 5 19:15:32 2019 -0300

    Add three point case for concrete convex hull (#1411)

commit 4221528
Merge: e517950 f1aa1ae
Author: Christian Schilling <[email protected]>
Date:   Wed Jun 5 19:05:48 2019 +0200

    Merge pull request #1415 from JuliaReach/schillic/571

    #571 - Restrict iterative refinement to AbstractFloat

commit f1aa1ae
Author: schillic <[email protected]>
Date:   Fri May 31 22:13:59 2019 +0200

    restrict type for iterative refinement

commit 14a5980
Author: Unknown <[email protected]>
Date:   Wed Jun 5 20:31:08 2019 +1000

    fixed is_intersection_empty to use correct projection

commit 5f033d7
Author: Unknown <[email protected]>
Date:   Wed Jun 5 20:12:34 2019 +1000

    removed redundant function

commit 6b62873
Author: Unknown <[email protected]>
Date:   Wed Jun 5 20:08:21 2019 +1000

    added correct projection

commit 6160bee
Author: Unknown <[email protected]>
Date:   Wed Jun 5 20:06:44 2019 +1000

    Removed workarounds for LinearMap projection

commit 9f0a8ce
Author: Unknown <[email protected]>
Date:   Wed Jun 5 18:40:25 2019 +1000

    Added tests

commit a03e868
Author: Unknown <[email protected]>
Date:   Wed Jun 5 18:18:35 2019 +1000

    Added missing is_intersection_empty functions

commit 13e7b9c
Author: kostakoida <[email protected]>
Date:   Wed Jun 5 18:00:12 2019 +1000

    Update src/Approximations/overapproximate.jl

    Co-Authored-By: Christian Schilling <[email protected]>

commit 80eed63
Author: Unknown <[email protected]>
Date:   Wed Jun 5 17:55:26 2019 +1000

    small refactoring according to Christian's recommendations

commit a66586a
Author: Unknown <[email protected]>
Date:   Wed Jun 5 15:47:37 2019 +1000

    intersection works

commit ece7d74
Author: Unknown <[email protected]>
Date:   Wed Jun 5 05:23:36 2019 +1000

    fixed tests and type instability

commit 16521c3
Author: Unknown <[email protected]>
Date:   Wed Jun 5 05:06:09 2019 +1000

    small fixes and added intersection between Cartesian products

commit 54d73fd
Author: Unknown <[email protected]>
Date:   Wed Jun 5 04:11:41 2019 +1000

    updated linear map to use correct rows and updated tests

commit 8742462
Author: Unknown <[email protected]>
Date:   Wed Jun 5 01:23:36 2019 +1000

    added tests

commit c7fc98d
Author: Unknown <[email protected]>
Date:   Wed Jun 5 01:10:10 2019 +1000

    cleaned up the code

commit 80ab0cb
Author: Unknown <[email protected]>
Date:   Tue Jun 4 23:43:19 2019 +1000

    Correct minkowski sum addition

commit e517950
Merge: 873bbf1 cfae8fd
Author: Christian Schilling <[email protected]>
Date:   Tue Jun 4 14:11:15 2019 +0200

    Merge pull request #1420 from JuliaReach/schillic/README

    Update README

commit cfae8fd
Author: schillic <[email protected]>
Date:   Tue Jun 4 10:42:22 2019 +0200

    update README

commit 5b97aec
Author: Unknown <[email protected]>
Date:   Tue Jun 4 18:57:12 2019 +1000

    small fixes

commit cf01ae6
Author: Unknown <[email protected]>
Date:   Tue Jun 4 18:50:19 2019 +1000

    updated according to comments

commit 7e2891f
Author: Unknown <[email protected]>
Date:   Tue Jun 4 17:52:32 2019 +1000

    added getting block_structure for CPA and intersection by union of blocks

commit a79b038
Author: Unknown <[email protected]>
Date:   Tue Jun 4 16:33:53 2019 +1000

    added block_indices and variable_indices

commit b98b789
Author: Unknown <[email protected]>
Date:   Tue Jun 4 16:31:30 2019 +1000

    Added using @view

commit ecabee5
Author: Unknown <[email protected]>
Date:   Tue Jun 4 14:45:14 2019 +1000

    updated overaproximation of  decomposed linear map according to Christian comments

commit ef60e2e
Author: Unknown <[email protected]>
Date:   Sun Jun 2 01:46:13 2019 +1000

    Added overapproximation of Lazy linear map of cartesian product array

commit af32212
Author: schillic <[email protected]>
Date:   Fri May 31 17:27:23 2019 +0200

    check for emptiness in concrete intersection using Polyhedra

commit fd2f305
Author: schillic <[email protected]>
Date:   Tue May 28 20:17:35 2019 +0200

    add isapprox between 'LazySet's
  • Loading branch information
kpotomkin committed Jun 16, 2019
1 parent 873bbf1 commit a96a698
Show file tree
Hide file tree
Showing 28 changed files with 1,150 additions and 102 deletions.
8 changes: 6 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LazySets"
uuid = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
version = "1.12.0"
version = "1.13.0"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand All @@ -26,6 +26,7 @@ Optim = "≥ 0.14.1"
Polyhedra = "≥ 0.3.4"
RecipesBase = "≥ 0.3.0"
Requires = "≥ 0.4.0"
TaylorModels = "≥ 0.1.1"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand All @@ -40,6 +41,9 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a"

[targets]
test = ["Expokit", "Pkg", "IntervalArithmetic", "GLPKMathProgInterface", "RecipesBase", "MathProgBase", "Requires", "Optim", "Polyhedra", "Documenter", "Plots", "GR"]
test = ["Documenter", "Expokit", "GLPKMathProgInterface", "GR",
"IntervalArithmetic", "MathProgBase", "Optim", "Pkg", "Plots",
"Polyhedra", "RecipesBase", "Requires", "TaylorModels"]
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,36 @@
## Resources

- [Manual](http://juliareach.github.io/LazySets.jl/latest/)
- [Contributing](https://juliareach.github.io/LazySets.jl/latest/about.html#Contributing-1)
- [Contributing](https://juliareach.github.io/LazySets.jl/latest/about/#Contributing-1)
- [Release notes of tagged versions](https://github.com/JuliaReach/LazySets.jl/releases)
- [Release notes of the development version](https://github.com/JuliaReach/LazySets.jl/wiki/Release-log-tracker)
- [Publications](https://juliareach.github.io/Reachability.jl/latest/publications.html)
- [Developers](https://juliareach.github.io/LazySets.jl/latest/about/#Credits-1)

## Installing

This package requires Julia v0.6 or later. Refer to the [official documentation](https://julialang.org/downloads)
on how to install and run Julia in your system.
This package requires Julia v1.0 or later.
Refer to the [official documentation](https://julialang.org/downloads) on how to
install and run Julia on your system.

To install the latest release of this package, use the following command inside Julia's REPL:
Depending on your needs, choose an appropriate command from the following list
and enter it in Julia's REPL.
To activate the `pkg` mode, type `]` (and to leave it, type `exit()`).

#### [Install the latest release version](https://julialang.github.io/Pkg.jl/v1/managing-packages/#Adding-registered-packages-1)

```julia
pkg> add LazySets
```

#### Install the latest development version

```julia
using Pkg
Pkg.add("LazySets")
pkg> add LazySets#master
```

If you want to install the latest development version, do:
#### [Clone the package for development](https://julialang.github.io/Pkg.jl/v1/managing-packages/#Developing-packages-1)

```julia
Pkg.clone("https://github.com/JuliaReach/LazySets.jl.git")
pkg> dev LazySets
```
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a"

[compat]
BenchmarkTools = "≥ 0.4.2"
Expand All @@ -23,3 +24,4 @@ Plots = "≥ 0.25.1"
Polyhedra = "≥ 0.3.4"
RecipesBase = "≥ 0.3.0"
StaticArrays = "≥ 0.10.3"
TaylorModels = "≥ 0.1.1"
4 changes: 2 additions & 2 deletions docs/src/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ Here we list the names of the maintainers of the `LazySets.jl` library, as well
- Kostiantyn Potomkin
- Frédéric Viry

### Colaborators
### Acknowledgements

We are also grateful to the following persons for enlightening discussions:
We are grateful to the following persons for enlightening discussions:

- [Sergiy Bogomolov](https://www.sergiybogomolov.com/)
- [Goran Frehse](https://sites.google.com/site/frehseg/)
3 changes: 3 additions & 0 deletions docs/src/lib/binary_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ is_intersection_empty(::Universe{N}, ::LazySet{N}, ::Bool=false) where {N<:Real}
is_intersection_empty(::Complement{N}, ::LazySet{N}, ::Bool=false) where {N<:Real}
is_intersection_empty(::Zonotope{N}, ::Zonotope{N}, ::Bool=false) where {N<:Real}
is_intersection_empty(::Interval{N}, ::Interval{N}, ::Bool=false) where {N<:Real}
is_intersection_empty(X::CartesianProductArray{N}, Y::HPolyhedron{N}) where {N<:Real}
is_intersection_empty(X::CartesianProductArray{N}, Y::CartesianProductArray{N}) where {N}
```

## Convex hull
Expand Down Expand Up @@ -64,6 +66,7 @@ intersection(::UnionSet{N}, ::LazySet{N}) where {N<:Real}
intersection(::UnionSetArray{N}, ::LazySet{N}) where {N<:Real}
intersection(::Universe{N}, ::LazySet{N}) where {N<:Real}
intersection(::AbstractPolyhedron{N}, ::ResetMap{N}) where {N<:Real}
intersection(X::CartesianProductArray{N}, Y::CartesianProductArray{N}) where {N<:Real}
```

## Subset check
Expand Down
1 change: 1 addition & 0 deletions docs/src/lib/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::AbstractVector{VN}, ::N=N(1e-3),

```@docs
==(::LazySet, ::LazySet)
≈(::LazySet, ::LazySet)
copy(::LazySet)
```

Expand Down
4 changes: 4 additions & 0 deletions docs/src/lib/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ isempty(::CartesianProductArray)
constraints_list(::CartesianProductArray{N}) where {N<:Real}
vertices_list(::CartesianProductArray{N}) where {N<:Real}
array(::CartesianProductArray{N, S}) where {N<:Real, S<:LazySet{N}}
block_structure(cpa::CartesianProductArray{N}) where {N}
block_to_dimension_indices(cpa::CartesianProductArray{N}, vars::Vector{Int}) where {N}
substitute_blocks(low_dim_cpa::CartesianProductArray{N}, orig_cpa::CartesianProductArray{N},
blocks::Vector{Tuple{Int,Int}}) where {N}
```
Inherited from [`LazySet`](@ref):
* [`norm`](@ref norm(::LazySet, ::Real))
Expand Down
1 change: 1 addition & 0 deletions docs/src/lib/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ same_block_structure
substitute
substitute!
σ_helper
get_constrained_lowdimset
@neutral
@absorbing
@neutral_absorbing
Expand Down
1 change: 1 addition & 0 deletions src/Approximations/Approximations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ include("box_approximations.jl")
include("template_directions.jl")
include("overapproximate.jl")
include("decompositions.jl")
include("init.jl")

end # module
7 changes: 7 additions & 0 deletions src/Approximations/init.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function __init__()
@require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" load_taylormodels()
end

function load_taylormodels()
eval(load_taylormodels_overapproximation())
end
11 changes: 5 additions & 6 deletions src/Approximations/iterative_refinement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end

"""
new_approx(S::LazySet, p1::Vector{N}, d1::Vector{N}, p2::Vector{N},
d2::Vector{N}) where {N<:Real}
d2::Vector{N}) where {N<:AbstractFloat}
Create a `LocalApproximation` instance for the given excerpt of a polygonal
approximation.
Expand All @@ -85,7 +85,7 @@ approximation.
A local approximation of `S` in the given directions.
"""
function new_approx(S::LazySet, p1::Vector{N}, d1::Vector{N}, p2::Vector{N},
d2::Vector{N}) where {N<:Real}
d2::Vector{N}) where {N<:AbstractFloat}
if norm(p1-p2, 2) <= TOL(N)
# this approximation cannot be refined and we set q = p1 by convention
ap = LocalApproximation{N}(p1, d1, p2, d2, p1, false, zero(N))
Expand Down Expand Up @@ -189,7 +189,7 @@ end

"""
approximate(S::LazySet{N},
ε::N)::PolygonalOverapproximation{N} where {N<:Real}
ε::N)::PolygonalOverapproximation{N} where {N<:AbstractFloat}
Return an ε-close approximation of the given 2D convex set (in terms of
Hausdorff distance) as an inner and an outer approximation composed by sorted
Expand All @@ -204,9 +204,8 @@ local `Approximation2D`.
An ε-close approximation of the given 2D convex set.
"""
function approximate(S::LazySet{N},
ε::N)::PolygonalOverapproximation{N} where {N<:Real}

function approximate(S::LazySet{N}, ε::N
)::PolygonalOverapproximation{N} where {N<:AbstractFloat}
# initialize box directions
pe = σ(DIR_EAST(N), S)
pn = σ(DIR_NORTH(N), S)
Expand Down
Loading

0 comments on commit a96a698

Please sign in to comment.