Skip to content

Commit

Permalink
Merge pull request #839 from JuliaReach/schillic/ambiguities
Browse files Browse the repository at this point in the history
Fix ambiguities with `cluster`
  • Loading branch information
mforets authored Aug 27, 2024
2 parents eb94759 + f922cc3 commit 3b00ddf
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/Flowpipes/clustering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,25 @@ end
# for Taylor model flowpipes we preprocess it with a zonotopic overapproximation
function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx,
method::LazyClustering{P,Val{true}}) where {N,P}
Fz = overapproximate(Flowpipe(view(F, idx)), Zonotope)
return cluster(Fz, 1:length(idx), method) # Fx is now indexed from 1 ... length(idx)
return _cluster_TM(F, idx, method)
end
# disambiguations
function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx,
method::LazyClustering{Missing,Val{true}}) where {N}
return _cluster_TM(F, idx, method)
end

# ambiguity fix
function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx,
method::LazyClustering{P,Val{false}}) where {N,P}
return _cluster_TM(F, idx, method)
end
function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx,
method::LazyClustering{Missing,Val{false}}) where {N}
return _cluster_TM(F, idx, method)
end

function _cluster_TM(F, idx, method)
Fz = overapproximate(Flowpipe(view(F, idx)), Zonotope)
return cluster(Fz, 1:length(idx), method)
return cluster(Fz, 1:length(idx), method) # Fx is now indexed from 1 ... length(idx)
end

# =====================================
Expand Down

0 comments on commit 3b00ddf

Please sign in to comment.