Skip to content

Commit

Permalink
move function
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Feb 10, 2018
1 parent 7fd0445 commit a48bea3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/Zonotope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 18 additions & 0 deletions src/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a48bea3

Please sign in to comment.