From af223dcb14d9309140a9de8739f3d16851624e45 Mon Sep 17 00:00:00 2001 From: schillic Date: Mon, 4 Jan 2021 08:44:59 +0100 Subject: [PATCH] fix docs (project methods) --- docs/src/lib/interfaces.md | 4 ++-- docs/src/lib/lazy_operations/LinearMap.md | 2 +- src/Interfaces/LazySet.jl | 16 ++++++++-------- src/LazyOperations/LinearMap.jl | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/src/lib/interfaces.md b/docs/src/lib/interfaces.md index 7b21418bac..e70d1c4cd1 100644 --- a/docs/src/lib/interfaces.md +++ b/docs/src/lib/interfaces.md @@ -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)) ``` diff --git a/docs/src/lib/lazy_operations/LinearMap.md b/docs/src/lib/lazy_operations/LinearMap.md index 7183bc2c3f..16ad351ee0 100644 --- a/docs/src/lib/lazy_operations/LinearMap.md +++ b/docs/src/lib/lazy_operations/LinearMap.md @@ -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)) diff --git a/src/Interfaces/LazySet.jl b/src/Interfaces/LazySet.jl index f0e85ed725..0f16864dc0 100644 --- a/src/Interfaces/LazySet.jl +++ b/src/Interfaces/LazySet.jl @@ -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. @@ -1210,9 +1210,9 @@ 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 @@ -1220,9 +1220,9 @@ 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. @@ -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 " * diff --git a/src/LazyOperations/LinearMap.jl b/src/LazyOperations/LinearMap.jl index 290bf6bf84..7b07b25227 100644 --- a/src/LazyOperations/LinearMap.jl +++ b/src/LazyOperations/LinearMap.jl @@ -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. @@ -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