Skip to content

Commit

Permalink
Merge pull request #1303 from JuliaReach/mforets/1272
Browse files Browse the repository at this point in the history
#1272 - Use eps by default in plots
  • Loading branch information
mforets authored May 2, 2019
2 parents 5440338 + e8f1f9b commit d985026
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 389 deletions.
24 changes: 16 additions & 8 deletions docs/src/lib/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ diameter(::LazySet, ::Real=Inf)
isbounded(::LazySet)
isbounded_unit_dimensions(::LazySet{N}) where {N<:Real}
an_element(::LazySet{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::LazySet)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{S}) where {S<:LazySet}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::LazySet, ::Float64)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{S}, ::Float64) where {S<:LazySet}
tosimplehrep(::LazySet)
isuniversal(::LazySet{N}, ::Bool=false) where {N<:Real}
```

The following functions work with general two-dimensional `LazySet`s, provided that the overapproximation using iterative refinement is available:

```@docs
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::LazySet{N}, ::N=N(1e-3)) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{XN}, ::N=N(1e-3)) where {N<:Real, XN<:LazySet{N}}
```

### Set functions that override Base functions

```@docs
Expand Down Expand Up @@ -135,8 +138,13 @@ This interface defines the following functions:
isbounded(::AbstractPolytope)
singleton_list(::AbstractPolytope{N}) where {N<:Real}
isempty(::AbstractPolytope)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::AbstractPolytope)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{S}) where {S<:AbstractPolytope}
```

Plotting abstract polytopes is available too:

```@docs
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::AbstractPolytope{N}, ::N=zero(N)) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{PN}, ::N=zero(N)) where {N<:Real, PN<:AbstractPolytope{N}}
```

#### Polygon
Expand Down Expand Up @@ -244,6 +252,6 @@ high(::AbstractSingleton{N}, ::Int) where {N<:Real}
low(::AbstractSingleton{N}) where {N<:Real}
low(::AbstractSingleton{N}, ::Int) where {N<:Real}
linear_map(::AbstractMatrix{N}, ::AbstractSingleton{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::AbstractSingleton)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{S}) where {S<:AbstractSingleton}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::AbstractSingleton{N}, ::N=zero(N)) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{SN}, ::N=zero(N)) where {N<:Real, SN<:AbstractSingleton{N}}
```
1 change: 1 addition & 0 deletions docs/src/lib/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ use_precise_ρ
_line_search
_projection
linear_map(::AbstractMatrix{N}, ::Intersection{N}) where {N}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Intersection{N}, ::N=-one(N)) where {N<:Real}
```

Inherited from [`LazySet`](@ref):
Expand Down
14 changes: 9 additions & 5 deletions docs/src/lib/representations.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ radius(::EmptySet, ::Real=Inf)
diameter(::EmptySet, ::Real=Inf)
linear_map(::AbstractMatrix{N}, ::EmptySet{N}) where {N}
translate(::EmptySet{N}, ::AbstractVector{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::EmptySet, ::Float64=0.0)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::EmptySet{N}, ::N=zero(N)) where {N<:Real}
```
Inherited from [`LazySet`](@ref):
* [`norm`](@ref norm(::LazySet, ::Real))
Expand Down Expand Up @@ -185,6 +185,7 @@ halfspace_right(::AbstractVector{N}, ::AbstractVector{N}) where {N<:Real}
tosimplehrep(::AbstractVector{HalfSpace{N}}) where {N<:Real}
remove_redundant_constraints(::AbstractVector{LinearConstraint{N}}) where {N<:Real}
remove_redundant_constraints!(::AbstractVector{LinearConstraint{N}}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::HalfSpace{N}, ::N=zero(N)) where {N<:Real}
```
Inherited from [`LazySet`](@ref):
* [`norm`](@ref norm(::LazySet, ::Real))
Expand All @@ -206,6 +207,7 @@ isempty(::Hyperplane)
constrained_dimensions(::Hyperplane{N}) where {N<:Real}
constraints_list(::Hyperplane{N}) where {N<:Real}
translate(::Hyperplane{N}, ::AbstractVector{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Hyperplane{N}, ::N=zero(N)) where {N<:Real}
```
Inherited from [`LazySet`](@ref):
* [`norm`](@ref norm(::LazySet, ::Real))
Expand Down Expand Up @@ -265,8 +267,8 @@ radius_hyperrectangle(::Interval{N}, ::Int) where {N<:Real}
-(::Interval{N}, ::Interval{N}) where {N<:Real}
*(::Interval{N}, ::Interval{N}) where {N<:Real}
rand(::Type{Interval})
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Interval)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{S}) where {S<:Interval}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Interval{N}, ::N=zero(N)) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{Interval{N}}, ::N=zero(N)) where {N<:Real}
```
Inherited from [`LazySet`](@ref):
* [`diameter`](@ref diameter(::LazySet, ::Real))
Expand Down Expand Up @@ -296,6 +298,7 @@ isempty(::Line)
constrained_dimensions(::Line{N}) where {N<:Real}
constraints_list(::Line{N}) where {N<:Real}
translate(::Line{N}, ::AbstractVector{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Line{N}, ::N=zero(N)) where {N<:Real}
```
Inherited from [`LazySet`](@ref):
* [`norm`](@ref norm(::LazySet, ::Real))
Expand All @@ -317,8 +320,8 @@ halfspace_right(::LineSegment)
vertices_list(::LineSegment{N}) where {N<:Real}
constraints_list(::LineSegment{N}) where {N<:Real}
translate(::LineSegment{N}, ::AbstractVector{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::LineSegment)
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{S}) where {S<:LineSegment}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::LineSegment{N}, ::N=zero(N)) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Vector{LineSegment{N}}, ::N=zero(N)) where {N<:Real}
```
Inherited from [`LazySet`](@ref):
* [`norm`](@ref norm(::LazySet, ::Real))
Expand Down Expand Up @@ -584,6 +587,7 @@ diameter(::Universe, ::Real=Inf)
constraints_list(::Universe{N}) where {N<:Real}
constrained_dimensions(::Universe)
translate(::Universe{N}, ::AbstractVector{N}) where {N<:Real}
RecipesBase.apply_recipe(::Dict{Symbol,Any}, ::Universe{N}, ::N=zero(N)) where {N<:Real}
```

## Zero set
Expand Down
8 changes: 4 additions & 4 deletions docs/src/man/reach_zonotopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function Algorithm1(A, X0, δ, μ, T)
N = floor(Int, T / δ)
# preallocate arrays
Q = Vector{LazySet}(undef, N)
R = Vector{LazySet}(undef, N)
Q = Vector{LazySet{Float64}}(undef, N)
R = Vector{LazySet{Float64}}(undef, N)
# initial reach set in the time interval [0, δ]
ϕp = (I+ϕ) / 2
Expand Down Expand Up @@ -93,7 +93,7 @@ R = Algorithm1(A, X0, δ, μ, 2 * δ); # warm-up
R = Algorithm1(A, X0, δ, μ, T)
plot(R, 1e-2, fillalpha=0.1)
plot(R, fillalpha=0.1)
```


Expand All @@ -115,5 +115,5 @@ R = Algorithm1(A, X0, δ, μ, 2 * δ); # warm-up
R = Algorithm1(A, X0, δ, μ, T)
Rproj = project(R, [1, 3], 5)
plot(Rproj, 1e-2, fillalpha=0.1, xlabel="x1", ylabel="x3")
plot(Rproj, fillalpha=0.1, xlabel="x1", ylabel="x3")
```
Loading

0 comments on commit d985026

Please sign in to comment.