diff --git a/docs/src/lib/binary_functions.md b/docs/src/lib/binary_functions.md index a73b2d4107..b8e86c59cc 100644 --- a/docs/src/lib/binary_functions.md +++ b/docs/src/lib/binary_functions.md @@ -64,6 +64,7 @@ convex_hull(::SimpleSparsePolynomialZonotope, ::SimpleSparsePolynomialZonotope) ## Exact sum ```@docs +⊞ exact_sum(::SparsePolynomialZonotope, ::SparsePolynomialZonotope) ``` diff --git a/src/ConcreteOperations/exact_sum.jl b/src/ConcreteOperations/exact_sum.jl index 42dc8b7465..0d25e7b623 100644 --- a/src/ConcreteOperations/exact_sum.jl +++ b/src/ConcreteOperations/exact_sum.jl @@ -12,12 +12,13 @@ Compute the exact sum of sparse polyomial zonotopes ``P₁`` and ``P₂``. ### Output -exact sum ``P₁ ⊞ P₂`` - +A `SparsePolynomialZonotope` representing the exact sum ``P₁ ⊞ P₂``. """ function exact_sum(P1::SparsePolynomialZonotope, P2::SparsePolynomialZonotope) - indexvector(P1) == indexvector(P2) || throw(ArgumentError("Exact sum currently only implemented for Sparse Polynomial Zonotopes with the same index vector")) + indexvector(P1) == indexvector(P2) || throw(ArgumentError("the exact sum " * + "is currently only implemented for sparse polynomial zonotopes with " * + "the same index vector")) c = center(P1) + center(P2) G = hcat(genmat_dep(P1), genmat_dep(P2)) @@ -28,4 +29,13 @@ function exact_sum(P1::SparsePolynomialZonotope, P2::SparsePolynomialZonotope) return SparsePolynomialZonotope(c, G, GI, E, idx) end +""" + ⊞(X::LazySet, Y::LazySet) + +Unicode alias constructor ⊕ (`oplus`) for the (concrete) `exact_sum` function. + +### Notes + +Write `\\boxplus[TAB]` to enter this symbol. +""" const ⊞ = exact_sum