@@ -811,14 +811,20 @@ struct ASB10 <: AbstractReductionMethod end
811
811
"""
812
812
JKS16 <: AbstractReductionMethod
813
813
814
- Zonotope order-reduction method from [SCOTT2016126](@citet).
815
- """
816
- struct JKS16 <: AbstractReductionMethod
814
+ `JKS16` uses a greedy factorization and iterative generator reduction
815
+
816
+ ### Algorithm
817
817
818
+ - The JKS16 method reorders the generator matrix using reduced row echelon form (rref) to form a `T`,
819
+ then iteratively removes excess generators from `V` while updating `T`.
820
+ - The default `JKS16()` uses `ϵ = 1e-6` (pivot threshold) and `δ = 1e-3` (volume threshold).
821
+ Referenced from [SCOTT2016126](@citet).
822
+ """
823
+ struct JKS16{N<: Number } <: AbstractReductionMethod
818
824
ϵ:: N
819
825
δ:: N
820
826
821
- JKS16 (ϵ:: N = 1e-6 , δ:: N = 1e-3 ) = new (ϵ, δ)
827
+ JKS16 (ϵ:: N = 1e-6 , δ:: N = 1e-3 ) where {N <: Number } = new {N} (ϵ, δ)
822
828
end
823
829
824
830
"""
@@ -844,16 +850,18 @@ The available algorithms are:
844
850
845
851
```jldoctest; setup = :(using LazySets: subtypes, AbstractReductionMethod)
846
852
julia> subtypes(AbstractReductionMethod)
847
- 3 -element Vector{Any}:
853
+ 4 -element Vector{Any}:
848
854
LazySets.ASB10
849
855
LazySets.COMB03
850
856
LazySets.GIR05
857
+ LazySets.JKS16
851
858
```
852
859
853
860
See the documentation of each algorithm for references. These methods split the
854
861
given zonotopic set `Z` into two zonotopes, `K` and `L`, where `K` contains the
855
862
most "representative" generators and `L` contains the generators that are
856
- reduced, `Lred`, using a box overapproximation. We follow the notation from
863
+ reduced, `Lred`, using a box overapproximation. This methodology varies slightly
864
+ for `JKS16` (for details, refer to the method). We follow the notation from
857
865
[YangS18](@citet). See also [KopetzkiSA17](@citet).
858
866
"""
859
867
function reduce_order (Z:: AbstractZonotope , r:: Real ,
@@ -865,7 +873,10 @@ function reduce_order(Z::AbstractZonotope, r::Real,
865
873
866
874
# if r is bigger than the order of Z => do not reduce
867
875
(r * n >= p) && return Z
876
+ return _reduce_order_zonotope_common (Z, r, n, p, method)
877
+ end
868
878
879
+ function _reduce_order_zonotope_common (Z, r, n, p, method:: Union{ASB10,COMB03,GIR05} )
869
880
c = center (Z)
870
881
G = genmat (Z)
871
882
@@ -891,39 +902,7 @@ function reduce_order(Z::AbstractZonotope, r::Real,
891
902
return Zonotope (c, Gred)
892
903
end
893
904
894
- """
895
- reduce_order(Z::AbstractZonotope, r::Real,
896
- method::JKS16)
897
-
898
- Reduce the order of a zonotopic set by overapproximating it with a zonotope that has
899
- fewer generators, using the JKS16 method.
900
-
901
- ### Input
902
-
903
- - `Z` -- zonotopic set
904
- - `r` -- desired order
905
- - `method` -- `JKS16` uses a greedy factorization and iterative generator reduction
906
-
907
- ### Output
908
-
909
- A new zonotope with fewer generators, if possible.
910
-
911
- ### Algorithm
912
-
913
- - The JKS16 method reorders the generator matrix using reduced row echelon form (rref) to form a `T`,
914
- then iteratively removes excess generators from `V` while updating `T`.
915
- - The default `JKS16()` uses `ϵ = 1e-6` (pivot threshold) and `δ = 1e-3` (volume threshold).
916
- Referenced from [SCOTT2016126](@citet).
917
- """
918
- function reduce_order (Z:: AbstractZonotope , r:: Real , method:: JKS16 )
919
- r >= 1 || throw (ArgumentError (" the target order should be at least 1, " *
920
- " but it is $r " ))
921
- n = dim (Z)
922
- p = ngens (Z)
923
-
924
- # if r is bigger than the order of Z => do not reduce
925
- (r * n >= p) && return Z
926
-
905
+ function _reduce_order_zonotope_common (Z, r, n, p, method:: JKS16 )
927
906
c = center (Z)
928
907
G = genmat (Z)
929
908
@@ -960,7 +939,7 @@ function reduce_order(Z::AbstractZonotope, r::Real, method::JKS16)
960
939
end
961
940
962
941
# reorder the generator matrix G
963
- function _factorG (G:: AbstractMatrix , ϵ:: N , δ:: N )
942
+ function _factorG (G:: AbstractMatrix , ϵ:: N , δ:: N ) where {N}
964
943
G✶ = copy (G)
965
944
n, ng = size (G)
966
945
0 commit comments