Closed mforets closed 4 years ago
related: #269, #614
I'm not sure if the library should do this automatic conversion on the creation of the object. Perhaps not. However, we can easily offer the conversion, adding a method for:
julia> convert(MinkowskiSumArray, z ⊕ MinkowskiSumArray([z, z]))
ERROR: MethodError: Cannot `convert` an object of type MinkowskiSum{Float64,Zonotope{Float64},MinkowskiSumArray{Float64,Zonotope{Float64}}} to an object of type MinkowskiSumArray
Closest candidates are:
convert(::Type{MinkowskiSumArray}, ::MinkowskiSumArray) at /home/mforets/.julia/dev/LazySets/src/convert.jl:8
convert(::Type{T}, ::T) where T at essentials.jl:167
MinkowskiSumArray(::LazySet{N<:Real}, ::ZeroSet{N<:Real}) where N<:Real at /home/mforets/.julia/dev/LazySets/src/Utils/macros.jl:39
...
Stacktrace:
[1] top-level scope at REPL[8]:1
... by one MinkowskiSumArray.
e.g the result in the second line could be automatically simplified to a
MinkowskiSumArray{Float64,Zonotope{Float64}}
: