-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3558 from JuliaReach/schillic/Singleton
Outsource `Singleton` to its own module
- Loading branch information
Showing
16 changed files
with
313 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,111 @@ | ||
```@meta | ||
CurrentModule = LazySets | ||
CurrentModule = LazySets.SingletonModule | ||
``` | ||
|
||
# [Singleton](@id def_Singleton) | ||
|
||
```@docs | ||
Singleton | ||
rand(::Type{Singleton}) | ||
``` | ||
|
||
## Operations | ||
|
||
```@docs | ||
element(::Singleton) | ||
translate!(::Singleton, ::AbstractVector) | ||
rand(::Type{Singleton}) | ||
rectify(S::Singleton) | ||
project(::Singleton, ::AbstractVector{Int}) | ||
permute(::Singleton, ::AbstractVector{Int}) | ||
singleton_list(::Singleton) | ||
linear_map(::AbstractMatrix, ::Singleton) | ||
permute(::Singleton, ::AbstractVector{Int}) | ||
project(::Singleton, ::AbstractVector{Int}) | ||
translate!(::Singleton, ::AbstractVector) | ||
``` | ||
|
||
```@meta | ||
CurrentModule = LazySets.API | ||
``` | ||
|
||
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet})) | ||
* [`scale!`](@ref scale!(::Real, ::LazySet)) | ||
|
||
```@meta | ||
CurrentModule = LazySets | ||
``` | ||
|
||
Inherited from [`LazySet`](@ref): | ||
* [`complement`](@ref complement(::LazySet)) | ||
* [`concretize`](@ref concretize(::LazySet)) | ||
* [`constraints`](@ref constraints(::LazySet)) | ||
* [`convex_hull`](@ref convex_hull(::LazySet)) | ||
* [`diameter`](@ref diameter(::LazySet, ::Real)) | ||
* [`eltype`](@ref eltype(::Type{<:LazySet})) | ||
* [`eltype`](@ref eltype(::LazySet)) | ||
* [`isoperation`](@ref isoperation(::LazySet)) | ||
* [`surface`](@ref surface(::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)) | ||
* [`sample`](@ref sample(::LazySet)) | ||
* [`scale`](@ref scale(::Real, ::LazySet)) | ||
* [`translate`](@ref translate(::LazySet, ::AbstractVector)) | ||
* [`≈`](@ref ≈(::LazySet, ::LazySet)) | ||
* [`==`](@ref ==(::LazySet, ::LazySet)) | ||
* [`⊂`](@ref ⊂(::LazySet, ::LazySet)) | ||
|
||
Inherited from [`ConvexSet`](@ref): | ||
* [`linear_combination`](@ref linear_combination(::ConvexSet, ::ConvexSet)) | ||
|
||
Inherited from [`AbstractPolyhedron`](@ref): | ||
* [`is_polyhedral`](@ref is_polyhedral(::AbstractPolyhedron)) | ||
|
||
Inherited from [`AbstractPolytope`](@ref): | ||
* [`isbounded`](@ref isbounded(::AbstractPolytope)) | ||
* [`isuniversal`](@ref isuniversal(::AbstractPolytope{N}, ::Bool=false) where {N}) | ||
* [`isboundedtype`](@ref isboundedtype(::Type{AbstractPolytope})) | ||
|
||
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref): | ||
* [`an_element`](@ref an_element(::AbstractCentrallySymmetricPolytope)) | ||
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope)) | ||
* [`isempty`](@ref isempty(::AbstractCentrallySymmetricPolytope)) | ||
* [`an_element`](@ref an_element(::AbstractCentrallySymmetricPolytope)) | ||
* [`isuniversal`](@ref isuniversal(::AbstractCentrallySymmetricPolytope)) | ||
|
||
Inherited from [`AbstractZonotope`](@ref): | ||
* [`order`](@ref order(::AbstractZonotope)) | ||
* [`togrep`](@ref togrep(::AbstractZonotope)) | ||
|
||
Inherited from [`AbstractHyperrectangle`](@ref): | ||
* [`area`](@ref area(::AbstractHyperrectangle)) | ||
* [`extrema`](@ref extrema(::AbstractHyperrectangle)) | ||
* [`extrema`](@ref extrema(::AbstractHyperrectangle, ::Int)) | ||
* [`norm`](@ref norm(::AbstractHyperrectangle, ::Real)) | ||
* [`radius`](@ref radius(::AbstractHyperrectangle, ::Real)) | ||
* [`constraints_list`](@ref constraints_list(::AbstractHyperrectangle{N}) where {N}) | ||
* [`volume`](@ref volume(::AbstractHyperrectangle)) | ||
* [`difference`](@ref difference(::AbstractHyperrectangle, ::AbstractHyperrectangle)) | ||
|
||
Inherited from [`AbstractSingleton`](@ref): | ||
* [`σ`](@ref σ(::AbstractVector, ::AbstractSingleton)) | ||
* [`ρ`](@ref σ(::AbstractVector, ::AbstractSingleton)) | ||
* [`∈`](@ref ∈(::AbstractVector, ::AbstractSingleton)) | ||
* [`center`](@ref center(::AbstractSingleton)) | ||
* [`vertices`](@ref vertices(::AbstractSingleton{N}) where {N}) | ||
* [`vertices_list`](@ref vertices_list(::AbstractSingleton)) | ||
* [`radius_hyperrectangle`](@ref radius_hyperrectangle(::AbstractSingleton{N}) where {N}) | ||
* [`radius_hyperrectangle`](@ref radius_hyperrectangle(::AbstractSingleton{N}, ::Int) where {N}) | ||
* [`center`](@ref center(::AbstractSingleton, ::Int)) | ||
* [`constraints_list`](@ref constraints_list(::AbstractSingleton)) | ||
* [`generators`](@ref generators(::AbstractSingleton{N}) where {N}) | ||
* [`genmat`](@ref genmat(::AbstractSingleton{N}) where {N}) | ||
* [`ngens`](@ref ngens(::AbstractSingleton)) | ||
* [`high`](@ref high(::AbstractSingleton)) | ||
* [`high`](@ref high(::AbstractSingleton, ::Int)) | ||
* [`isboundedtype`](@ref isboundedtype(::Type{AbstractSingleton})) | ||
* [`low`](@ref low(::AbstractSingleton)) | ||
* [`low`](@ref low(::AbstractSingleton, ::Int)) | ||
* [`ngens`](@ref ngens(::AbstractSingleton)) | ||
* [`radius_hyperrectangle`](@ref radius_hyperrectangle(::AbstractSingleton{N}) where {N}) | ||
* [`radius_hyperrectangle`](@ref radius_hyperrectangle(::AbstractSingleton{N}, ::Int) where {N}) | ||
* [`reflect`](@ref reflect(::AbstractSingleton)) | ||
* [`vertices`](@ref vertices(::AbstractSingleton{N}) where {N}) | ||
* [`vertices_list`](@ref vertices_list(::AbstractSingleton)) | ||
* [`∈`](@ref ∈(::AbstractVector, ::AbstractSingleton)) | ||
* [`ρ`](@ref σ(::AbstractVector, ::AbstractSingleton)) | ||
* [`σ`](@ref σ(::AbstractVector, ::AbstractSingleton)) | ||
* [`cartesian_product`](@ref cartesian_product(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`distance`](@ref distance(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`intersection`](@ref intersection(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`isdisjoint`](@ref isdisjoint(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`isequivalent`](@ref isequivalent(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`⊆`](@ref ⊆(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`minkowski_difference`](@ref minkowski_difference(::AbstractSingleton, ::AbstractSingleton)) | ||
* [`minkowski_sum`](@ref minkowski_sum(::AbstractSingleton, ::AbstractSingleton)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Singleton{N, VN<:AbstractVector{N}} <: AbstractSingleton{N} | ||
Type that represents a singleton, that is, a set with a single element. | ||
### Fields | ||
- `element` -- the only element of the set | ||
### Examples | ||
```jldoctest | ||
julia> Singleton([1.0, 2.0]) | ||
Singleton{Float64, Vector{Float64}}([1.0, 2.0]) | ||
julia> Singleton(1.0, 2.0) # convenience constructor from numbers | ||
Singleton{Float64, Vector{Float64}}([1.0, 2.0]) | ||
``` | ||
""" | ||
struct Singleton{N,VN<:AbstractVector{N}} <: AbstractSingleton{N} | ||
element::VN | ||
end | ||
|
||
function Singleton(args::Real...) | ||
return Singleton(collect(args)) | ||
end |
Oops, something went wrong.