C++ grid generators and grid-generator systems
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000438 Thread entry and shared-facility use (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
A Grid_Generator shall describe a rational included point, a rational parameter displacement vector, or a continuous line direction, in its public ambient dimension. For a point or parameter with numerators ai and positive divisor d, coordinates shall be ai ⁄ d. Parameters shall retain their exact rational step, including sign and magnitude; integer multiples of that step shall contribute to a generated grid. Lines shall contribute arbitrary real multiples of their direction. Hidden divisor fields shall not be public coordinates.
Both storage representations shall be supported; default_representation shall be SPARSE. Initialization and synchronization shall follow 🔗 3. Thread initialization, default state and finalization. Computed construction, transformation, scaling and comparison guarantees shall require all evaluated coefficient steps/results to be representable in the selected profile; unchecked completion shall not prove that condition. Allocation/numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete grid generator; distinct unchanged sources shall survive failures, while modified targets shall remain destructible without universal rollback.
A parameter is a sized displacement vector rather than a scale-free direction. Its exact value is separate from the integer span it contributes to a grid.
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.
class Grid_Generator; enum Grid_Generator::Type { LINE, PARAMETER, POINT }; static constexpr Representation Grid_Generator::default_representation = SPARSE;
Compare independent rational point/parameter vectors and line proportionality. Distinguish rational/integral displacements, scaled and opposite parameters, continuous lines and integer steps.
BagnaraHZ08SCP | Section 2.4, equation (1) and parameter representation BagnaraDHMZ07 | Section 3, The Generator Representation
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
grid_line(e,r) shall construct a line from homogeneous coefficients, ignore the constant, retain declared dimension and use requested storage. It shall produce a primitive direction with first nonzero coefficient positive. A zero homogeneous direction, including a nonzero constant expression, shall throw std::invalid_argument without modifying its source. Static and free forms shall agree geometrically. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.
Continuous direction is unchanged by nonzero common scaling and cannot be constructed from the zero vector.
static Grid_Generator Grid_Generator::grid_line(const Linear_Expression& e, Representation r = default_representation); Grid_Generator grid_line(const Linear_Expression& e, Representation r = Grid_Generator::default_representation);
Check static/free factories, both signs, common factors, ignored constants, gaps, trailing dimensions and zero-direction rejection.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
parameter(e,d,r) shall create the rational displacement with coordinates ai ⁄ d from the homogeneous input coefficients, ignoring the constant, retaining dimension and using requested storage. Nonzero negative divisors shall be accepted by reversing numerator/divisor signs to make stored divisor positive while preserving the exact signed step. The parameter's magnitude shall not be normalized as a line direction. Zero displacement shall be admitted and retain its dimension. Zero divisor shall throw std::invalid_argument and preserve sources.
Defaults shall use dimension-zero zero expression, divisor one and default storage. Representation-only and expression/representation forms shall use divisor one. A divisor borrowed from the unchanged input expression shall be admitted using its entry value. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.
Dividing a parameter vector without its divisor changes its periodic step. Zero is a valid redundant displacement descriptor.
static Grid_Generator Grid_Generator::parameter( const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation); static Grid_Generator Grid_Generator::parameter(Representation r); static Grid_Generator Grid_Generator::parameter(const Linear_Expression& e, Representation r); Grid_Generator parameter(const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Grid_Generator::default_representation); Grid_Generator parameter(Representation r); Grid_Generator parameter(const Linear_Expression& e, Representation r);
Check every static/free/default form, signed/nonunit divisors, common factors, exact doubled/opposite steps, zero parameters with positive dimension, borrowed divisor and zero-divisor rejection.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000438 Thread entry and shared-facility use (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
grid_point(e,d,r) shall construct the rational point with coordinates ai ⁄ d, ignoring the expression constant, retaining dimension and using requested storage. A negative nonzero divisor shall reverse numerator signs and become positive; common factors may be removed while preserving rational coordinates. Zero divisor shall throw std::invalid_argument. A divisor borrowed from the unchanged input expression shall use its entry value.
Omitted expression/divisor arguments shall denote the dimension-zero origin and divisor one. Representation-only and expression/representation forms shall use divisor one. Default construction shall produce that origin using requested storage. zero_dim_point() shall borrow the zero-dimensional origin until owning-thread finalization; owned copies shall be independent.
A rational supporting point fixes a grid offset and differs from a periodic parameter at the same coordinate vector.
static Grid_Generator Grid_Generator::grid_point( const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation); static Grid_Generator Grid_Generator::grid_point(Representation r); static Grid_Generator Grid_Generator::grid_point(const Linear_Expression& e, Representation r); Grid_Generator grid_point(const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Grid_Generator::default_representation); Grid_Generator grid_point(Representation r); Grid_Generator grid_point(const Linear_Expression& e, Representation r); explicit Grid_Generator(Representation r = default_representation); static const Grid_Generator& Grid_Generator::zero_dim_point();
Check all static/free/default forms, positive/negative divisors, origins in different dimensions, exact rational coordinates and shared lifetime, input aliases and zero-divisor rejection.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
Copy construction shall preserve exact fields, kind, dimension and source representation; explicit-storage copies shall select their argument. Assignment shall copy complete entry value/storage, preserve distinct sources, return the target and admit self-assignment. Rvalue inputs shall admit copy forms retaining source value without requiring a distinct move operation. Copies shall remain independent of source mutation/destruction. Swaps shall exchange complete values, dimension and storage; self-swap shall preserve them. Destruction shall release owned storage. Failure during copy assignment's replacement construction shall preserve the target.
Each grid-generator object owns its expression and divisor fields independently.
Grid_Generator(const Grid_Generator& g); Grid_Generator(const Grid_Generator& g, Representation r); Grid_Generator& Grid_Generator::operator=(const Grid_Generator& g); Grid_Generator::~Grid_Generator(); void Grid_Generator::m_swap(Grid_Generator& y); void swap(Grid_Generator& x, Grid_Generator& y);
Check all kinds, exact rational parameter/point fields, representation choices, return identity, self/rvalue forms, surviving copies, swaps and replacement-copy failures.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
representation() shall report storage. Successful conversion to dense or sparse representation shall select requested storage and preserve exact coefficients, divisor when applicable, kind and dimension. Repeating the current choice shall preserve the object. Failed replacement allocation shall leave its original value and storage unchanged.
Representation conversion must preserve parameter magnitude as well as point coordinates and line orientation.
Representation Grid_Generator::representation() const; void Grid_Generator::set_representation(Representation r);
Convert every kind in both directions, including unnormalized numerator/divisor tuples and zero parameters, checking exact fields and allocation-failure preservation.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (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)
max_space_dimension() shall equal the linear-expression limit minus one, reserving the internal divisor coordinate. space_dimension() shall report public dimension. Dimensioned copies and resizing shall require admitted result dimensions, retain lower-index coordinates and zero-extend or discard trailing coordinates. Explicit-storage copies shall use their argument; other copies shall retain source storage.
remove_space_dimensions(vars) shall require in-dimension selected indices, discard those coordinate coefficients, compact retained coordinates in their original order and return true. Removing none/all shall be admitted. Kind, storage and applicable rational remaining coordinates shall be retained. A transformed zero parameter or zero line direction shall contribute no displacement, without supplying a supporting point.
A reserved divisor field must follow dimension changes without being mistaken for a coordinate; collapsed steps contribute zero displacement.
static dimension_type Grid_Generator::max_space_dimension(); dimension_type Grid_Generator::space_dimension() const; Grid_Generator(const Grid_Generator& g, dimension_type space_dim); Grid_Generator(const Grid_Generator& g, dimension_type space_dim, Representation r); void Grid_Generator::set_space_dimension(dimension_type n); bool Grid_Generator::remove_space_dimensions(const Variables_Set& vars);
Check dimensioned copies, zero/trailing dimensions, shrink/extend and none/interior/all removals for all kinds. Compare exact rational vectors or retained line spans, preserving divisor and kind while excluding hidden columns.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (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)
Swapping in-dimension variables shall exchange their coordinate coefficients. A cycle shall require distinct in-dimension variables and move each listed coefficient to the following listed position, wrapping last to first. Empty and singleton cycles shall preserve the object. Inserting zero coordinates before v.id() <= space_dimension() shall shift the suffix and increase dimension by the requested admitted amount; a zero shift shall preserve value. Kinds, storage and applicable rational point/parameter values shall follow that coordinate correspondence. A line may be reoriented by equivalent sign normalization; a parameter's sign and exact step shall be preserved.
Sign normalization valid for continuous lines would change an explicitly directed parameter vector.
void Grid_Generator::swap_space_dimensions(Variable x, Variable y); void Grid_Generator::permute_space_dimensions(const std::vector<Variable>& cycle); void Grid_Generator::shift_space_dimensions(Variable v, dimension_type n);
Use independent tuple swaps/cycles and front/interior/end zero insertion, including negative-leading parameters, zero parameters and rational points with nonunit divisors.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (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)
Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.
Kind predicates and type() shall identify line, parameter and point; is_line_or_parameter() and is_parameter_or_point() shall identify their named unions. coefficient(v) shall expose a public coordinate numerator or direction coefficient, rejecting v.id() >= space_dimension() with std::invalid_argument. divisor() shall return a positive divisor for parameters/points and reject lines with std::invalid_argument. all_homogeneous_terms_are_zero() shall inspect only public homogeneous coordinates, excluding divisor fields.
expression() shall borrow a read-only view of the public homogeneous coefficients, with public dimension and constant zero, hiding divisor fields. The owner shall remain alive and unchanged for covered view uses. Materializing the view shall yield an independent Linear_Expression. Configured returned references shall borrow until owner mutation/destruction. Queries shall preserve source values.
Public homogeneous queries exclude both the point divisor and the parameter's separate internal divisor coordinate.
Grid_Generator::Type Grid_Generator::type() const; bool Grid_Generator::is_line() const; bool Grid_Generator::is_parameter() const; bool Grid_Generator::is_point() const; bool Grid_Generator::is_line_or_parameter() const; bool Grid_Generator::is_parameter_or_point() const; Coefficient_traits::const_reference Grid_Generator::coefficient(Variable v) const &; Coefficient_traits::const_reference Grid_Generator::divisor() const &; bool Grid_Generator::all_homogeneous_terms_are_zero() const; typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression>> Grid_Generator::expr_type; Grid_Generator::expr_type Grid_Generator::expression() const &;
Check every predicate combination, exact coefficients/divisors, zero tests, first/later out-of-range access and line-divisor rejection. Materialize views and verify hidden-column exclusion and independence.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
For a point or parameter and positive input d, set_divisor(d) shall replace only its divisor using the input entry value, preserving coordinate numerators, dimension, kind and storage. It shall therefore change the rational vector when the divisor changes. A divisor borrowed from the same object shall be admitted. Calling it on a line shall throw std::invalid_argument without changing that line.
Replacing a divisor changes rational coordinates; it is different from scaling a representation to an equivalent divisor.
void Grid_Generator::set_divisor(Coefficient_traits::const_reference d);
Check point/parameter divisor replacement, self-divisor and positive borrowed-coordinate inputs with unchanged numerators. Compare changed rational vectors and verify documented line rejection.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
For a point or parameter, scale_to_divisor(d) shall require a positive d that is an exact multiple of the current positive divisor. It shall set the divisor to d and multiply all public numerators by the same positive ratio, preserving exact rational vector, kind, dimension and storage. Reusing the current divisor shall preserve exact fields. Borrowed inputs from the same object shall use their entry values. For a line and any admitted positive d it shall do nothing. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.
Common-denominator maintenance preserves an exact parameter step, unlike plain divisor replacement.
void Grid_Generator::scale_to_divisor(Coefficient_traits::const_reference d);
Check exact multiples, unchanged divisor, point/parameter rational preservation, borrowed divisor and positive coefficient multiples, line no-op and representable product boundaries.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (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)
is_equivalent_to and equality shall compare equal-kind, equal-dimension generators independently of storage. Points and parameters shall compare their exact rational vectors, including parameter sign and magnitude. Opposite parameter vectors may generate the same integer span but shall remain distinct parameter values. Lines shall compare their real direction spans, admitting opposite nonzero scales. Different dimensions/kinds shall compare unequal. Inequality shall negate equivalence.
is_equal_to shall compare complete stored fields and kind independently of storage. Positive identity shall imply equivalence; a negative identity shall not prove different geometric values. Queries shall preserve sources. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.
Exact parameter vectors and the grids generated by their integer spans support different equivalence questions.
bool Grid_Generator::is_equivalent_to(const Grid_Generator& y) const; bool Grid_Generator::is_equal_to(const Grid_Generator& y) const; bool operator==(const Grid_Generator& x, const Grid_Generator& y); // Inequality uses C++20 rewriting of operator==.
Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Compare independently equal rational tuples with unreduced common factors, changed point/parameter magnitudes and opposite signs, line scales/signs, dimensions and representations. Include transformed lines whose leading nonzero sign changes after removal.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000446 Reloadable textual representations (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
ascii_dump(s) shall export all stored coefficient/divisor fields and the public kind token; the no-argument form shall use std::cerr. Export shall preserve the source. Compatible complete exported data with representable coefficients shall load with true, replacing the generator's fields and public dimension while retaining destination storage.
Malformed/truncated expression or kind fields, missing internal divisor slots, nonpositive point/parameter divisors and encoded kind/field mismatches shall return false rather than be accepted as valid generators. Trailing input shall remain available. A failed target shall remain destructible and admit complete valid replacement, without rollback or cross-version format promises. Allocation and numerical exceptions may propagate.
A declared point token must not silently load as a parameter merely because its coefficient fields encode that different kind.
void Grid_Generator::ascii_dump(std::ostream& s) const; void Grid_Generator::ascii_dump() const; bool Grid_Generator::ascii_load(std::istream& s);
Round-trip all kinds, zero/nonzero parameters, rational and unreduced tuples across destination choices. Check exact kind/divisor/coordinate fields and reject malformed/truncated expressions, kind mismatches, invalid counts/divisors and unsupported structure. Reject missing hidden divisor storage, nonpositive parameter/point divisors and inconsistent point/line fields through false rather than assertion failure. Exercise dense/sparse destination replacement and preserve positive-divisor zero parameters and valid line records retaining hidden divisor metadata.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
Grid-generator output shall use l(...), q(...) or p(...) for line, parameter or point, printing public homogeneous coefficients with the active formatter and sign/unit conventions of 🔗 14. Human-readable affine output and formatter dispatch. Zero tuples shall print 0. A nonunit point/parameter divisor shall be printed after /, with parentheses around a nonzero numerator expression. Kind output shall print LINE, PARAMETER or POINT.
System output shall print its public generators separated by ", ", or false for an empty range. Output shall return the supplied stream, add no newline and preserve source values. Each type's print() shall use that output on std::cerr. Evaluated coefficient negations shall be representable.
Display retains parameter step size and rational scaling without exposing internal divisor columns.
namespace IO_Operators { std::ostream& operator<<(std::ostream& s, const Grid_Generator& g); std::ostream& operator<<(std::ostream& s, const Grid_Generator::Type& type); std::ostream& operator<<(std::ostream& s, const Grid_Generator_System& gs); } void Grid_Generator::print() const; void Grid_Generator_System::print() const;
Check literal all-kind/type output, unreduced parameters, rational/zero vectors, custom variable names, empty/multirow systems, separators, stream identity and standard-error printing.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000438 Thread entry and shared-facility use (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
For lines L, parameters Q and included points P, a Grid_Generator_System shall generate the real vectors
Without a point the generated grid shall be empty, even with stored nonzero lines/parameters. Integer affine combinations of multiple points shall not be replaced by convex combinations. Default construction shall make a zero-dimensional system with no rows; an explicit dimension constructor shall retain its supplied admitted dimension. Singleton construction shall copy its generator and dimension, including a zero parameter. Ordinary insertion shall separately follow 🔗 17. Grid-generator insertion, zero steps and ownership transfer. Requested storage shall be used, with default SPARSE. zero_dim_univ() shall borrow the singleton zero-dimensional origin until owning-thread finalization. Numerical/use/failure prerequisites shall follow 🔗 1. Grid-generator values and integer versus continuous displacement.
Grid generation combines integer affine offsets and integer parameter steps with continuous line spans; a convex hull would admit incorrect fractional displacements.
class Grid_Generator_System; static constexpr Representation Grid_Generator_System::default_representation = SPARSE; explicit Grid_Generator_System(Representation r = default_representation); explicit Grid_Generator_System(dimension_type dim, Representation r = default_representation); explicit Grid_Generator_System(const Grid_Generator& g, Representation r = default_representation); static const Grid_Generator_System& Grid_Generator_System::zero_dim_univ();
Check supporting-point absence, rational offsets, half-integer steps, points at zero and two generating even integers, continuous line directions and zero-dimensional empty/universal systems against independent lattice equations.
BagnaraHZ08SCP | Section 2.4, equation (1) and parameter representation BagnaraDHMZ07 | Section 3, The Generator Representation
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
Copies/assignment shall preserve generated grid, declared dimension and retained row sequence. Ordinary copies and assignment shall retain source storage, while explicit-storage copies shall use their argument. Assignment shall return the target, preserve distinct sources, admit self-assignment and retain source value under rvalue copy forms. Copies shall survive source mutation/destruction. Swaps shall exchange full values, dimensions and storage, including self-swap. Successful representation conversion shall select dense or sparse row storage and preserve the generated grid and dimension. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Grid-generator values and integer versus continuous displacement.
is_equal_to and system equality shall compare declared dimensions and retained row sequence using equivalent corresponding generators, not decide equality of arbitrarily reordered or redundant generated grids. Comparison shall ignore dense/sparse choice. Destruction shall release owned storage.
Owning row-sequence comparison remains distinct from equality of the lattice or continuous affine set generated by a system.
Grid_Generator_System(const Grid_Generator_System& gs); Grid_Generator_System(const Grid_Generator_System& gs, Representation r); Grid_Generator_System& Grid_Generator_System::operator=(const Grid_Generator_System& y); Grid_Generator_System::~Grid_Generator_System(); Representation Grid_Generator_System::representation() const; void Grid_Generator_System::set_representation(Representation r); void Grid_Generator_System::m_swap(Grid_Generator_System& y); void swap(Grid_Generator_System& x, Grid_Generator_System& y); bool Grid_Generator_System::is_equal_to(const Grid_Generator_System& y) const; bool operator==(const Grid_Generator_System& x, const Grid_Generator_System& y);
Check copy/self/rvalue forms, swaps/conversions and destruction independence for empty and mixed systems. Compare matching sequences across storage, different dimensions/counts and changed rows without inferring a general grid-equivalence decision.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
Const-reference insertion shall add a copy of a grid generator to the generating collection, preserve its source and retain target storage. Result dimension shall be the maximum input dimension, zero-extending shorter rows. A zero parameter shall add no row but shall still extend ambient dimension as needed; it shall not supply a supporting point. Copy insertion of a borrowed target row shall use its entry value. Duplicates/redundant generators may be removed or reordered while preserving the generated grid.
Rvalue row insertion shall transfer a source not borrowed from the target, with the same generated-grid effect as copying; the source shall remain destructible. Consuming-system insertion shall require distinct systems, combine their generating collections in aligned dimensions, and clear the source to a dimension-zero empty system on success. No unchanged-value guarantee shall apply to transferred inputs. Numerical/failure prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.
Const row sources, including const rvalues, shall use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.
Zero displacement is redundant yet still carries ambient dimension. Ownership transfer must not accidentally add a supporting point or change a parameter period.
void Grid_Generator_System::insert(const Grid_Generator& g); void Grid_Generator_System::insert(Grid_Generator&& g); void Grid_Generator_System::insert(Grid_Generator_System&& gs);
Check dimension alignment, zero-parameter discarding, borrowed-row insertion, copied-source preservation and recycled row/system ownership. Compare independent generated-grid examples before/after adding points, lines and rational parameters.
src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
max_space_dimension() shall return Grid_Generator::max_space_dimension() - 1 and space_dimension() the public ambient dimension. empty() shall mean no stored rows, independently of whether the generated grid lacks a supporting point. num_rows(), num_parameters() and num_lines() shall count retained stored generators of their named scope; has_points() shall report a retained point. clear() shall remove all rows and reset dimension zero while retaining storage.
begin()/end() shall expose retained generators sharing system dimension, without promising geometric sorted order or duplicate multiplicity. Forward iterators shall borrow rows, support independent copied/assigned positions, return the advanced iterator from prefix increment and entry-position copy from postfix increment. Comparison shall require one unchanged system. Defaults shall admit copying/assignment/destruction before valid-position assignment. System mutation/destruction shall invalidate iterators and rows.
Container counts, presence of a supporting point and geometric generated-grid emptiness answer different questions.
static dimension_type Grid_Generator_System::max_space_dimension(); dimension_type Grid_Generator_System::space_dimension() const; bool Grid_Generator_System::empty() const; dimension_type Grid_Generator_System::num_rows() const; dimension_type Grid_Generator_System::num_parameters() const; dimension_type Grid_Generator_System::num_lines() const; bool Grid_Generator_System::has_points() const; void Grid_Generator_System::clear(); class Grid_Generator_System::const_iterator; Grid_Generator_System::const_iterator Grid_Generator_System::begin() const; Grid_Generator_System::const_iterator Grid_Generator_System::end() const; Grid_Generator_System::const_iterator::const_iterator(); Grid_Generator_System::const_iterator::const_iterator(const const_iterator& y); Grid_Generator_System::const_iterator::~const_iterator(); Grid_Generator_System::const_iterator& Grid_Generator_System::const_iterator::operator=(const const_iterator& y); const Grid_Generator& Grid_Generator_System::const_iterator::operator*() const; const Grid_Generator* Grid_Generator_System::const_iterator::operator->() const; Grid_Generator_System::const_iterator& Grid_Generator_System::const_iterator::operator++(); Grid_Generator_System::const_iterator Grid_Generator_System::const_iterator::operator++(int); bool Grid_Generator_System::const_iterator::operator==(const const_iterator& y) const; bool Grid_Generator_System::const_iterator::operator!=(const const_iterator& y) const;
Check empty, zero-parameter-only and all-kind systems, exact row/kind counts and supporting-point presence. Check shared dimensions, copied/default-assigned iterator positions, prefix/postfix return semantics and borrowed pointer identity.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.
OK() shall report checked storage invariants, without promising canonical normalization of every valid parameter representation. Successful operations under their preconditions shall produce values satisfying those invariants. Each type's total memory count shall equal its sizeof plus external memory count. Queries shall preserve geometric fields, kind, dimension and storage. Counts shall not promise allocator overhead, process memory or a dense/sparse size ordering.
Unreduced but valid rational step representations must remain admissible while ownership accounting remains exact at its declared scope.
bool Grid_Generator::OK() const; memory_size_type Grid_Generator::total_memory_in_bytes() const; memory_size_type Grid_Generator::external_memory_in_bytes() const; bool Grid_Generator_System::OK() const; memory_size_type Grid_Generator_System::total_memory_in_bytes() const; memory_size_type Grid_Generator_System::external_memory_in_bytes() const;
Check all kinds, zero/unreduced parameters, copies/conversions and empty/mixed systems. Verify invariants and memory identities with unchanged fields without target-specific byte constants.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000446 Reloadable textual representations (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
ascii_dump(s) shall export stored rows, public dimension, storage and required system-state fields; the no-argument form shall use std::cerr. Export shall preserve source value. Compatible complete exports with representable coefficients shall load with true, replacing the target's generated grid, dimension, retained rows and encoded storage.
Malformed/truncated headers/rows, invalid divisor or kind structure, and inconsistent encoded dimensions/state fields shall return false rather than be accepted as valid systems. Trailing input shall remain available. Failed targets shall remain destructible and admit complete valid replacement, without rollback or cross-version format promises. Allocation/numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.
Reload must preserve parameter periods and supporting-point offsets together with ambient dimension.
void Grid_Generator_System::ascii_dump(std::ostream& s) const; void Grid_Generator_System::ascii_dump() const; bool Grid_Generator_System::ascii_load(std::istream& s);
Round-trip empty positive-dimensional, no-supporting-point and mixed rational-point/parameter/line systems across destination choices. Check encoded storage, dimensions and independent lattice membership; reject malformed/truncated structural fields and row-kind/divisor inconsistencies. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.
src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.