Skip to content

Commit

Permalink
Merge pull request #3704 from JuliaReach/schillic/hpoly
Browse files Browse the repository at this point in the history
`HPolyhedron`/`HPolytope`: revise docs entries, shorten docs
  • Loading branch information
schillic authored Dec 24, 2024
2 parents 06f3f9b + 91ac5cf commit da0bd75
Show file tree
Hide file tree
Showing 12 changed files with 267 additions and 150 deletions.
1 change: 0 additions & 1 deletion docs/src/lib/concrete_binary_operations/convex_hull.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ CurrentModule = LazySets

```@docs
convex_hull(::LazySet, ::LazySet)
convex_hull(::HPoly, ::HPoly)
convex_hull(::Vector{VN}) where {N, VN<:AbstractVector{N}}
monotone_chain!
```
126 changes: 112 additions & 14 deletions docs/src/lib/sets/HPolyhedron.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,152 @@ HPolyhedron

## Conversion

```@docs
```julia
convert(::Type{HPolyhedron}, ::LazySet)
convert(::Type{HPolyhedron}, ::HRep)
```

## Operations

```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
rand(::Type{LazySet})
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs
rand(::Type{HPolyhedron})
```

The following methods are shared between `HPolytope` and `HPolyhedron`.

```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
dim(::LazySet)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs
constraints_list(::HPoly)
dim(::HPoly)
normalize(::HPoly{N}, p::Real=N(2)) where {N}
remove_redundant_constraints(::HPoly)
remove_redundant_constraints!(::HPoly)
tohrep(::HPoly)
tovrep(::HPoly)
addconstraint!(::HPoly, ::HalfSpace)
```
```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
ρ(::AbstractVector, ::LazySet)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs
ρ(::AbstractVector{M}, ::HPoly{N}) where {M, N}
```
```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
σ(::AbstractVector, ::LazySet)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs
σ(::AbstractVector{M}, ::HPoly{N}) where {M, N}
translate(::HPoly, ::AbstractVector)
```

The following methods are specific to `HPolyhedron`.

```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
translate(::LazySet, ::AbstractVector)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs
rand(::Type{HPolyhedron})
translate(::HPoly, ::AbstractVector)
convex_hull(::HPoly, ::HPoly)
```

Undocumented implementations:
* [`constraints_list`](@ref constraints_list(::LazySet))
* [`isempty`](@ref isempty(::LazySet))
`ishyperplanar(::HPolyhedron)`
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
* [`minkowski_sum`](@ref minkowski_sum(::LazySet, ::LazySet))

```@meta
CurrentModule = LazySets
```

Inherited from [`LazySet`](@ref):
* [`diameter`](@ref diameter(::LazySet, ::Real))
* [`high`](@ref high(::LazySet))
* [`isempty`](@ref isempty(::LazySet{N}, ::Bool=false) where {N})
* [`low`](@ref low(::LazySet))
* [`norm`](@ref norm(::LazySet, ::Real))
* [`radius`](@ref radius(::LazySet, ::Real))
* [`area`](@ref area(::LazySet))
* [`complement`](@ref complement(::LazySet))
* [`concretize`](@ref concretize(::LazySet))
* [`constraints`](@ref constraints(::LazySet))
* [`convex_hull`](@ref convex_hull(::LazySet))
* `copy(::Type{LazySet})`
* [`diameter`](@ref diameter(::LazySet, ::Real=Inf))
* [`eltype`](@ref eltype(::Type{<:LazySet}))
* [`eltype`](@ref eltype(::LazySet))
* [`isboundedtype`](@ref isboundedtype(::Type{LazySet}))
* [`isoperation`](@ref isoperation(::LazySet))
* [`norm`](@ref norm(::LazySet, ::Real=Inf))
* [`radius`](@ref radius(::LazySet, ::Real=Inf))
* [`rectify`](@ref rectify(::LazySet))
* [`reflect`](@ref reflect(::LazySet))
* [`singleton_list`](@ref singleton_list(::LazySet))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet)
* [`surface`](@ref surface(::LazySet))
* [`vertices`](@ref vertices(::LazySet))
* [`volume`](@ref volume(::LazySet))
* [`affine_map`](@ref affine_map(::AbstractMatrix, ::LazySet, ::AbstractVector))
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet))
* [`sample`](@ref sample(::LazySet, ::Int=1))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`cartesian_product`](@ref cartesian_product(::LazySet, ::LazySet))
* [`difference`](@ref difference(::LazySet, ::LazySet))
* [`distance`](@ref distance(::LazySet, ::LazySet; ::Real=2.0))
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
* [``](@ref ≈(::LazySet, ::LazySet))
* [`==`](@ref ==(::LazySet, ::LazySet))
* [`isequivalent`](@ref isequivalent(::LazySet, ::LazySet))
* [``](@ref ⊂(::LazySet, ::LazySet))
* [`minkowski_difference`](@ref minkowski_difference(::LazySet, ::LazySet))

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

Inherited from [`AbstractPolyhedron`](@ref):
* [`an_element`](@ref an_element(::AbstractPolyhedron))
* [`constrained_dimensions`](@ref constrained_dimensions(::AbstractPolyhedron))
* [`extrema`](@ref extrema(::AbstractPolyhedron))
* [`extrema`](@ref extrema(::AbstractPolyhedron, ::Int))
* [`high`](@ref high(::AbstractPolyhedron))
* [`high`](@ref high(::AbstractPolyhedron, ::Int))
* [`isbounded`](@ref isbounded(::AbstractPolyhedron{N}) where {N})
* [`isconvextype`](@ref isconvextype(::Type{AbstractPolyhedron}))
* [`ispolyhedral`](@ref ispolyhedral(::AbstractPolyhedron))
* [`isuniversal`](@ref isuniversal(::AbstractPolyhedron, ::Bool=false))
* [`low`](@ref low(::AbstractPolyhedron))
* [`low`](@ref low(::AbstractPolyhedron, ::Int))
* [`vertices_list`](@ref vertices_list(::AbstractPolyhedron, ::Bool=false))
* [``](@ref ∈(::AbstractVector, ::AbstractPolyhedron))
* [`project`](@ref project(::AbstractPolyhedron, ::AbstractVector{Int}))
* [`intersection`](@ref intersection(::AbstractPolyhedron, ::AbstractPolyhedron))
* [`isdisjoint`](@ref isdisjoint(::AbstractPolyhedron, ::AbstractPolyhedron))
* [``](@ref ⊆(::LazySet, ::AbstractPolyhedron))
* [`minkowski_sum`](@ref minkowski_sum(::AbstractPolyhedron, ::AbstractPolyhedron))
143 changes: 136 additions & 7 deletions docs/src/lib/sets/HPolytope.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,162 @@ HPolytope

## Conversion

```@docs
```julia
convert(::Type{HPolytope}, ::LazySet)
```

## Operations

```@meta
CurrentModule = LazySets
CurrentModule = LazySets.HPolytopeModule
```

Most functionality is shared with [`HPolyhedron`](@ref).
Additional functionality specific to `HPolytope` is listed below.

```@docs
isbounded(::HPolytope, ::Bool=true)
```
```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
rand(::Type{LazySet})
```
```@meta
CurrentModule = LazySets.HPolytopeModule
```

```@docs
rand(::Type{HPolytope})
vertices_list(::HPolytope)
isbounded(::HPolytope, ::Bool=true)
```

```@meta
CurrentModule = LazySets.HPolyhedronModule
```

The following functionality is shared with [`HPolyhedron`](@ref).

```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
dim(::LazySet)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs; canonical=false
dim(::HPoly)
normalize(::HPoly{N}, p::Real=N(2)) where {N}
remove_redundant_constraints(::HPoly)
remove_redundant_constraints!(::HPoly)
tohrep(::HPoly)
tovrep(::HPoly)
addconstraint!(::HPoly, ::HalfSpace)
```
```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
ρ(::AbstractVector, ::LazySet)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs; canonical=false
ρ(::AbstractVector{M}, ::HPoly{N}) where {M, N}
```
```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
σ(::AbstractVector, ::LazySet)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs; canonical=false
σ(::AbstractVector{M}, ::HPoly{N}) where {M, N}
```
```@meta
CurrentModule = LazySets.API
```
```@docs; canonical=false
translate(::LazySet, ::AbstractVector)
```
```@meta
CurrentModule = LazySets.HPolyhedronModule
```
```@docs; canonical=false
translate(::HPoly, ::AbstractVector)
convex_hull(::HPoly, ::HPoly)
```

