Hyperrectangle

LazySets.HyperrectangleModule.HyperrectangleType
Hyperrectangle{N, VNC<:AbstractVector{N}, VNR<:AbstractVector{N}
              } <: AbstractHyperrectangle{N}

Type that represents a hyperrectangle.

A hyperrectangle is the Cartesian product of one-dimensional intervals.

Fields

  • center – center of the hyperrectangle as a real vector
  • radius – radius of the hyperrectangle as a real vector, i.e., half of its width along each coordinate direction

Examples

The Hyperrectangle type stores a vector representing the center and another vector representing the radius. The default constructor Hyperrectangle(c, r) receives the center and radius, in that order. For instance,

julia> c = [-1.0, 1.0];

julia> r = [2.0, 1.0];

julia> H = Hyperrectangle(c, r)
Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}}([-1.0, 1.0], [2.0, 1.0])

The above instance represents the hyperrectangle with the following vertices:

julia> vertices_list(H)
4-element Vector{Vector{Float64}}:
 [1.0, 2.0]
 [-3.0, 2.0]
 [1.0, 0.0]
 [-3.0, 0.0]

The getter functions for the center and the radius are center and radius_hyperrectangle (since radius corresponds to the radius of the enclosing ball of minimal volume):

julia> center(H)
2-element Vector{Float64}:
 -1.0
  1.0

julia> radius_hyperrectangle(H)
2-element Vector{Float64}:
 2.0
 1.0

There is also a constructor from lower and upper bounds with keyword arguments high and low. The following construction results in the same hyperrectangle as in the previous paragraph:

julia> l = [-3.0, 0.0];

julia> h = [1.0, 2.0];

julia> Hyperrectangle(low=l, high=h)
Hyperrectangle{Float64, Vector{Float64}, Vector{Float64}}([-1.0, 1.0], [2.0, 1.0])

By default, the constructor checks that that radius of the hyperrectangle is nonnegative. To suppress this check, use the check_bounds optional flag in the constructor. Note that if check_bounds is set to false, the behavior of a set with contradictory bounds is undefined.

source

Conversion

convert(::Type{Hyperrectangle}, ::AbstractHyperrectangle)
convert(::Type{Hyperrectangle}, ::IA.IntervalBox)
convert(::Type{IA.IntervalBox}, ::AbstractHyperrectangle)

Operations

LazySets.radius_hyperrectangleMethod
radius_hyperrectangle(H::Hyperrectangle)

Return the box radius of a hyperrectangle in every dimension.

Input

  • H – hyperrectangle

Output

The box radius of the hyperrectangle.

source
LazySets.radius_hyperrectangleMethod
radius_hyperrectangle(H::Hyperrectangle, i::Int)

Return the box radius of a hyperrectangle in a given dimension.

Input

  • H – hyperrectangle
  • i – dimension of interest

Output

The box radius in the given dimension.

source
Base.randMethod
rand(T::Type{<:LazySet}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
     [rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing
    )

Create a random set of the given set type.

Input

  • T – set type
  • N – (optional, default: Float64) numeric type
  • dim – (optional, default: 2) dimension
  • rng – (optional, default: GLOBAL_RNG) random number generator
  • seed – (optional, default: nothing) seed for reseeding

Output

A random set of the given set type.

source
Base.randMethod

Extended help

rand(::Type{Hyperrectangle}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
     [rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing)

Algorithm

All numbers are normally distributed with mean 0 and standard deviation 1. Additionally, the radius is nonnegative.

source
LazySets.API.translateMethod
translate(X::LazySet, v::AbstractVector)

Compute the translation of a set with a vector.

Input

  • X – set
  • v – vector

Output

A set representing $X + \{v\}$.

source
LazySets.API.translateMethod

Extended help

translate(H::Hyperrectangle, v::AbstractVector; [share]::Bool=false)

Input

  • H – hyperrectangle
  • v – translation vector
  • share – (optional, default: false) flag for sharing unmodified parts of the original set representation

Notes

The radius vector is shared with the original hyperrectangle if share == true.

source

Undocumented implementations:

Inherited from LazySet:

Inherited from ConvexSet:

Inherited from AbstractPolyhedron:

Inherited from AbstractPolytope:

Inherited from AbstractCentrallySymmetricPolytope:

Inherited from AbstractZonotope:

Inherited from AbstractHyperrectangle: