diff --git a/src/ConcreteOperations/exact_sum.jl b/src/ConcreteOperations/exact_sum.jl index 2625178e30..50146f90f4 100644 --- a/src/ConcreteOperations/exact_sum.jl +++ b/src/ConcreteOperations/exact_sum.jl @@ -13,11 +13,20 @@ Compute the exact sum of sparse polyomial zonotopes ``P₁`` and ``P₂``. ### Output A `SparsePolynomialZonotope` representing the exact sum ``P₁ ⊞ P₂``. + +### Algorithm + +This method implements Proposition 3.1.20 in [1]. + +[1] Kochdumper, Niklas. *Extensions of polynomial zonotopes and their application + to verification of cyber-physical systems.* PhD diss., Technische Universität + München, 2022. """ function exact_sum(P1::SparsePolynomialZonotope, P2::SparsePolynomialZonotope) - indexvector(P1) == indexvector(P2) || throw(ArgumentError("the exact sum " * - "is currently only implemented for sparse polynomial zonotopes with " * - "the same index vector")) + if indexvector(P1) != indexvector(P2) + throw(ArgumentError("the exact sum is currently only implemented for " * + "sparse polynomial zonotopes with the same index vector")) + end c = center(P1) + center(P2) G = hcat(genmat_dep(P1), genmat_dep(P2))