C++ box coordinate transformations
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000443 Dimension-preserving coordinate forgetting (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 a nonempty box, forgetting a selected coordinate shall replace its factor by the selected interval profile's universe, leaving every other factor and the ambient dimension unchanged. Forgetting a set of coordinates shall apply that meaning to all selected positions. The result shall exactly denote existential elimination of those values with the same positions restored as unrestricted coordinates. An empty source shall remain empty, including when emptiness is carried only by a factor being forgotten. Forgetting no coordinates shall preserve the value.
An out-of-dimension variable, or any member of a selected set outside the ambient dimension, shall throw std::invalid_argument. This validation shall apply also to empty boxes. Valid coordinate selections shall use the coordinate identity and lifetime rules for Variable and Variables_Set.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Forgetting values retains coordinate identity and differs from deleting coordinate positions.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void unconstrain(Variable var); void unconstrain(const Variables_Set& vars);
Compare all coordinate subsets of independent small Cartesian products; retain empty sources with a selected or unselected empty factor, zero-dimensional empty/universe, ambient dimensions and untouched factors. Check single-coordinate/set equivalence and invalid selections.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000418 Distinguished coordinate extensions (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)
Adding m coordinates shall preserve every old coordinate in its original position and append the new coordinates at the highest indices. add_space_dimensions_and_embed(m) shall append unrestricted factors. add_space_dimensions_and_project(m) shall append factors containing exactly zero. Each completed result shall exactly denote the corresponding Cartesian extension. Empty sources shall remain empty, including empty zero-dimensional sources; zero-dimensional universe shall extend to the corresponding unrestricted or zero-fixed product. Adding zero coordinates shall preserve the value.
If the resulting ambient dimension would exceed max_space_dimension(), the operation shall throw std::length_error before attempting coordinate allocation of that size. Successful dimensions shall remain subject to resource availability.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Unrestricted extension and extension fixed to zero represent different sets.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void add_space_dimensions_and_embed(dimension_type m); void add_space_dimensions_and_project(dimension_type m);
Compare literal unrestricted and zero-factor suffixes in dimensions zero through three, nonempty/empty sources and lazy empty factors. Check no-op calls, coordinate order and dimension overflow rejection without large allocation.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000444 Concatenation, coordinate expansion and folding (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)
concatenate_assign(y) shall replace the destination by the exact Cartesian product of its entry value and y's entry value, with destination coordinates preceding source coordinates. The ambient dimensions shall add. Either empty operand shall make the result empty. Zero-dimensional universe shall act as the identity on either side; zero-dimensional empty shall retain its empty-set meaning.
A distinct source shall remain unchanged. Self-concatenation shall be admitted and shall use the entry factors twice, with independently mutable factor storage after success. The two tuples in a self-product shall be chosen independently. Dimension overflow shall throw std::length_error; successful dimensions shall remain subject to allocation/resource availability.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Cartesian composition must preserve operand order and separate the values selected for each tuple.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void concatenate_assign(const Box& y);
Compare ordered factor sequences of independently chosen boxes, empty and zero-dimensional operands, lazy emptiness on either side and self-products. Mutate original/appended coordinates after success to check independent storage and retained sources.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000417 Coordinate removal and existential projection (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)
remove_space_dimensions(vars) shall existentially project away exactly the selected coordinates. Surviving factors shall retain their relative order and shall receive contiguous indices starting at zero. The resulting dimension shall be the entry dimension minus the selected set's cardinality. For boxes this projection shall be exact. Empty sources shall remain empty, even if the only empty factor is removed. Removing every coordinate from a nonempty box shall give zero-dimensional universe; removing every coordinate from empty shall give zero-dimensional empty. Removing no coordinates shall preserve the value.
A selected coordinate outside the entry ambient dimension shall throw std::invalid_argument, including for empty inputs.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Existential projection removes positions while preserving the order of surviving coordinates.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void remove_space_dimensions(const Variables_Set& vars);
Enumerate coordinate subsets of independent factor vectors, including removal of every/no coordinate, empty factors at all positions and nonadjacent removed positions. Compare surviving order and zero-dimensional meaning; check invalid selections.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000417 Coordinate removal and existential projection (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)
remove_higher_space_dimensions(d) shall exactly project onto the first d entry coordinates. The ambient dimension shall become d and retained factors shall preserve order and values. An empty source shall remain empty regardless of which factors carried emptiness. Projection to dimension zero shall yield universe exactly for a nonempty source, and empty for an empty source. Requesting the current dimension shall preserve the value.
If d exceeds the entry ambient dimension, the operation shall throw std::invalid_argument. It shall not extend the box.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Trailing projection has the same empty-set semantics as general coordinate removal.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void remove_higher_space_dimensions(dimension_type d);
Compare each prefix dimension against an independent existential projection, including zero/all retained coordinates, empty sources and emptiness stored only in a discarded factor. Check excessive-dimension rejection and agreement with selected-coordinate projection.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000419 Coordinate remapping semantics (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 ambient dimension n, the supplied mapping shall be a stable injective partial function on indices from zero through n-1, with image exactly the contiguous indices from zero through m-1 for some m no greater than n. The operation shall exactly project away unmapped coordinates and place each retained entry factor at its mapped index. The result shall have dimension m. Empty sources shall remain empty. An empty mapping shall give zero-dimensional universe for a nonempty source and zero-dimensional empty for an empty source. A zero-dimensional source shall retain its value.
The mapping object shall provide the protocol shown below. has_empty_codomain() shall report whether the map is nowhere defined; max_in_codomain() shall return the maximum image when nonempty; maps(i,j) shall report membership in the domain and, on true, assign the image to j. Whenever callbacks are used, the empty-codomain query shall precede the others, and a true result shall preclude maximum/image queries. No callback shall be required for a zero-dimensional source. Values and mapping callbacks shall meet their own resource, lifetime and synchronization prerequisites. A mapping violating the stated mathematical/protocol preconditions shall be outside the contract.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Coordinate remapping combines projection with a specified renaming, without conflating or duplicating coordinates.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
template <typename Partial_Function> void map_space_dimensions(const Partial_Function& pfunc); // Required const operations on the mapping argument: bool has_empty_codomain() const; dimension_type max_in_codomain() const; bool maps(dimension_type i, dimension_type& j) const;
Compare partial injections, permutations, empty maps and removal-plus-permutation against independent factor-index vectors. Exercise callback ordering and short-circuiting with a protocol-checking adapter; retain empty/lazy-empty and zero-dimensional values. Check verified identity maps without temporary C++ allocation, unchanged cached representations and owned capacity after copying and grow/shrink histories. Compare first/last/middle swaps, reversal, cycles and projections against literal coordinate oracles; preserve floating-point mode/flags. Inject every mapping-query exception and check propagation, safe replacement and temporary cleanup.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc. tests/coordinatemappingfixture.hh; tests/Box/mapspacedims1.cc;
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000444 Concatenation, coordinate expansion and folding (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 a valid existing coordinate var, expand_space_dimension(var,m) shall append m factors with the entry factor's value. Original coordinates shall retain their values and indices. Each new factor shall own independently mutable storage. The resulting box shall be the least Cartesian interval enclosure, in the selected factor profile, of the coordinate-expansion relation: the original selected value may be chosen independently of the replica value, while all replicas in a concrete expanded tuple use a common selected-factor value. The box enclosure may choose different values for different replicas. No original-to-replica equality shall be imposed. Empty sources shall remain empty. Adding no replicas shall preserve the value.
An out-of-dimension coordinate shall throw std::invalid_argument, including when m is zero or the box is empty. If the final dimension exceeds max_space_dimension(), the operation shall throw std::length_error. Successful dimensions shall remain subject to resource availability.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Box expansion copies admissible coordinate values; the Cartesian representation abstracts relationships among multiple replicas.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void expand_space_dimension(Variable var, dimension_type m);
Compare appended factors against independent entry-factor copies for zero/one/multiple replicas, singleton/nonsingleton factors and empty sources. Include tuples with distinct replica values in the abstract enclosure and distinct original/replica values in the concrete relation. Check storage independence, invalid coordinates and overflow.
GopanDMDRS04 | Whole work (background on expansion and folding of summarized dimensions).
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000444 Concatenation, coordinate expansion and folding (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 a valid destination coordinate dest and selected set vars that excludes it, folding shall replace the destination factor by the least interval of the selected profile containing the union of its entry factor and all selected entry factors. It shall then remove the selected coordinates, compacting the remaining positions in their original order. Other retained factors shall preserve their entry values. This shall be the least box enclosure of the alternatives obtained by choosing either the original destination or one selected coordinate for the surviving destination value. Gaps between those alternatives may be included by the interval hull. Empty sources shall remain empty. An empty selected set shall preserve the value.
An out-of-dimension destination or selected coordinate, or inclusion of the destination in the selected set, shall throw std::invalid_argument. Destination validity shall be required even for an empty selected set and for an empty box.
The validity, numerical, initialization, synchronization and resource prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Operations requiring Variables_Set or mapping objects shall retain those objects' own interface prerequisites. A distinct borrowed source shall remain unchanged unless explicitly included in the destination mutation. Underlying allocation or endpoint exceptions shall retain their own guarantees; no general rollback guarantee shall be inferred.
Folding combines coordinate alternatives and removes their positions; interval enclosure makes its precision explicit.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Box<ITV>:
void fold_space_dimensions(const Variables_Set& vars, Variable dest);
Compute interval union hulls independently, including disjoint factors, tied extrema with different endpoint openness, unbounded factors, destination shifts after removal and multiple/nonadjacent selected positions. Compare untouched factors, empty/lazy-empty and zero-selection values; check all invalid selection classes.
GopanDMDRS04 | Whole work (background on expansion and folding of summarized dimensions).
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxcoordinatesspec1.cc; tests/boxpublic1.cc.