C++ generators and generator systems
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Parents:
|
Incoming links from:
1. Closed bounded-difference support hull of geometric generators
3. Cartesian enclosure of a polyhedral generator system
4. Generator-distance admission, workspaces and dispatch
5. Stored ordering of polyhedral generators
2. Construction of nonzero lines and rays
3. Construction of rational points and closure points
11. Geometric equivalence and stored generator identity
15. Generator-system hull meaning and construction
16. Owned generator systems and storage conversion
17. Generator insertion and coefficient ownership transfer
1. Closed octagonal support hull of geometric generators
6. Java mathematical representations and operation options
12 |
A Generator shall describe one of four geometric objects in a declared ambient dimension: an included rational point, a rational closure point, a ray direction or a line direction. For homogeneous integer coefficients ai and positive divisor d, point and closure-point coordinates shall be ai ⁄ d. A line shall admit arbitrary real multiples of its nonzero direction; a ray shall admit nonnegative real multiples. Closure points shall retain their distinct kind and shall not assert boundary inclusion. Internal divisor/strictness fields shall not become public coordinates. Use shall satisfy 🔗 3. Thread initialization, default state and finalization and require caller synchronization for overlapping modification of an object. Dense and sparse storage shall be supported, with default_representation equal to SPARSE. Computed construction, normalization, transformation and comparison guarantees shall require representability of every evaluated coefficient step/result in the selected profile. Unchecked completion shall not prove those preconditions. Allocation and numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete generator; distinct unchanged sources shall survive failures, while modified destinations shall remain destructible without universal rollback. |
Point inclusion, closure and directional reachability have different geometric meanings even when their coordinate coefficients coincide. |
BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4 |
|
|
|
|
Use independent exact rational point coordinates and direction-proportionality checks; distinguish positive ray scales from signed line scales and included points from closure points. Exercise all supported storage choices and trailing coordinates. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. class Generator; enum Generator::Type { LINE, RAY, POINT, CLOSURE_POINT }; static constexpr Representation Generator::default_representation = SPARSE; |
|
|
SW_SPEC
|
2 |
|
|
Parents:
|
Incoming link from:
1. Closed octagonal support hull of geometric generators
1 |
line(e) and ray(e) shall use the expression's homogeneous coefficients as their respective direction, ignore its constant term and retain its declared dimension. They shall use requested storage. A zero homogeneous direction, including a nonzero constant expression, shall throw std::invalid_argument. Results shall have primitive homogeneous coefficients; lines shall orient their first nonzero coefficient positively, while rays shall preserve orientation. Source expressions shall remain unchanged. Numerical prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply. |
The zero vector is not a direction; nonzero expression constants do not change the represented line or ray. |
|
|
|
|
|
Check static/free forms, both direction signs, common factors, leading/trailing zeros, ignored constants and zero-direction rejection with unchanged sources. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
static Generator Generator::line(const Linear_Expression& e, Representation r = default_representation); static Generator Generator::ray(const Linear_Expression& e, Representation r = default_representation); Generator line(const Linear_Expression& e, Representation r = Generator::default_representation); Generator ray(const Linear_Expression& e, Representation r = Generator::default_representation); |
|
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
point(e,d) and closure_point(e,d) shall respectively construct an included or closure point whose coordinates are the homogeneous coefficients of e divided by the entry value of nonzero d. They shall ignore the expression constant, retain its dimension and use requested storage. A negative divisor shall be accepted by reversing all coordinate numerators and making the stored divisor positive, preserving rational coordinates. The stored numerator/divisor tuple shall be primitive. Zero divisor shall throw std::invalid_argument and preserve sources. Omitted expressions shall denote the dimension-zero origin; omitted divisors shall be one. Representation-only overloads shall make that origin, and expression/representation overloads shall use divisor one. A divisor borrowed from the unchanged input expression shall be admitted using its entry value. The numerical prerequisites of 🔗 1. Generator kinds and numerical prerequisites shall apply. |
A numerator coefficient is not itself a point coordinate when the positive divisor differs from one. |
|
|
|
|
|
Compare exact rational coordinates for all static/free overloads, positive/negative divisors, common factors, origin/default arguments, borrowed divisor and ignored constants. Check retained dimensions, point/closure kind and zero-divisor rejection. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
static Generator Generator::point(const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation); static Generator Generator::point(Representation r); static Generator Generator::point(const Linear_Expression& e, Representation r); static Generator Generator::closure_point(const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation); static Generator Generator::closure_point(Representation r); static Generator Generator::closure_point(const Linear_Expression& e, Representation r); Generator point(const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Generator::default_representation); Generator point(Representation r); Generator point(const Linear_Expression& e, Representation r); Generator closure_point(const Linear_Expression& e = Linear_Expression::zero(), Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Generator::default_representation); Generator closure_point(Representation r); Generator closure_point(const Linear_Expression& e, Representation r); |
|
|
SW_SPEC
|
4 |
|
|
|
Default construction shall create the dimension-zero included origin using requested storage. zero_dim_point() and zero_dim_closure_point() shall return borrowed dimension-zero origins of their respective distinct types, with positive divisor. Shared values shall remain alive until owning-thread finalization. Owned copies shall retain their values independently. |
The origin exists in dimension zero, but included-origin and closure-origin descriptors still have distinct topological roles. |
|
|
|
|
|
Check requested/default storage, kinds, dimensions and positive divisors for defaults/shared values and independent copies during balanced initialization. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
explicit Generator(Representation r = default_representation); static const Generator& Generator::zero_dim_point(); static const Generator& Generator::zero_dim_closure_point(); |
||
|
SW_SPEC
|
5 |
|
|
Parents:
|
|
Ordinary copying shall preserve kind, dimension, exposed coefficients, divisor when applicable and source representation. Explicit-storage copying shall use requested storage. Assignment shall copy the complete entry value and source storage, return the target reference, preserve a distinct source and support self-assignment. Rvalue arguments shall admit the copy forms, retaining source value without requiring a distinct move operation. Copies shall survive later source mutation or destruction. Both swap forms shall exchange full values, dimension and storage; self-swap shall preserve the generator. Destruction shall release owned storage. Failure while constructing copy assignment's replacement shall leave the target unchanged. |
Owning geometric descriptors must remain independent even when their values originated from shared constants or expression views. |
|
|
|
|
|
Check every kind across both storage choices, assignment identity/self/rvalue forms, source destruction, mutation independence, swaps and replacement-copy allocation failures. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
Generator(const Generator& g); Generator(const Generator& g, Representation r); Generator& Generator::operator=(const Generator& g); Generator::~Generator(); void Generator::m_swap(Generator& y); void swap(Generator& x, Generator& y); |
|
|
SW_SPEC
|
6 |
|
|
Parents:
|
|
representation() shall report current coefficient storage. Successful set_representation(r) for dense or sparse storage shall preserve kind, public dimension, exposed coefficients and applicable divisor while selecting r. Repeating current storage shall preserve the object. Failed replacement allocation shall leave its value and representation unchanged. |
Storage conversion changes neither rational coordinates nor direction orientation or topological kind. |
|
|
|
|
|
Convert all four kinds both directions, including rational coordinates and unused dimensions, comparing exact fields and independent geometric values. Check repeated conversion and replacement allocation failures. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
Representation Generator::representation() const; void Generator::set_representation(Representation r); |
|
|
SW_SPEC
|
7 |
|
|
Parents:
|
|
space_dimension() shall report public ambient dimension and max_space_dimension() the expression dimension limit. Requested/result sizes shall not exceed that limit. Dimensioned copies and set_space_dimension(n) shall retain lower-index coordinates, zero-extend new coordinates or discard removed trailing coordinates. Normalization may rescale an equivalent direction or numerator/divisor tuple. Kind and storage shall remain unchanged. Resizing a line or ray shall require a nonzero retained direction; removal that can collapse a direction shall instead follow 🔗 9. Removing generator coordinates and collapsed directions. Dimensioned copies without explicit storage shall retain source storage. |
Dimensioned generator copies transform coordinate tuples, while a zero direction cannot remain a valid line or ray. |
|
|
|
|
|
Check point/closure shrink/extend to and from dimension zero, direction resizing that retains nonzero coefficients, trailing zeros, and equivalent rational coordinates/directions after normalization. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
static dimension_type Generator::max_space_dimension(); dimension_type Generator::space_dimension() const; Generator(const Generator& g, dimension_type space_dim); Generator(const Generator& g, dimension_type space_dim, Representation r); void Generator::set_space_dimension(dimension_type n); |
|
|
SW_SPEC
|
8 |
|
|
Parents:
|
|
Swapping two in-dimension coordinates shall exchange their coefficients. A cycle of distinct in-dimension variables shall move each coefficient to the following listed coordinate, wrapping last to first; empty/singleton cycles shall preserve the generator. shift_space_dimensions(v,n) shall require v.id() <= space_dimension() and an admitted result dimension; it shall insert n zero coordinate slots before that position and increase dimension by n. A zero shift shall preserve value. These operations shall preserve kind and storage, and preserve applicable rational point coordinates or direction values according to their stated coordinate correspondence. Equivalent normalization may change stored scales. Divisor and internal strictness fields shall not become coordinates. |
Coordinate rearrangement must respect topological and rational scaling information stored alongside the homogeneous tuple. |
|
|
|
|
|
Check every kind with inverse/self swaps, longer and empty cycles, leading zeros and front/interior/end insertion against independent tuple transformations. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
void Generator::swap_space_dimensions(Variable x, Variable y); void Generator::permute_space_dimensions(const std::vector<Variable>& cycle); void Generator::shift_space_dimensions(Variable v, dimension_type n); |
|
|
SW_SPEC
|
9 |
|
|
Parents:
|
Incoming link from:
7. Generator dimensions and dimensioned copying
1 |
remove_space_dimensions(vars) shall require selected indices within the public dimension, discard those coefficients and compact surviving coordinates in their original order. Points and closure points shall retain their kind and rational remaining coordinates and return true. A line or ray whose retained direction is nonzero shall retain its geometric direction kind and return true. If its entire direction is removed, it shall become the included origin in the remaining coordinate space and return false. Removing no coordinates shall be admitted. Storage shall be retained and normalization may rescale equivalent tuples. |
A removed direction contributes no displacement; the return status distinguishes that collapse from a surviving directional descriptor. |
|
|
|
|
|
Remove none, interior, trailing and all coordinates from every kind. Check normalized remaining rational tuples, surviving directions, and the origin/type/false result when every nonzero direction component disappears. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
bool Generator::remove_space_dimensions(const Variables_Set& vars); |
|
|
SW_SPEC
|
10 |
|
|
Parents:
|
|
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. The kind predicates and type() shall identify the four public kinds exactly; is_line_or_ray() shall identify the two directional kinds. coefficient(v) shall expose a homogeneous numerator/direction coefficient for an in-dimension variable and otherwise throw std::invalid_argument. divisor() shall return a positive divisor for a point or closure point and otherwise throw std::invalid_argument. expression() shall borrow a read-only affine adapter with the public dimension and homogeneous coefficients, constant term zero, and no hidden strictness coordinate. It shall not encode the point divisor as a constant. The owner shall remain alive and unchanged for uses covered here. Copying that view to a Linear_Expression shall make an independent value. Configured coefficient references shall borrow their owner until mutation or destruction. Queries shall preserve source value. |
A public expression view gives numerators/directions, while obtaining a rational point still requires the separate divisor. |
|
|
|
|
|
Check predicate tables, in-range values, rejected first/later coordinates and rejected directional divisor access. Materialize views for every kind and verify zero constant, hidden-column exclusion and independence after source modification. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
Generator::Type Generator::type() const; bool Generator::is_line() const; bool Generator::is_ray() const; bool Generator::is_line_or_ray() const; bool Generator::is_point() const; bool Generator::is_closure_point() const; Coefficient_traits::const_reference Generator::coefficient(Variable v) const &; Coefficient_traits::const_reference Generator::divisor() const &; typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression>> Generator::expr_type; Generator::expr_type Generator::expression() const &; |
|
|
SW_SPEC
|
11 |
|
|
Parents:
|
|
is_equivalent_to and generator equality shall compare equal-dimension, equal-kind geometric objects independently of storage and internal topology. Point and closure-point comparisons shall use exact rational coordinates and keep their kinds distinct. Ray directions shall compare equivalent exactly for positive proportionality; line directions shall admit either nonzero proportionality sign. Different dimensions or kinds shall compare unequal. Inequality expressions shall negate equivalence. is_equal_to shall compare the complete stored normalized descriptor, including topology and fields, independently of dense/sparse storage. Positive identity shall imply equivalence; negative identity shall not imply geometric inequality. Queries shall preserve operands. Arithmetic prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply. |
Normalizing numerators without their divisor can change point coordinates, and positive versus signed proportionality distinguishes rays from lines. |
|
|
|
|
|
Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Compare exact rational points with common/different scales, same/opposite ray and line directions, kind differences and trailing dimensions. Include equivalent/different included points and directions promoted through NNC generator systems, preserving divisor information. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
bool Generator::is_equivalent_to(const Generator& y) const; bool Generator::is_equal_to(const Generator& y) const; bool operator==(const Generator& x, const Generator& y); // Inequality uses C++20 rewriting of operator==. |
|
|
SW_SPEC
|
12 |
|
|
Parents:
|
|
ascii_dump(s) shall export the full stored coefficient expression, public kind token and topology token; ascii_dump() shall use std::cerr. Export shall preserve the source. A complete compatible representation with representable coefficients shall load with true, replacing kind, coefficients, divisor and public dimension while retaining destination storage. Malformed/truncated expression, kind or topology fields, missing required coefficient slots, invalid directional zero vectors, nonpositive point divisors, violations of the checked row invariants and inconsistent kind/topology combinations shall return false rather than be accepted as valid generators. If expression loading fails, ascii_load(s) shall return false without reading the kind or topology suffix. Trailing input shall remain available. Failure may modify the target but shall leave it destructible and replaceable by a complete valid load. No rollback or cross-version format stability is promised; allocation and numerical exceptions may propagate. |
A reloaded generator needs valid rational scaling, nonzero directional data and correct topological kind, in addition to syntactically complete input. |
|
|
|
|
|
Round-trip all kinds, rational points, gaps and trailing dimensions across destination storage. Compare independent geometric values and exact fields; reject malformed/truncated fields, missing slots, zero directions and invalid divisors/kinds, then exercise complete replacement. Reject invalid expression prefixes followed by otherwise valid kind/topology suffixes, checking that those suffixes remain unread. Reject complete zero line/ray records, nonpositive point divisors, missing NNC epsilon storage and inconsistent epsilon fields with assertions enabled or disabled, across destination storage. After false, perform only complete valid replacement before querying the target; preserve trailing input. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
void Generator::ascii_dump(std::ostream& s) const; void Generator::ascii_dump() const; bool Generator::ascii_load(std::istream& s); |
|
|
SW_SPEC
|
13 |
|
|
|
Generator output shall use l(...), r(...), p(...) and c(...) for its respective kind. Inside, it shall print the homogeneous numerator or direction using active variable formatting and the coefficient sign/unit conventions of 🔗 14. Human-readable affine output and formatter dispatch. A zero tuple shall print 0. For point/closure divisor other than one it shall append / and that divisor, putting parentheses around a nonzero numerator expression. Type output shall print LINE, RAY, POINT or CLOSURE_POINT exactly. System output shall print its public iterator range separated by ", ", or false when there are no generators. Operators shall return the supplied stream, add no newline and preserve source values. Each type's print() shall use that output on std::cerr. Formatting coefficient negations shall satisfy the selected arithmetic profile's preconditions. |
Readable output preserves kind and rational scaling, while an empty generator list describes an empty generated set. |
|
|
|
|
|
Check literal all-kind/type formats, rational/nonrational origins, signs, custom coordinate names, empty and multirow systems, separators, return identity and redirected standard-error output. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
namespace IO_Operators { std::ostream& operator<<(std::ostream& s, const Generator& g); std::ostream& operator<<(std::ostream& s, const Generator::Type& type); std::ostream& operator<<(std::ostream& s, const Generator_System& gs); } void Generator::print() const; void Generator_System::print() const; |
||
|
SW_SPEC
|
14 |
|
|
|
OK() shall report the checked representation invariants of its generator or system. Values produced by successful operations under their valid-input and arithmetic preconditions shall satisfy them. Each type's total memory count shall equal its sizeof plus its external memory count. Queries shall preserve geometric fields, kind, dimension and storage. Counts shall not promise allocator overhead, process resident memory or dense/sparse size ordering. |
Ownership accounting and storage invariants concern valid representations rather than deciding membership in a generated polyhedron. |
|
|
|
|
|
Check all kinds and rational tuples, empty/populated systems, copies/conversions and memory identities with preserved semantic fields, without architecture-specific byte totals. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
bool Generator::OK() const; memory_size_type Generator::total_memory_in_bytes() const; memory_size_type Generator::external_memory_in_bytes() const; bool Generator_System::OK() const; memory_size_type Generator_System::total_memory_in_bytes() const; memory_size_type Generator_System::external_memory_in_bytes() const; |
||
|
SW_SPEC
|
15 |
|
|
Parents:
|
Incoming link from:
3. Cartesian enclosure of a polyhedral generator system
1 |
A Generator_System with lines L, rays R, included points P and closure points C shall generate exactly the real vectors
∑p ∈ Pλpp + ∑c ∈ Cγcc + ∑r ∈ Rρrr + ∑l ∈ Lτll,
where λp, γc, ρr ≥ 0, τl ∈ ℝ, ∑pλp + ∑cγc = 1 and ∑pλp > 0. Thus a system without an included supporting point shall generate the empty set, even when directions or closure points are stored. Its meaning shall be a generated hull, not a conjunction of point membership conditions. Default construction shall have dimension zero and no rows. Singleton construction shall own a copy of its generator and adopt its dimension. Requested storage shall be used, with default SPARSE. zero_dim_univ() shall borrow the singleton included origin generating the universe of the zero-dimensional space until owning-thread finalization. Use/failure prerequisites shall follow 🔗 1. Generator kinds and numerical prerequisites. |
Positive total weight on included points distinguishes an NNC hull from the closed convex hull of closure points alone. |
BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4 |
|
|
|
|
Check empty, direction-only, closure-only and supported systems with independent low-dimensional generated sets. Include a closed segment, an open segment with interior supporting point, a ray and a line through an offset point; distinguish zero-dimensional empty and universal systems. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
class Generator_System; static constexpr Representation Generator_System::default_representation = SPARSE; Generator_System(Representation r = default_representation); explicit Generator_System(const Generator& g, Representation r = default_representation); static const Generator_System& Generator_System::zero_dim_univ(); |
|
|
SW_SPEC
|
16 |
|
|
Parents:
|
|
Copy construction shall preserve generated hull, public dimension and source storage; an explicit-storage overload shall use its argument. Assignment shall copy the source entry value and representation, return the target reference, preserve a distinct source and support self-assignment. Rvalue copy forms shall retain source value without requiring a distinct move operation. Copies shall remain independent of later source modification/destruction. Swaps shall exchange complete system values, dimension and storage, including self-swap. Successful representation conversion shall select dense or sparse storage for all rows while preserving the generated hull and dimension. Destruction shall release owned rows. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Generator kinds and numerical prerequisites. |
An owning generator system may change row storage without changing the geometry or inclusion of its generated boundary. |
|
|
|
|
|
Check empty and all-kind systems across copies/conversions, self/rvalue assignment, return identity, swaps and source destruction, comparing independent geometric tuples and generated-set examples. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
Generator_System(const Generator_System& gs); Generator_System(const Generator_System& gs, Representation r); Generator_System& Generator_System::operator=(const Generator_System& y); Generator_System::~Generator_System(); Representation Generator_System::representation() const; void Generator_System::set_representation(Representation r); void Generator_System::m_swap(Generator_System& y); void swap(Generator_System& x, Generator_System& y); |
|
|
SW_SPEC
|
17 |
|
|
Parents:
|
|
Const-reference insertion shall add a copy of the generator to the system's geometric generator collection, preserving the source and target storage. Result dimension shall be the maximum input dimension; shorter tuples shall be zero-extended. Inserting a closure point shall retain its topological role; any necessary internal conversion shall preserve the public coordinates and kind of existing generators. Duplicates or redundant generators may be reordered/removed provided the generated hull is preserved. Publicly retrieved rows need not reproduce insertion order or multiplicity. Rvalue insertion shall transfer a generator not borrowed from the target, producing the same generated hull as copying it. The source shall remain destructible; no unchanged-value guarantee shall apply to it. Ordinary insertion of a borrowed row from the same target shall use its entry value. Numerical/failure prerequisites in 🔗 1. Generator kinds and numerical prerequisites 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. |
Adding a generator expands a geometric description and can require NNC representation, without conjoining a new constraint. |
|
|
|
|
|
Check mixed dimensions, borrowed-row insertion, duplicate/closure/ray/line insertion and recycled ownership. Verify unchanged copied sources and preserved existing rational coordinates when closure-point insertion promotes a closed system. |
tests/consuminginsertions1.cc; src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
void Generator_System::insert(const Generator& g); void Generator_System::insert(Generator&& g); |
|
|
SW_SPEC
|
18 |
|
|
Parents:
|
|
max_space_dimension() shall report the generator limit and space_dimension() the declared ambient dimension. For admitted dimension n, resizing shall zero-extend new coordinates or discard removed trailing coordinates in every generator. Points/closure points shall retain the corresponding remaining rational coordinates; lines/rays whose directions collapse to zero shall be removed. The resulting generated hull shall have the corresponding coordinate image, including when no supporting point was present. Representation shall be retained. empty() shall report absence of stored generators, not geometric emptiness of a direction-only or closure-only generated hull. clear() shall remove all generators and reset dimension zero while retaining storage. An empty system may be resized to positive ambient dimension. |
Generator coordinate projection drops collapsed directions, while container emptiness remains distinct from the need for a supporting included point. |
|
|
|
|
|
Check positive-dimensional empty systems, every-kind resizing, collapsed directions removed during shrinking, zero-dimensional projections, clear/reuse and direction-only systems that are nonempty containers but generate no points. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
static dimension_type Generator_System::max_space_dimension(); dimension_type Generator_System::space_dimension() const; void Generator_System::set_space_dimension(dimension_type n); bool Generator_System::empty() const; void Generator_System::clear(); |
|
|
SW_SPEC
|
19 |
|
|
|
begin() and end() shall delimit a generator collection with the system's public dimension and the same generated hull. It may suppress a closure point immediately followed by an included point at the same rational coordinates. No public iteration order or duplicate multiplicity shall be promised. Dereference/member access shall borrow a retained generator. Iterator copy/assignment shall preserve borrowed system and position with independent later navigation. Prefix increment shall return the advanced iterator; postfix shall return its entry-position copy. Comparison shall require iterators into the same unchanged system. Defaults shall admit copying, assignment and destruction before valid-position assignment. Modification/destruction shall invalidate iterators and borrowed rows. |
Equivalent included and closure-point companions need not both be exposed, while remaining generators must preserve the same hull. |
|
|
|
|
|
Check empty, mixed and matching-companion ranges, exact rational coordinates and public dimensions. Exercise copied/default-assigned positions, prefix/postfix return semantics and borrowed pointer/reference identity. |
src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc. |
|
|
typedef Generator_System_const_iterator Generator_System::const_iterator; Generator_System::const_iterator Generator_System::begin() const; Generator_System::const_iterator Generator_System::end() const; Generator_System_const_iterator(); Generator_System_const_iterator(const Generator_System_const_iterator& y); Generator_System_const_iterator::~Generator_System_const_iterator(); Generator_System_const_iterator& Generator_System_const_iterator::operator=(const Generator_System_const_iterator& y); const Generator& Generator_System_const_iterator::operator*() const; const Generator* Generator_System_const_iterator::operator->() const; Generator_System_const_iterator& Generator_System_const_iterator::operator++(); Generator_System_const_iterator Generator_System_const_iterator::operator++(int); bool Generator_System_const_iterator::operator==(const Generator_System_const_iterator& y) const; bool Generator_System_const_iterator::operator!=(const Generator_System_const_iterator& y) const; |
||
|
SW_SPEC
|
20 |
|
|
Parents:
|
|
ascii_dump(s) shall export full stored rows, dimension, topology, representation and required row-state fields; ascii_dump() shall use std::cerr. Export shall preserve source value. A complete compatible export with representable coefficients shall load with true, replacing the target with the encoded generated hull, public dimension and encoded storage choice. Malformed/truncated headers or rows, invalid generator fields and inconsistent encoded dimensions or row-state fields shall return false rather than be accepted as valid systems. Trailing input shall remain available. Failure may modify a destination but shall leave it destructible and replaceable by a complete valid load. No rollback/cross-version format stability is promised; allocation and configured 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. |
A generator-system reload must retain supporting-point inclusion and closure data as well as rational coordinate scaling. |
|
|
|
|
|
Round-trip empty positive-dimensional, direction-only, point/closure and all-kind systems across initial destination storage choices. Compare encoded dimensions/storage and independent generated-set examples; reject malformed/truncated rows and inconsistent structural fields. 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/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc. |
|
|
void Generator_System::ascii_dump(std::ostream& s) const; void Generator_System::ascii_dump() const; bool Generator_System::ascii_load(std::istream& s); |