From a48bea3397c78320d1b2dc21c896808b0c293f4c Mon Sep 17 00:00:00 2001 From: schillic Date: Sat, 10 Feb 2018 13:24:50 +0100 Subject: [PATCH] move function --- src/Zonotope.jl | 18 ------------------ src/convert.jl | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Zonotope.jl b/src/Zonotope.jl index 18067e11af..6c7d720f6b 100644 --- a/src/Zonotope.jl +++ b/src/Zonotope.jl @@ -386,21 +386,3 @@ function reduce_order(Z::Zonotope{N}, r)::Zonotope{N} where {N<:Real} end return Zonotope(c, Gred) end - -""" - convert(::Type{Zonotope}, H::AbstractHyperrectangle{N}) where {N} - -Converts a hyperrectangular set to a zonotope. - -### Input - -- `Zonotope` -- `H` -- hyperrectangular set - -### Output - -A zonotope. -""" -function convert(::Type{Zonotope}, H::AbstractHyperrectangle{N}) where {N} - return Zonotope{N}(center(H), diagm(radius_hyperrectangle(H))) -end diff --git a/src/convert.jl b/src/convert.jl index 0b21d92f85..c810829e4c 100644 --- a/src/convert.jl +++ b/src/convert.jl @@ -60,3 +60,21 @@ function convert(::Type{HPOLYGON}, end return HPOLYGON(P.constraints) end + +""" + convert(::Type{Zonotope}, H::AbstractHyperrectangle{N}) where {N} + +Converts a hyperrectangular set to a zonotope. + +### Input + +- `Zonotope` +- `H` -- hyperrectangular set + +### Output + +A zonotope. +""" +function convert(::Type{Zonotope}, H::AbstractHyperrectangle{N}) where {N} + return Zonotope{N}(center(H), diagm(radius_hyperrectangle(H))) +end