Skip to content

Commit

Permalink
Merge pull request #2485 from JuliaReach/schillic/project
Browse files Browse the repository at this point in the history
Fix docs (project methods)
  • Loading branch information
schillic authored Jan 4, 2021
2 parents 10406d6 + af223dc commit 8db34e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/src/lib/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ area(::LazySet{N}) where {N}
concretize(::LazySet)
complement(::LazySet)
project(S::LazySet{N}, ::AbstractVector{Int}, ::Nothing=nothing, ::Int=dim(S)) where {N}
project(S::LazySet, ::AbstractVector{Int}, ::Type{var"#s27"} where var"#s27"<:LazySet, ::Int=dim(S))
project(S::LazySet, ::AbstractVector{Int}, ::Pair{var"#s14",var"#s12"} where var"#s12"<:Real where var"#s14"<:UnionAll, ::Int=dim(S))
project(S::LazySet, ::AbstractVector{Int}, ::Type{TS}, ::Int=dim(S)) where {TS<:LazySet}
project(S::LazySet, ::AbstractVector{Int}, ::Pair{T, N}, ::Int=dim(S)) where {T<:UnionAll, N<:Real}
project(S::LazySet, ::AbstractVector{Int}, ::Real, ::Int=dim(S))
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/lazy_operations/LinearMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ an_element(::LinearMap)
vertices_list(::LinearMap)
constraints_list(::LinearMap)
linear_map(::AbstractMatrix, ::LinearMap)
project(S::LazySet{N}, ::AbstractVector{Int}, ::Type{T} where T<:LinearMap, ::Int=dim(S)) where {N}
project(S::LazySet{N}, ::AbstractVector{Int}, ::Type{LM}, ::Int=dim(S)) where {N, LM<:LinearMap}
```
Inherited from [`AbstractAffineMap`](@ref):
* [`isempty`](@ref isempty(::AbstractAffineMap))
Expand Down
16 changes: 8 additions & 8 deletions src/Interfaces/LazySet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1182,9 +1182,9 @@ end
"""
project(S::LazySet,
block::AbstractVector{Int},
set_type::Type{<:LazySet},
set_type::Type{TS},
[n]::Int=dim(S)
)
) where {TS<:LazySet}
Project a high-dimensional set to a given block and set type, possibly involving
an overapproximation.
Expand All @@ -1210,19 +1210,19 @@ coordinates and zero otherwise.
"""
@inline function project(S::LazySet,
block::AbstractVector{Int},
set_type::Type{<:LazySet},
set_type::Type{TS},
n::Int=dim(S)
)
) where {TS<:LazySet}
lm = project(S, block, LinearMap, n)
return overapproximate(lm, set_type)
end

"""
project(S::LazySet,
block::AbstractVector{Int},
set_type_and_precision::Pair{<:UnionAll, <:Real},
set_type_and_precision::Pair{T, N},
[n]::Int=dim(S)
)
) where {T<:UnionAll, N<:Real}
Project a high-dimensional set to a given block and set type with a certified
error bound.
Expand Down Expand Up @@ -1252,9 +1252,9 @@ coordinates and zero otherwise.
"""
@inline function project(S::LazySet,
block::AbstractVector{Int},
set_type_and_precision::Pair{<:UnionAll, <:Real},
set_type_and_precision::Pair{T, N},
n::Int=dim(S)
)
) where {T<:UnionAll, N<:Real}
set_type = set_type_and_precision[1]
ε = set_type_and_precision[2]
@assert length(block) == 2 && set_type == HPolygon "currently only 2D " *
Expand Down
8 changes: 4 additions & 4 deletions src/LazyOperations/LinearMap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ end
"""
project(S::LazySet{N},
block::AbstractVector{Int},
set_type::Type{<:LinearMap},
set_type::Type{LM},
[n]::Int=dim(S)
) where {N}
) where {N, LM<:LinearMap}
Project a high-dimensional set to a given block by using a lazy linear map.
Expand All @@ -483,9 +483,9 @@ A lazy `LinearMap` representing the projection of the set `S` to block `block`.
"""
@inline function project(S::LazySet{N},
block::AbstractVector{Int},
set_type::Type{<:LinearMap},
set_type::Type{LM},
n::Int=dim(S)
) where {N}
) where {N, LM<:LinearMap}
M = projection_matrix(block, n, N)
return M * S
end

0 comments on commit 8db34e7

Please sign in to comment.