Hyperplane
LazySets.Hyperplane — Type.Hyperplane{N<:Real} <: AbstractPolyhedron{N}Type that represents a hyperplane of the form $a⋅x = b$.
Fields
a– normal direction (non-zero)b– constraint
Examples
The plane $y = 0$:
julia> Hyperplane([0, 1.], 0.)
Hyperplane{Float64}([0.0, 1.0], 0.0)LazySets.dim — Method.dim(hp::Hyperplane)Return the dimension of a hyperplane.
Input
hp– hyperplane
Output
The ambient dimension of the hyperplane.
LazySets.ρ — Method.ρ(d::AbstractVector{N}, hp::Hyperplane{N}) where {N<:Real}Evaluate the support function of a hyperplane in a given direction.
Input
d– directionhp– hyperplane
Output
The support function of the hyperplane. If the set is unbounded in the given direction, the result is Inf.
LazySets.σ — Method.σ(d::AbstractVector{N}, hp::Hyperplane{N}) where {N<:Real}Return the support vector of a hyperplane.
Input
d– directionhp– hyperplane
Output
The support vector in the given direction, which is only defined in the following two cases:
- The direction has norm zero.
- The direction is the hyperplane's normal direction or its opposite direction.
In all cases, the result is any point on the hyperplane. Otherwise this function throws an error.
Base.:∈ — Method.∈(x::AbstractVector{N}, hp::Hyperplane{N}) where {N<:Real}Check whether a given point is contained in a hyperplane.
Input
x– point/vectorhp– hyperplane
Output
true iff $x ∈ hp$.
Algorithm
We just check if $x$ satisfies $a⋅x = b$.
LazySets.an_element — Method.an_element(hp::Hyperplane{N}) where {N<:Real}Return some element of a hyperplane.
Input
hp– hyperplane
Output
An element on the hyperplane.
Base.rand — Method.rand(::Type{Hyperplane}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
[rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing)Create a random hyperplane.
Input
Hyperplane– type for dispatchN– (optional, default:Float64) numeric typedim– (optional, default: 2) dimensionrng– (optional, default:GLOBAL_RNG) random number generatorseed– (optional, default:nothing) seed for reseeding
Output
A random hyperplane.
Algorithm
All numbers are normally distributed with mean 0 and standard deviation 1. Additionally, the constraint a is nonzero.
LazySets.isbounded — Method.isbounded(hp::Hyperplane)Determine whether a hyperplane is bounded.
Input
hp– hyperplane
Output
false.
LazySets.isuniversal — Method.isuniversal(hp::Hyperplane{N}, [witness]::Bool=false) where {N<:Real}Check whether a hyperplane is universal.
Input
P– hyperplanewitness– (optional, default:false) compute a witness if activated
Output
- If
witnessoption is deactivated:false - If
witnessoption is activated:(false, v)where $v ∉ P$
Algorithm
A witness is produced by adding the normal vector to an element on the hyperplane.
Base.isempty — Method.isempty(hp::Hyperplane)Return if a hyperplane is empty or not.
Input
hp– hyperplane
Output
false.
LazySets.constrained_dimensions — Method.constrained_dimensions(hp::Hyperplane{N}) where {N<:Real}Return the indices in which a hyperplane is constrained.
Input
hp– hyperplane
Output
A vector of ascending indices i such that the hyperplane is constrained in dimension i.
Examples
A 2D hyperplane with constraint $x1 = 0$ is constrained in dimension 1 only.
LazySets.constraints_list — Method.constraints_list(hp::Hyperplane{N}) where {N<:Real}Return the list of constraints of a hyperplane.
Input
hp– hyperplane
Output
A list containing two half-spaces.
LazySets.translate — Method.translate(hp::Hyperplane{N}, v::AbstractVector{N}; share::Bool=false
) where {N<:Real}Translate (i.e., shift) a hyperplane by a given vector.
Input
hp– hyperplanev– translation vectorshare– (optional, default:false) flag for sharing unmodified parts of the original set representation
Output
A translated hyperplane.
Notes
The normal vectors of the hyperplane (vector a in a⋅x = b) is shared with the original hyperplane if share == true.
Algorithm
A hyperplane $a⋅x = b$ is transformed to the hyperplane $a⋅x = b + a⋅v$. In other words, we add the dot product $a⋅v$ to $b$.
Inherited from LazySet: