Skip to content

Commit

Permalink
add helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Feb 26, 2021
1 parent 1f12e81 commit 12678e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Interfaces/LazySet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,13 @@ We apply the function `linear_map`.
::Nothing=nothing,
n::Int=dim(S)
) where {N}
return _project_linear_map(S, block, n)
end

@inline function _project_linear_map(S::LazySet{N},
block::AbstractVector{Int},
n::Int=dim(S)
) where {N}
M = projection_matrix(block, n, N)
return linear_map(M, S)
end
Expand Down
2 changes: 1 addition & 1 deletion src/LazyOperations/CartesianProduct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ end
function project(cp::CartesianProduct, block::AbstractVector{Int})
res = _project_cp_same_block(cp, block)
if res == nothing
res = invoke(project, Tuple{LazySet, typeof(block)}, cp, block)
res = _project_linear_map(cp, block)
end
return res
end
Expand Down

0 comments on commit 12678e5

Please sign in to comment.