Borrowed affine-expression views
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Incoming link from:
2. Expression-view coefficients, iterators and independent row export
1 |
Expression_Adapter<T> shall borrow a const reference to its raw_type. Construction from a temporary raw owner shall be rejected by deleted rvalue overloads, including the transparent and hiding adapters. Copies and temporary adapter values may query their still-live lvalue raw owner. The raw expression shall outlive the adapter and every borrowed iterator or coefficient reference. Copying an adapter shall retain that binding; destroying it shall not destroy or modify the raw expression. Changes to the live raw expression shall be visible on subsequent queries; previously obtained references and iterators retain the raw type's invalidation rules. inner() shall return the one-level T::const_reference view of the same raw expression. representation() shall report the raw representation. Expression_Adapter_Transparent<T> shall add no transformation to T's view. Construction and copying shall not copy coefficient storage. |
Borrowed descriptor views must not be confused with independent expression values. |
|
|
|
|
|
Check rejection of temporary raw owners and admission of temporary views; check binding and one-level type/reference identities, copies and destruction; mutate coefficients, dimension and representation between queries without retaining invalidated positions. Confirm independent exported values remain unchanged. |
src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc. |
|
|
The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation. template <typename T> class Expression_Adapter; template <typename T> class Expression_Adapter_Transparent; template <typename T> class Expression_Hide_Inhomo; template <typename T> class Expression_Hide_Last; // On Expression_Adapter<T>: inner_type inner() const; Representation representation() const; // Public adapter constructors: explicit Expression_Adapter_Transparent(const raw_type&); explicit Expression_Hide_Inhomo(const raw_type&); Expression_Hide_Last(const raw_type&, bool hide_last); // The corresponding const raw_type&& constructors are deleted. |
||
|
SW_SPEC
|
2 |
|
|
|
For a view with visible dimension d and visible coefficient vector a = (a0, …, ad), inhomogeneous_term() and get(0) shall return a0; get(i) for 1 ≤ i ≤ d shall return ai. coefficient(Variable(k)) and get(Variable(k)) shall return ak + 1 for 0 ≤ k < d. These are borrowed const accesses. The transformations defining a and d are specified in 🔗 4. Expression view with a hidden inhomogeneous coefficient and 🔗 5. Expression view with an optional hidden final coordinate; a transparent view shall retain its inner view's coefficients and dimension. begin()/end() shall delimit the nonzero homogeneous coefficients in increasing variable order, excluding the constant and every hidden last coordinate. lower_bound(v) shall select the first such variable at least v, or end(); a one-past-visible-dimension variable is admitted. Mutations shall follow 🔗 1. Borrowed expression-view construction and one-level access. Each get_row(r) shall replace the dense or sparse output with an independent copy of all d + 1 visible coefficients, including zero slots. Altering that output shall not alter the raw expression, and later raw mutations shall not alter the output copy. |
All consumers of a descriptor view need the same visible coefficient vector, including iterators and materialized copies. |
|
|
|
|
|
Compare all slots, ordered nonzero iteration and every lower bound with literal vectors in both representations, including constants, trailing zeros and a hidden nonzero final slot. Overwrite prepopulated rows of different sizes and mutate each copy independently. |
src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc. |
|
|
The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation. dimension_type space_dimension() const; Coefficient_traits::const_reference inhomogeneous_term() const; Coefficient_traits::const_reference coefficient(Variable) const; Coefficient_traits::const_reference get(dimension_type) const; Coefficient_traits::const_reference get(Variable) const; const_iterator begin() const; const_iterator end() const; const_iterator lower_bound(Variable) const; void get_row(Dense_Row&) const; void get_row(Sparse_Row&) const; |
||
|
SW_SPEC
|
3 |
|
|
|
With the vector and dimension in 🔗 2. Expression-view coefficients, iterators and independent row export, is_zero() shall hold exactly when every visible coefficient is zero; all_homogeneous_terms_are_zero() shall ignore a0. For 0 ≤ s ≤ e ≤ d + 1, range queries shall use the half-open raw-slot range [s, e): all_zeroes shall test every slot; num_zeroes shall count zero slots; gcd shall return their nonnegative greatest common divisor, with zero for an empty or all-zero range. first_nonzero(s,e) and last_nonzero(s,e) shall return the least/greatest nonzero slot or e if none exists. No-argument last_nonzero() shall return the greatest nonzero slot, or zero if no such slot exists. all_zeroes(vars) shall test only the selected variable coefficients; all_zeroes_except(vars,s,e) shall test the range after excluding those variables, with slot zero never excluded by a variable set. has_a_free_dimension_helper(indices) shall remove precisely the selected raw slots whose visible coefficients are nonzero, inserting no new indices. Variable sets and raw indices shall be within the visible dimension. Full is_equal_to(y) shall require equal dimensions and equal visible coefficients. Range equality shall compare the selected slots; scaled equality shall test c1ai = c2bi for every selected slot. Both operands shall admit the selected range; an operand passed to an overload requiring conversion to raw_type shall support that conversion. Scaled products shall satisfy the configured coefficient arithmetic's representability preconditions. The coefficient prerequisites in 🔗 1. Affine value, numerical prerequisites and shared zero shall apply, including representability of the nonnegative gcd and of each scaled product when required by the configured arithmetic. Underlying numerical exceptions shall propagate without modifying the borrowed expression. Empty-range equality shall hold. have_a_common_variable(y,first,last) shall hold exactly when some variable in the valid half-open variable range has nonzero coefficients in both operands; constants shall be irrelevant. |
Raw coefficient slots and variable identifiers have distinct meanings, and empty-range sentinels must remain consistent under adaptation. |
|
|
|
|
|
Use independent small integer vectors to enumerate every valid subrange, zero mask, support search and selected-index filter. Check equal and unequal dimensions, constants and scaled operands of both signs, zero multipliers, common-variable boundaries and both representations without coefficient overflow. |
src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc. |
|
|
The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation. bool is_zero() const; bool all_homogeneous_terms_are_zero() const; bool all_zeroes(const Variables_Set&) const; bool all_zeroes(dimension_type start, dimension_type end) const; dimension_type num_zeroes(dimension_type start, dimension_type end) const; Coefficient gcd(dimension_type start, dimension_type end) const; dimension_type last_nonzero() const; dimension_type last_nonzero(dimension_type first, dimension_type last) const; dimension_type first_nonzero(dimension_type first, dimension_type last) const; bool all_zeroes_except(const Variables_Set&, dimension_type, dimension_type) const; void has_a_free_dimension_helper(std::set<dimension_type>&) const; template <typename E> bool is_equal_to(const E&) const; template <typename E> bool is_equal_to(const E&, dimension_type start, dimension_type end) const; template <typename E> bool is_equal_to(const E&, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2, dimension_type start, dimension_type end) const; template <typename E> bool have_a_common_variable(const E&, Variable first, Variable last) const; |
||
|
SW_SPEC
|
4 |
|
|
Incoming link from:
2. Expression-view coefficients, iterators and independent row export
1 |
Expression_Hide_Inhomo<T> shall preserve its inner view's dimension and homogeneous coefficients and expose zero as the inhomogeneous coefficient, even when the raw constant is nonzero. All queries and row exports in 🔗 2. Expression-view coefficients, iterators and independent row export and 🔗 3. Expression-view predicates, coefficient ranges and support filtering shall use this transformed vector. Hiding the constant shall neither alter it in the raw expression nor hide any homogeneous coefficient. In a composition, the transformation shall apply to the one-level inner view, retaining the same borrowed raw object. |
Geometric generator numerators must omit divisors or other raw constant metadata from their affine expression views. |
|
|
|
|
|
Check constant-only, zero and mixed expressions, hidden nonzero constants, every range including or excluding slot zero, scaled comparison with nonzero other constants, selected index zero, exported rows and compositions with hidden-last views. Include live raw mutations. |
src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc. |
|
|
The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation. template <typename T> class Expression_Hide_Inhomo; |
||
|
SW_SPEC
|
5 |
|
|
Incoming link from:
2. Expression-view coefficients, iterators and independent row export
1 |
Expression_Hide_Last<T>(raw,false) shall preserve its inner view. With hide_last == true, the inner dimension shall remain positive for every operation, and the view shall expose dimension one less, omitting exactly the inner view's final homogeneous coefficient. The constant and preceding coefficients shall remain unchanged. All queries and row exports in 🔗 2. Expression-view coefficients, iterators and independent row export and 🔗 3. Expression-view predicates, coefficient ranges and support filtering shall use this prefix. The stored hiding choice shall remain fixed; the currently hidden coordinate shall follow the inner view's current dimension after a valid raw resize. compare(x,y) for two matching hidden-last adapter types shall compare their homogeneous coefficient sequences lexicographically in increasing variable order, treating missing trailing coefficients as zero. It shall return − 2, zero or 2 according to the first unequal coefficient. Constants, hidden coefficients and trailing zero dimensions shall not affect this comparison. It shall neither mutate its operands nor compare affine constants. |
Strictness and generator metadata occupy a raw final slot that must not become a public coordinate; homogeneous ordering is distinct from affine equality. |
|
|
|
|
|
Compare hidden and transparent prefixes against literal vectors, including a single raw variable, zero visible support, nonzero hidden coefficients, growth and shrinkage. Check lexicographic signs for mismatched leading supports, unequal matching coefficients, unequal dimensions and ignored constants, in both representations. |
src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc. |
|
|
The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation. template <typename T> class Expression_Hide_Last; template <typename T> int compare(const Expression_Hide_Last<T>&, const Expression_Hide_Last<T>&); |