Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs (project methods) #2485

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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