Skip to content

Commit

Permalink
#2280 - Pass kwarg to affine_map (#2281)
Browse files Browse the repository at this point in the history
* Update LazySet.jl

* add test
  • Loading branch information
mforets authored Jul 30, 2020
1 parent e9a978b commit 3d9e2c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Interfaces/LazySet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function diameter(S::LazySet, p::Real=Inf)
end

"""
affine_map(M::AbstractMatrix, X::LazySet, v::AbstractVector)
affine_map(M::AbstractMatrix, X::LazySet, v::AbstractVector; kwargs...)
Compute a concrete affine map.
Expand All @@ -403,8 +403,8 @@ A set representing the affine map of `X`.
The implementation applies the functions `linear_map` and `translate`.
"""
function affine_map(M::AbstractMatrix, X::LazySet, v::AbstractVector)
return translate(linear_map(M, X), v)
function affine_map(M::AbstractMatrix, X::LazySet, v::AbstractVector; kwargs...)
return translate(linear_map(M, X; kwargs...), v)
end

"""
Expand Down
2 changes: 2 additions & 0 deletions test/unit_BallInf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ for N in [Float64, Rational{Int}, Float32]
am = affine_map(M, B, v)
@test ispermutation(vertices_list(am),
[N[4, 1], N[0, 1], N[-2, -3], N[2, -3]])
amv = affine_map(M, B, v, algorithm="vrep") # pass a custom algorithm
@test amv isa VPolygon && isequivalent(am, amv)

# volume
B = BallInf(N[0, 0], N(1))
Expand Down

0 comments on commit 3d9e2c5

Please sign in to comment.