C++ convex-polyhedron Minkowski addition
- PPL-LLR-000447 Exact polyhedral Minkowski addition (Specifies)
- PPL-LLR-000031 Closed and non-necessarily-closed polyhedra (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
For entry operands P, Q ⊆ Rn, minkowski_sum_assign(y) shall replace the receiver by exactly P + Q = {p + q ∣ p ∈ P, q ∈ Q}. Ambient dimension and the receiver's closed or NNC topology shall be preserved. Empty in either operand shall yield empty; two nonempty zero-dimensional operands shall yield the zero-dimensional universe. Dimensions and topologies shall agree, otherwise std::invalid_argument shall be thrown before changing the represented value of the receiver. Self-aliasing shall use the entry operand twice. A distinct operand shall preserve its represented value.
Excluded NNC boundaries shall retain their membership meaning. The represented result shall be independent of whether constraints or generators were initially materialized. No particular redundant or minimized description is required.
The initialization, lifetime, synchronization, coefficient-profile and failure conditions of 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Logical cache normalization may preserve the mathematical value while changing its materialized representations. No general rollback after an arithmetic or resource exception is required beyond that common contract.
Taking the Cartesian product and mapping (p, q) ↦ p + q establishes exactness independently of the storage route. In generator form, a finite pair is an included point exactly when both contributing generators are included points, and is a closure point otherwise. Products of the operands' convex weights construct the finite pair sums. Positive total weight on included points in each input gives positive total weight on included point–point pairs. Conversely, the marginal weights of a valid output combination are valid input combinations. Ray cones and line spans add by retaining their generating directions. This proves the NNC construction as well as the closed case. Convexity gives P + P = 2P for self-addition. Using the least common denominator and combining only coordinate slots avoids unnecessary denominator products and temporary inhomogeneous sums.
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. This public Polyhedron member is inherited by C_Polyhedron and NNC_Polyhedron.
void minkowski_sum_assign(const Polyhedron& y);
Check literal endpoint sums and endpoint inclusion for closed, open and half-open scalar sets. Cover rational points with equal and unequal divisors, including a checked-int8 case whose least common denominator fits while the unreduced product does not. Compare boxes, triangles, deterministic point clouds, lower-dimensional and unbounded sets with the public Cartesian-product reference where admitted. Check both operand orders, self-addition, pending constraints and generators, sorted and unsorted NNC systems, borrowed source views after completion, invalid dimensions and topologies, reload, empty and zero-dimensional inputs. Validate checked-overflow reporting and temporary ownership under the common failure contract.
Fukuda04JSC | Whole work (background on Minkowski addition and vertex representations). BagnaraHZ10CGTA | Sections 2.1–2.3, Definition 2.2 (closed and NNC generator semantics).
doc/definitions.dox: Minkowski Addition; src/Polyhedron_defs.hh; src/Polyhedron_public.cc; tests/Polyhedron/minkowskisum1.cc.