Open schillic opened 3 years ago
a better algorithm for this special case,
for general dimension or in 2d?
julia> using LazySets
julia> P = rand(Ball1); B = rand(BallInf);
# compilation
julia> @time S = convert(HPolygon, minkowski_sum(convert(VPolygon, P), convert(VPolygon, B)));
1.274598 seconds (3.03 M allocations: 154.306 MiB, 2.25% gc time)
julia> @time S = convert(HPolygon, minkowski_sum(convert(VPolygon, P), convert(VPolygon, B)));
0.000028 seconds (146 allocations: 12.797 KiB)
EDIT: here are some related issues:
for general dimension or in 2d?
Good point.
417.710 μs (1449 allocations: 100.83 KiB) # minkowski_sum
9.698 μs (143 allocations: 12.75 KiB) # your conversion
BallInf
and implement your conversion (for any two polygons) in a new issue.
Currently we require
Polyhedra
andCDDLib
for the following code:The first time I run this in a fresh session this takes forever (as of writing it still did not terminate) for me.
I have the feeling that there is a better algorithm for this special case, but I am not 100% sure:
P
according toB
's center (P1 = P + B.center
)box_approximation(P)
(P2 = box_approximation(P1)
)B
's radius (P3 = push_outside(P2, B.radius)
with suitable definition)P4 = remove_redundant_constraints!(P3)
)