ZonotopeMD

LazySets.ZonotopeMDModule.ZonotopeMDType
ZonotopeMD{N,VN<:AbstractVector{N},MN<:AbstractMatrix{N},DN<:AbstractVector{N}}
    <: AbstractZonotope{N}

Type that represents a structured zonotope.

Fields

  • center – center of the zonotope
  • M – matrix of general (non-axis-aligned) generators
  • d – vector representing a diagonal matrix of axis-aligned generators

Notes

A structured zonotope is defined as the set

\[Z = \left\{ x ∈ ℝ^n : x = c + Mξ + dIη, ~~ ξ ∈ [-1, 1]^m, ~~ η ∈ [-1, 1]^n \right\},\]

where $M ∈ ℝ^{n×m}$ is a matrix of general generators and $d ∈ ℝⁿ$ is a vector representing axis-aligned generators. Equivalently, this can be seen as a zonotope with generator matrix $[M D]$, where $D$ is the diagonal matrix formed from the vector $d$.

A ZonotopeMD can be constructed in two ways: by passing $M$ and a vector $d$ separately or by passing the full generator matrix $[M D]$.

Examples

Constructing a structured zonotope from a center, general generator matrix $M$, and diagonal vector $d$:

julia> c = [0.0, 0.0];

julia> M = [1.0 2.0; 3.0 1.0];

julia> d = [0.1, 0.2];

julia> Z = ZonotopeMD(c, M, d)
ZonotopeMD{Float64, Vector{Float64}, Matrix{Float64}, Vector{Float64}}([0.0, 0.0], [1.0 2.0; 3.0 1.0], [0.1, 0.2])

julia> center(Z)
2-element Vector{Float64}:
 0.0
 0.0

julia> genmat(Z)
2×4 SparseArrays.SparseMatrixCSC{Float64, Int64} with 6 stored entries:
 1.0  2.0  0.1   ⋅
 3.0  1.0   ⋅   0.2

Constructing the same zonotope by passing the full generator matrix $[M D]$ directly:

julia> G = [1.0 2.0 0.1 0.0;
            3.0 1.0 0.0 0.2];

julia> Z2 = ZonotopeMD(c, G)
ZonotopeMD{Float64, Vector{Float64}, Matrix{Float64}, Vector{Float64}}([0.0, 0.0], [1.0 2.0; 3.0 1.0], [0.1, 0.2])

The generator matrix returned by genmat is the concatenation $[M D]$ represented as a sparse matrix.

julia> genmat(Z2) == G
true

One can also convert back to a standard Zonotope if needed:

julia> Zstd = convert(Zonotope, Z)
Zonotope{Float64, Vector{Float64}, SparseArrays.SparseMatrixCSC{Float64, Int64}}([0.0, 0.0], sparse([1, 2, 1, 2, 1, 2], [1, 1, 2, 2, 3, 4], [1.0, 3.0, 2.0, 1.0, 0.1, 0.2], 2, 4))
source

Operations

LazySets.genmatMethod

genmat(Z::ZonotopeMD)

Return the generator matrix of a structured zonotope.

Input

  • Z – structured zonotope

Output

A matrix where each column represents one generator of the zonotope Z.

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{ZonotopeMD}; [N]::Type{<:Real}=Float64, [dim]::Int=2,
     [rng]::AbstractRNG=GLOBAL_RNG, [seed]::Union{Int, Nothing}=nothing,
     [num_generators]::Int=-1)

Algorithm

All numbers are normally distributed with mean 0 and standard deviation 1.

The number of non-axis-aligned generators can be controlled with the argument num_generators. For a negative value, we choose a random number in the range dim:2*dim (except if dim == 1, in which case we only create a single generator).

source
LazySets.API.cartesian_productMethod
cartesian_product(Z1::ZonotopeMD, Z2::ZonotopeMD)

Return the Cartesian product of two structured zonotopes.

Input

  • Z1 – structured zonotope
  • Z2 – structured zonotope

Output

A new ZonotopeMD representing the Cartesian product Z1 × Z2.

source

Undocumented implementations:

Inherited from LazySet:

Inherited from ConvexSet:

Inherited from AbstractPolyhedron:

Inherited from AbstractPolytope:

Inherited from AbstractCentrallySymmetricPolytope:

Inherited from AbstractZonotope: