Skip to content

Commit 9d812d6

Browse files
authored
add 'linear_map_inverse' for EmptySet (#3887)
2 parents 0d56017 + c17c6f9 commit 9d812d6

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Sets/EmptySet/EmptySetModule.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using ReachabilityBase.Require: require
2020
intersection, , isdisjoint, , linear_combination,
2121
minkowski_difference, minkowski_sum
2222
@reexport import ..LazySets: chebyshev_center_radius, constrained_dimensions,
23-
rationalize, triangulate
23+
linear_map_inverse, rationalize, triangulate
2424
import ..LazySets: plot_recipe
2525
import Base: convert, copy
2626
@reexport using ..API
@@ -55,6 +55,7 @@ include("exponential_map.jl")
5555
include("in.jl")
5656
include("is_interior_point.jl")
5757
include("linear_map.jl")
58+
include("linear_map_inverse.jl")
5859
include("permute.jl")
5960
include("project.jl")
6061
include("scale.jl")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function linear_map_inverse(Minv::AbstractMatrix{N}, ∅::EmptySet{N}) where {N}
2+
@assert size(Minv, 1) == dim(∅) "a linear map of size $(size(Minv)) " *
3+
"cannot be applied to a set of dimension $(dim(∅))"
4+
n = size(Minv, 2)
5+
return EmptySet{N}(n)
6+
end

test/Sets/EmptySet.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,8 @@ for N in @tN([Float64, Float32, Rational{Int}])
233233
@test isidentical(E3, E2)
234234

235235
# linear_map_inverse
236-
@test_broken LazySets.linear_map_inverse(ones(N, 2, 3), E) # TODO this should maybe change
237-
# E2 = LazySets.linear_map_inverse(ones(N, 2, 3), E)
238-
# @test isidentical(E3, E2)
236+
E2 = LazySets.linear_map_inverse(ones(N, 2, 3), E)
237+
@test isidentical(E3, E2)
239238

240239
# permute
241240
@test_throws DimensionMismatch permute(E, [1])

0 commit comments

Comments
 (0)