```@meta
CurrentModule = LazySets.API
```

Undocumented implementations:
* [`constraints_list`](@ref constraints_list(::LazySet))
* [`isempty`](@ref isempty(::LazySet))
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
* [`minkowski_sum`](@ref minkowski_sum(::LazySet, ::LazySet))

```@meta
CurrentModule = LazySets
```

Inherited from [`LazySet`](@ref):
* [`area`](@ref area(::LazySet))
* [`complement`](@ref complement(::LazySet))
* [`concretize`](@ref concretize(::LazySet))
* [`constraints`](@ref constraints(::LazySet))
* [`convex_hull`](@ref convex_hull(::LazySet))
* `copy(::Type{LazySet})`
* [`diameter`](@ref diameter(::LazySet, ::Real=Inf))
* [`eltype`](@ref eltype(::Type{<:LazySet}))
* [`eltype`](@ref eltype(::LazySet))
* [`isoperation`](@ref isoperation(::LazySet))
* [`norm`](@ref norm(::LazySet, ::Real=Inf))
* [`radius`](@ref radius(::LazySet, ::Real=Inf))
* [`rectify`](@ref rectify(::LazySet))
* [`reflect`](@ref reflect(::LazySet))
* [`singleton_list`](@ref singleton_list(::LazySet))
* [`surface`](@ref surface(::LazySet))
* [`vertices`](@ref vertices(::LazySet))
* [`affine_map`](@ref affine_map(::AbstractMatrix, ::LazySet, ::AbstractVector))
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [``](@ref ∈(::AbstractVector, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet))
* [`sample`](@ref sample(::LazySet, ::Int=1))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`cartesian_product`](@ref cartesian_product(::LazySet, ::LazySet))
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
* [``](@ref ≈(::LazySet, ::LazySet))
* [`==`](@ref ==(::LazySet, ::LazySet))
* [`isequivalent`](@ref isequivalent(::LazySet, ::LazySet))
* [``](@ref ⊂(::LazySet, ::LazySet))
* [`minkowski_difference`](@ref minkowski_difference(::LazySet, ::LazySet))

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

Inherited from [`AbstractPolyhedron`](@ref):
* [`an_element`](@ref an_element(::AbstractPolyhedron))
* [`extrema`](@ref extrema(::AbstractPolyhedron))
* [`extrema`](@ref extrema(::AbstractPolyhedron, ::Int))
* [`high`](@ref high(::AbstractPolyhedron))
* [`high`](@ref high(::AbstractPolyhedron, ::Int))
* [`ispolyhedral`](@ref ispolyhedral(::AbstractPolyhedron))
* [`low`](@ref low(::AbstractPolyhedron))
* [`low`](@ref low(::AbstractPolyhedron, ::Int))
* [`project`](@ref project(::AbstractPolyhedron, ::AbstractVector{Int}))
* [`intersection`](@ref intersection(::AbstractPolyhedron, ::AbstractPolyhedron))
* [`isdisjoint`](@ref isdisjoint(::AbstractPolyhedron, ::AbstractPolyhedron))

Inherited from [`AbstractPolytope`](@ref):
* [`isboundedtype`](@ref isboundedtype(::Type{AbstractPolytope}))
* [`isconvextype`](@ref isconvextype(::Type{AbstractPolytope}))
* [`isuniversal`](@ref isuniversal(::AbstractPolytope, ::Bool=false))
* [`volume`](@ref volume(::AbstractPolytope))
* [``](@ref ⊆(::AbstractPolytope, ::AbstractPolyhedron))
14 changes: 0 additions & 14 deletions src/Sets/HPolyhedron/constraints_list.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
"""
constraints_list(P::HPoly)
Return the list of constraints defining a polyhedron in constraint
representation.
### Input
- `P` -- polyhedron in constraint representation
### Output
The list of constraints of the polyhedron.
"""
function constraints_list(P::HPoly)
return P.constraints
end
Loading

0 comments on commit da0bd75

Please sign in to comment.