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
2 changes: 1 addition & 1 deletion docs/src/lib/interfaces/AbstractHPolygon.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tohrep(::HPOLYGON) where {HPOLYGON<:AbstractHPolygon}
tovrep(::AbstractHPolygon)
vertices_list(::AbstractHPolygon)
addconstraint!(::AbstractHPolygon, ::HalfSpace)
addconstraint!(::Vector{LC}, ::HalfSpace) where {LC<:HalfSpace}
addconstraint!(::Vector{<:HalfSpace}, ::HalfSpace)
∈(::AbstractVector, ::AbstractHPolygon)
isredundant(::HalfSpace, ::HalfSpace, ::HalfSpace)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/interfaces/AbstractPolygon.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The following helper functions are used for sorting directions:
LazySets.jump2pi
⪯(::AbstractVector, ::AbstractVector)
LazySets._leq_trig(::AbstractVector{N}, ::AbstractVector{N}) where {N<:AbstractFloat}
LazySets.quadrant(::AbstractVector{N}) where {N}
LazySets.quadrant(::AbstractVector)
```

## Implementations
Expand Down
12 changes: 6 additions & 6 deletions docs/src/lib/interfaces/AbstractPolyhedron.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ CurrentModule = LazySets
This interface defines the following functions:

```@docs
an_element(::AbstractPolyhedron{N}) where {N}
an_element(::AbstractPolyhedron)
constrained_dimensions(::AbstractPolyhedron)
isbounded(::AbstractPolyhedron{N}) where {N}
isbounded(::AbstractPolyhedron)
isuniversal(::AbstractPolyhedron, ::Bool=false)
vertices_list(::AbstractPolyhedron)
∈(::AbstractVector, ::AbstractPolyhedron)
project(::AbstractPolyhedron{N}, ::AbstractVector{Int}) where {N}
project(::AbstractPolyhedron, ::AbstractVector{Int})
LazySets._isbounded_stiemke
LazySets._linear_map_polyhedron
```
Expand All @@ -53,9 +53,9 @@ Some common functions to work with linear constraints:

```@docs
constraints_list(::AbstractMatrix, ::AbstractVector)
tosimplehrep(::AbstractVector{LC}) where {N, LC<:HalfSpace{N}}
remove_redundant_constraints(::AbstractVector{S}) where {S<:HalfSpace}
remove_redundant_constraints!(::AbstractVector{S}) where {S<:HalfSpace}
tosimplehrep(::AbstractVector{<:HalfSpace})
remove_redundant_constraints(::AbstractVector{<:HalfSpace})
remove_redundant_constraints!(::AbstractVector{<:HalfSpace})
```

Plotting (bounded) polyhedra is available, too:
Expand Down
4 changes: 2 additions & 2 deletions docs/src/lib/interfaces/AbstractZonotope.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ This interface defines the following functions:

```@docs
constraints_list(::AbstractZonotope)
constraints_list(::AbstractZonotope{N}; ::Bool=true) where {N<:AbstractFloat}
constraints_list(::AbstractZonotope{<:AbstractFloat}; ::Bool=true)
generators_fallback(::AbstractZonotope)
genmat_fallback(::AbstractZonotope{N}) where {N}
genmat_fallback(::AbstractZonotope)
ngens(::AbstractZonotope)
order(::AbstractZonotope)
reflect(::AbstractZonotope)
Expand Down
21 changes: 6 additions & 15 deletions docs/src/lib/interfaces/LazySet.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ isfeasible
norm(::LazySet, ::Real=Inf)
radius(::LazySet, ::Real=Inf)
diameter(::LazySet, ::Real=Inf)
isempty(::LazySet{N}, ::Bool=false) where {N}
isempty(::LazySet, ::Bool=false)
linear_map(::AbstractMatrix, ::LazySet; kwargs...)
linear_map(::Number, ::LazySet; kwargs...)
affine_map(::Any, ::LazySet, ::AbstractVector)
Expand All @@ -85,32 +85,23 @@ area(::LazySet)
concretize(::LazySet)
complement(::LazySet)
polyhedron(::LazySet)
project(::LazySet, ::AbstractVector{Int}, ::Nothing=nothing, ::Int=dim(S))
project(::LazySet, ::AbstractVector{Int}, ::Type{TS}, ::Int=dim(S)) where {TS<:LazySet}
project(::LazySet, ::AbstractVector{Int}, ::Pair{T, N}, ::Int=dim(S)) where {T<:UnionAll, N<:Real}
project(::LazySet, ::AbstractVector{Int}, ::Real, ::Int=dim(S))
project(::LazySet, ::AbstractVector{Int}, ::Nothing=nothing, ::Int=dim(X))
project(::LazySet, ::AbstractVector{Int}, ::Type{<:LazySet}, ::Int=dim(X))
project(::LazySet, ::AbstractVector{Int}, ::Pair{<:UnionAll,<:Real}, ::Int=dim(X))
project(::LazySet, ::AbstractVector{Int}, ::Real, ::Int=dim(X))
rectify(::LazySet, ::Bool=false)
permute
rationalize(::Type{T}, ::LazySet{<:AbstractFloat}, ::Real) where {T<:Integer}
singleton_list(::LazySet)
constraints(::LazySet)
vertices(::LazySet)
delaunay
chebyshev_center_radius(::LazySet{N}) where {N}
chebyshev_center_radius(::LazySet)
scale(::Real, ::LazySet)
translate(::LazySet, ::AbstractVector)
plot_recipe(::LazySet, ::Any)
```

The following methods are also defined for `LazySet` but cannot be documented
due to a bug in the documentation package.

```@docs
low(::ConvexSet{N}, ::Int) where {N}
high(::ConvexSet{N}, ::Int) where {N}
an_element(::ConvexSet{N}) where {N}
```

## Support function and support vector

Every `LazySet` type must define a function `σ` to compute the support vector.
Expand Down
6 changes: 2 additions & 4 deletions docs/src/lib/sets/Ellipsoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ Inherited from [`LazySet`](@ref):
* [`eltype`](@ref eltype(::Type{<:LazySet}))
* [`eltype`](@ref eltype(::LazySet))
* [`high`](@ref high(::LazySet))
* [`high`](@ref high(::LazySet, ::Int))
* [`ispolyhedral`](@ref ispolyhedral(::LazySet))
* [`isoperation`](@ref isoperation(::LazySet))
* [`low`](@ref low(::LazySet))
* [`low`](@ref low(::LazySet, ::Int))
* [`norm`](@ref norm(::LazySet, ::Real))
* [`radius`](@ref radius(::LazySet, ::Real))
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
Expand All @@ -108,10 +110,6 @@ Inherited from [`LazySet`](@ref):
* [`==`](@ref ==(::LazySet, ::LazySet))
* [`isequivalent`](@ref isequivalent(::LazySet, ::LazySet))

Inherited from [`ConvexSet`](@ref):
* [`high`](@ref high(::ConvexSet, ::Int))
* [`low`](@ref low(::ConvexSet, ::Int))

Inherited from [`AbstractCentrallySymmetric`](@ref):
* [`an_element`](@ref an_element(::AbstractCentrallySymmetric))
* [`center`](@ref center(::AbstractCentrallySymmetric, ::Int))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/sets/HPolyhedron.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Inherited from [`AbstractPolyhedron`](@ref):
* [`extrema`](@ref extrema(::AbstractPolyhedron, ::Int))
* [`high`](@ref high(::AbstractPolyhedron))
* [`high`](@ref high(::AbstractPolyhedron, ::Int))
* [`isbounded`](@ref isbounded(::AbstractPolyhedron{N}) where {N})
* [`isbounded`](@ref isbounded(::AbstractPolyhedron))
* [`isconvextype`](@ref isconvextype(::Type{AbstractPolyhedron}))
* [`ispolyhedral`](@ref ispolyhedral(::AbstractPolyhedron))
* [`isuniversal`](@ref isuniversal(::AbstractPolyhedron, ::Bool=false))
Expand Down
8 changes: 4 additions & 4 deletions docs/src/lib/sets/LineSegment.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ Inherited from [`LazySet`](@ref):
* [`diameter`](@ref diameter(::LazySet, ::Real))
* [`eltype`](@ref eltype(::Type{<:LazySet}))
* [`eltype`](@ref eltype(::LazySet))
* [`high`](@ref high(::LazySet))
* [`isoperation`](@ref isoperation(::LazySet))
* [`low`](@ref low(::LazySet))
* [`norm`](@ref norm(::LazySet, ::Real))
* [`radius`](@ref radius(::LazySet, ::Real))
* [`singleton_list`](@ref singleton_list(::LazySet))
Expand All @@ -142,12 +140,14 @@ Inherited from [`LazySet`](@ref):
* [`⊂`](@ref ⊂(::LazySet, ::LazySet))

Inherited from [`ConvexSet`](@ref):
* [`high`](@ref high(::ConvexSet, ::Int))
* [`low`](@ref low(::ConvexSet, ::Int))
* [`linear_combination`](@ref linear_combination(::ConvexSet, ::ConvexSet))

Inherited from [`AbstractPolyhedron`](@ref):
* [`high`](@ref high(::AbstractPolyhedron))
* [`high`](@ref high(::AbstractPolyhedron, ::Int))
* [`ispolyhedral`](@ref ispolyhedral(::AbstractPolyhedron))
* [`low`](@ref low(::AbstractPolyhedron))
* [`low`](@ref low(::AbstractPolyhedron, ::Int))

Inherited from [`AbstractPolytope`](@ref):
* [`isbounded`](@ref isbounded(::AbstractPolytope))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/sets/Zonotope.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):

Inherited from [`AbstractZonotope`](@ref):
* [`constraints_list`](@ref constraints_list(::AbstractZonotope))
* [`constraints_list`](@ref constraints_list(::AbstractZonotope{N}; ::Bool=true) where {N<:AbstractFloat})
* [`constraints_list`](@ref constraints_list(::AbstractZonotope{<:AbstractFloat}; ::Bool=true))
* [`order`](@ref order(::AbstractZonotope))
* [`reflect`](@ref reflect(::AbstractZonotope))
* [`vertices_list`](@ref vertices_list(::AbstractZonotope))
Expand Down
8 changes: 4 additions & 4 deletions src/Interfaces/AbstractHPolygon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ function addconstraint!(P::AbstractHPolygon, constraint::HalfSpace;
end

"""
addconstraint!(constraints::Vector{LC}, new_constraint::HalfSpace;
addconstraint!(constraints::Vector{<:HalfSpace}, new_constraint::HalfSpace;
[linear_search]::Bool=length(P.constraints) < $BINARY_SEARCH_THRESHOLD,
[prune]::Bool=true) where {LC<:HalfSpace}
[prune]::Bool=true)

Add a linear constraint to a sorted vector of constrains, keeping the
constraints sorted by their normal directions.
Expand All @@ -452,9 +452,9 @@ If `prune` is active, we check if the new constraint is redundant.
If the constraint is not redundant, we perform the same check to the left and to
the right until we find the first constraint that is not redundant.
"""
function addconstraint!(constraints::Vector{LC}, new_constraint::HalfSpace;
function addconstraint!(constraints::Vector{<:HalfSpace}, new_constraint::HalfSpace;
linear_search::Bool=length(constraints) < BINARY_SEARCH_THRESHOLD,
prune::Bool=true) where {LC<:HalfSpace}
prune::Bool=true)
m = length(constraints)
k = m
if k > 0
Expand Down
5 changes: 3 additions & 2 deletions src/Interfaces/AbstractPolygon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ julia> jump2pi(0.5)
end

"""
quadrant(w::AbstractVector{N}) where {N}
quadrant(w::AbstractVector)

Compute the quadrant where the direction `w` belongs.

Expand All @@ -134,7 +134,8 @@ The idea is to encode the following logic function:
This function is inspired from AGPX's answer in:
[Sort points in clockwise order?](https://stackoverflow.com/a/46635372)
"""
@inline function quadrant(w::AbstractVector{N}) where {N}
@inline function quadrant(w::AbstractVector)
N = eltype(w)
dwx = w[1] >= zero(N) ? 1 : 0
dwy = w[2] >= zero(N) ? 1 : 0
return (1 - dwx) + (1 - dwy) + ((dwx & (1 - dwy)) << 1)
Expand Down
Loading
Loading