Internal octagonal matrix ownership and row interfaces
OR_Matrix<T> shall own a pseudo-triangular array with a nonnegative space dimension n, exactly 2n physical rows, and row width w(k) = 2(⌊k ⁄ 2⌋ + 1) for 0 ≤ k < 2n. Its stored entries shall be exactly the pairs (k, j) with 0 ≤ j < w(k); their total count shall be 2n(n + 1). Coordinate identity and value shall be independent of spare capacity. Physical access shall require these coordinates; entries outside this pseudo-triangle shall not be supplied by the raw storage interface.
The selected T shall satisfy 🔗 1. Extended-number row meaning and construction states for the element operations actually used, including its arithmetic, initialization, resource and synchronization prerequisites. Admitted dimensions and cursor displacements shall fit the advertised row bound and all selected size, offset, capacity and signed-displacement calculations. Borrowed objects shall require their coefficients to remain alive and unmoved. Only successful operations on valid objects shall reestablish the full matrix value; reported failures shall retain 🔗 20. Incomplete-owner cleanup and mutation failure states.
Octagonal storage needs an exact physical coordinate domain without assigning higher-level closure, diagonal or implicit symmetric-entry semantics to its raw container.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
template <typename T> class OR_Matrix;
Compare independent ragged arrays and actual coordinate addresses through empty, nonempty, copy and dimension-change histories.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Construction with admitted space dimension n shall create the shape of 🔗 1. Pseudo-triangular matrix values and physical coordinates and initialize every stored entry to positive infinity, including every stored diagonal entry. Zero dimension shall create an empty owning matrix with no rows or logical entries. No public default constructor shall be supplied. Destruction shall release the owned storage and each physically live coefficient exactly once. Failed construction shall retain 🔗 20. Incomplete-owner cleanup and mutation failure states.
max_num_rows() shall report an even supported physical row-count bound. For admitted dimensions, twice the dimension shall not exceed that bound, and the corresponding stored count shall fit the supported DB_Row<T> size. The bound shall not guarantee available resources for constructing an object of that size.
Raw octagonal storage begins with unconstrained bounds; geometric owners establish any separate diagonal or closure invariants.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
OR_Matrix(dimension_type n); ~OR_Matrix(); static dimension_type max_num_rows();
Check zero and several positive dimensions, every stored infinity, even row bounds against independent integer size calculations and owned-resource cleanup.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Ordinary copy construction shall create the same space dimension and stored entry values in independently owned coefficients. It shall preserve its source. Mutation or destruction of either completed owner shall not change the other owner. Physical spare capacity need not be copied exactly. An rvalue source shall retain this ordinary copying contract; no distinct move constructor shall be required. Empty matrices shall copy as empty matrices. Failure shall preserve the source and release the incomplete target under 🔗 20. Incomplete-owner cleanup and mutation failure states.
Copying must preserve values and coordinate associations independently of the storage allocation and source value category.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
OR_Matrix(const OR_Matrix& y);
Check ordinary and rvalue copies of empty and populated matrices, all entry addresses, source mutation/destruction, and large exact rational payloads.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Cross-element-type construction shall create an independently owned matrix of the source space dimension. Each physical coordinate shall follow the upward conversion of 🔗 7. Pointwise upward conversion of extended-number rows: finite results shall bound the exact source upward, exactly representable values shall remain exact, and supported extended values shall retain their meanings. The source shall remain unchanged. Empty sources shall produce empty targets. Selected source/target profiles shall admit the conversions and all required intermediates. Failure shall retain 🔗 20. Incomplete-owner cleanup and mutation failure states.
Changing the representation of stored bounds requires directed conversion at every actual pseudo-triangular coordinate.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
template <typename U> explicit OR_Matrix(const OR_Matrix<U>& y);
Use independent GMP ceilings for signed rational-to-integral conversion at every physical coordinate, exact rational conversions, infinities, empty matrices and source preservation.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Successful assignment shall replace the target by the source space dimension and independently owned physical entry values, preserve its source, and return the target wrapper. Self-assignment shall preserve its dimension and values; it need not preserve allocation addresses or spare capacity. Rvalue assignment shall retain the ordinary copying contract. A supported recoverable allocation or coefficient-copy failure while preparing the replacement shall preserve the completed target and source values, release the incomplete replacement, and permit retry. Successful replacement shall invalidate borrows to the replaced storage.
The owned row is replaced before the dimension metadata is committed, so assignment provides a value-preserving preparation failure guarantee.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
OR_Matrix& operator=(const OR_Matrix& y);
Exercise every source/target dimension pair, self- and rvalue assignment, independence, preparation allocation/copy failures and successful retry.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Member and free swap shall exchange the entire owning storage, space dimension and capacity metadata. They shall preserve every entry value and coordinate within its transferred owner without copying, allocating or destroying coefficients. Existing coefficient references and copied row views shall keep referring to the same live coefficients now owned by the other matrix. Self-swap shall preserve the owner. Callers shall associate any retained cursor with the transferred shape and storage rather than reuse it with the other allocation.
Owning-container exchange must transfer shape together with coefficients and distinguish storage identity from wrapper identity.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
void m_swap(OR_Matrix& y); template <typename T> void swap(OR_Matrix<T>& x, OR_Matrix<T>& y);
Check empty/nonempty and unequal dimensions, exact entry addresses, retained value views, self-swap and absence of element copies or allocations.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
space_dimension() shall return the current characteristic parameter n; num_rows() shall return 2n. row_size(k) shall return 2(⌊k ⁄ 2⌋ + 1) whenever its index and result arithmetic are representable. The formula may also be queried for a count-only endpoint without dereferencing it.
Equality shall hold exactly when both matrices have the same space dimension and equal values at every stored coordinate. Inequality shall be its negation. Different dimensions shall compare unequal regardless of their common-prefix entries. Equality shall not modify either input.
Physical row shape and exact entry equality must remain observable without depending on the implementation cache or allocation.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
dimension_type space_dimension() const; dimension_type num_rows() const; static dimension_type row_size(dimension_type k); template <typename T> bool operator==(const OR_Matrix<T>& x, const OR_Matrix<T>& 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. Check every row-width pair and endpoint formula, all small dimension pairs, and an independent change at each stored coordinate.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
A row_reference_type shall be a value view borrowing one physical row of mutable T coefficients. const_row_reference_type shall borrow const coefficients. Copy construction and ordinary assignment shall copy the binding without copying coefficients or allocating. The declared compatible converting constructor shall permit mutable-to- const view construction and its use for compatible assignment. View destruction shall leave the coefficients unchanged.
A default-constructed view shall be unbound and shall require assignment of a valid view before coefficient access. A bound copied view shall remain independent of the cursor cache from which it was obtained, while the borrowed coefficients remain alive and unmoved. Constness of the view wrapper alone shall preserve its selected coefficient type.
A lightweight row value must expose nonowning binding and constness without pretending to own the coefficients or a cursor cache.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
using row_reference_type = Pseudo_Row<T>; using const_row_reference_type = Pseudo_Row<const T>; // The following members apply to the nested Pseudo_Row<U> type. Pseudo_Row(); Pseudo_Row(const Pseudo_Row& y) = default; template <typename V> Pseudo_Row(const Pseudo_Row<V>& y); Pseudo_Row& operator=(const Pseudo_Row& y); ~Pseudo_Row();
Bind default views by assignment; check copy/converting construction and compatible assignment, mutable const-wrapper access, unchanged addresses and use after cursor destruction.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Matrix subscripting at live physical row k shall return a borrowing value view of that row. Subscript j on a bound view shall return the actual coefficient reference at (k, j) and require 0 ≤ j < w(k). Mutable coefficient views shall permit updates through const view wrappers; const coefficient views shall provide read-only references. The operations shall not copy or allocate coefficients, and views shall retain 🔗 8. Borrowing row-view construction, conversion and lifetime.
Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.
Row-value and flat storage access must select the same actual coefficient at every admitted physical coordinate.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
row_reference_type operator[](dimension_type k) &; const_row_reference_type operator[](dimension_type k) const &; // The following member applies to the nested Pseudo_Row<U> type. U& operator[](dimension_type j) const &;
Compare actual references with independent flattened offsets, exercise all mutable cells and verify const-reference types and retained copied views. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc. tests/rowstoragespec1.cc.
A storage-backed row cursor constructed from the first coefficient of a live nonempty matrix shall denote row zero. Count-only construction shall record the supplied row count for comparisons and index/width queries without binding matrix storage; such a cursor shall not be navigated or dereferenced. A count-only matrix endpoint shall have the matrix's current physical row count.
Copy construction and assignment shall reproduce the position and a separate cached row view without coefficient copying or allocation. Compatible mutable-to-const construction and assignment shall be supported. All storage-backed cursors shall retain the single-allocation lifetime and valid-position conditions of 🔗 1. Pseudo-triangular matrix values and physical coordinates.
Borrowing iterator constructors shall reject temporary backing owners. Copying temporary iterator values shall remain admitted when their backing storage remains alive.
An endpoint carrying only an index and a cursor carrying live storage have different admissible operations.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
// Members apply to the nested any_row_iterator<U> type. any_row_iterator(dimension_type n_rows); explicit any_row_iterator(U& base); template <typename V> any_row_iterator(const any_row_iterator<V>& y); template <typename V> any_row_iterator& operator=(const any_row_iterator<V>& y);
Check explicit storage binding, zero/nonzero count-only queries, ordinary copies/assignments and mutable-to-const copies/assignments at every live and end position. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc. tests/rowstoragespec1.cc.
Row-cursor aliases shall retain the declared types below. The category shall support the library's member-operation dispatch; these declarations shall not promise the complete standard-library iterator requirements. In particular, std::reverse_iterator shall not be an admitted adapter for this cached-reference cursor.
At a live position, dereference and arrow shall borrow the cached row view inside that cursor. The returned reference/pointer shall require that cursor to remain alive and unchanged. Copying the view by value shall create an independent borrowing value under 🔗 8. Borrowing row-view construction, conversion and lifetime, including a copy made within the full expression of a temporary cursor. Cursor index() shall return its row index; row_size() shall return the width formula for that index. Endpoints shall support these queries without coefficient access.
Cached row references have the cursor lifetime, while copied row values have only the underlying coefficient lifetime.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
// Aliases and members apply to any_row_iterator<U>. using iterator_category = std::random_access_iterator_tag; using value_type = Pseudo_Row<U>; using difference_type = long; using pointer = const Pseudo_Row<U>*; using reference = const Pseudo_Row<U>&; reference operator*() const; pointer operator->() const; dimension_type index() const; dimension_type row_size() const;
Check exact alias/reference types, arrow/dereference cache identity, independent cursor caches, copied values retained after cursor movement/destruction and endpoint queries.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
For storage-backed cursors, increment and decrement shall change the row index by exactly one and bind the corresponding physical row or past-the-end position. Navigation shall stay in the same matrix's closed begin/end position interval. Prefix shall return the updated cursor by reference; postfix shall return an independent copy of the old cursor. Returned old live positions shall remain usable while their coefficients remain live and unmoved. Past-the-end shall not be dereferenced. Both even/odd row-width transitions shall retain exact coordinate associations.
Pseudo-triangular row widths change in pairs, so stepping must preserve both cursor position and old postfix cache bindings.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
// Members apply to any_row_iterator<U>. any_row_iterator& operator++(); any_row_iterator operator++(int); any_row_iterator& operator--(); any_row_iterator operator--(int);
Traverse every row in both directions for mutable/const cursors, check prefix identity and old postfix views, and compare all entries with an independent ragged array.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
For a storage-backed cursor at row index k, admitted offset m shall produce index k + m in the same matrix's closed begin/end interval. Signed addition/subtraction and the declared unsigned addition overloads shall agree on common nonnegative offsets. Compound updates shall return the modified cursor; value-returning operations shall preserve their source. Selected signed displacement calculations, including negation, shall be representable.
Indexed cursor access shall require the offset position to be a live row and return that row's borrowing view by value. This value shall remain independent of the source cursor's cached view and lifetime, subject to the coefficient lifetime conditions.
Random row displacement must use physical row offsets correctly for both signed directions and width-parity transitions.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
// Members apply to any_row_iterator<U>. any_row_iterator& operator+=(difference_type m); template <typename Unsigned> requires (static_cast<Unsigned>(-1) > 0) any_row_iterator& operator+=(Unsigned m); any_row_iterator& operator-=(difference_type m); any_row_iterator operator+(difference_type m) const; template <typename Unsigned> requires (static_cast<Unsigned>(-1) > 0) any_row_iterator operator+(Unsigned m) const; any_row_iterator operator-(difference_type m) const; value_type operator[](difference_type m) const;
Check every pair of source/destination positions for small dimensions, signed negative/positive/zero and unsigned offsets, indexed value lifetime and source preservation.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Comparison and difference shall require positions of the same live matrix, using compatible const conversion where required by the declared member signatures. The six comparisons shall have exactly the ordering of the row indices. Cursor difference shall return the mathematical signed difference of the two indices when representable in difference_type. Empty count-only begin/end positions may be compared and subtracted without navigating or dereferencing them. No coefficient value shall affect these results.
Row positions need the same exact order and signed distance independently of coefficients and proxy-cache addresses.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
// Members apply to any_row_iterator<U>. difference_type operator-(const any_row_iterator& y) const; bool operator==(const any_row_iterator& y) const; bool operator!=(const any_row_iterator& y) const; bool operator<(const any_row_iterator& y) const; bool operator<=(const any_row_iterator& y) const; bool operator>(const any_row_iterator& y) const; bool operator>=(const any_row_iterator& y) const;
Compare all ordered pairs including endpoints against independent integer indices, both difference signs, identical positions and empty ranges.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
For a nonempty matrix, row begin/end shall return storage-backed cursors at indices zero and num_rows(). They shall delimit exactly the live physical rows and permit supported forward/backward member navigation. For an empty matrix, both shall return equal count-only endpoints of index zero; they shall not be navigated or dereferenced. Const overloads shall return read-only coefficient cursors. Shape changes shall require obtaining new endpoints before traversing the new shape; coefficient borrows shall retain their own lifetime rules.
Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.
Empty row ranges must avoid manufacturing references to nonexistent storage, while nonempty ends must support reverse member traversal.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
row_iterator row_begin() &; row_iterator row_end() &; const_row_iterator row_begin() const &; const_row_iterator row_end() const &;
Check mutable/const begin/end for all small dimensions, exact row count/widths, reverse traversal from nonempty ends and fresh ranges after clear and resizing. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc. tests/rowstoragespec1.cc.
Element begin/end shall delimit exactly the live stored coefficients in increasing physical row order and increasing column order within each row. Mutable and const overloads shall retain the corresponding DB_Row<T> pointer-iterator contracts of 🔗 5. Row sizes, supported limits, coefficient ranges and equality and 🔗 1. Pointer-adapter types and borrowed storage. A zero-dimensional matrix shall have an empty valid element range. For every live coordinate, the flat coefficient reference shall be identical to matrix/row-view subscripting at that coordinate. Shape/owner changes shall retain the actual coefficient lifetime and invalidation rules.
Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.
Flat numeric algorithms and row-based algorithms must visit exactly the same physical entries in a shared deterministic order.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
using element_iterator = DB_Row<T>::iterator; using const_element_iterator = DB_Row<T>::const_iterator; element_iterator element_begin() &; element_iterator element_end() &; const_element_iterator element_begin() const &; const_element_iterator element_end() const &;
Compare flattened values and actual addresses with independent ragged-prefix offsets, mutate through both access forms, and check empty/const ranges. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc. tests/rowstoragespec1.cc.
grow(new_dim) shall require an admitted dimension no smaller than the current dimension. On success it shall produce the new shape, preserve every old stored coordinate exactly and initialize every newly introduced coordinate to positive infinity. Growth to the current dimension shall preserve the values and existing coefficient objects. Successful growth may replace storage; retained views shall be usable only while their actual coefficients remain alive and unmoved. Reported failure shall retain 🔗 20. Incomplete-owner cleanup and mutation failure states.
Adding octagonal dimensions extends the pseudo-triangle as a physical prefix and must not change earlier coordinate values.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
void grow(dimension_type new_dim);
Compare independent ragged-array histories across fresh and retained capacity, repeated equal dimensions, zero starts and several reallocations.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
shrink(new_dim) shall require an admitted dimension no greater than the current dimension. It shall preserve exactly the physical prefix of rows belonging to the new shape, destroy removed logical coefficients, and set the new dimension. Removed values shall not reappear after later successful growth. Equal-dimension shrinkage shall preserve the existing values and coefficient objects.
clear() shall release the old owned storage and replace the matrix by a valid zero-dimensional owning matrix. It shall be safe on an already empty matrix and permit subsequent construction by growth or assignment. Clearing shall invalidate old coefficient borrows.
Removing dimensions must discard their values and lifetimes while preserving the retained physical prefix and reusable empty state.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
void shrink(dimension_type new_dim); void clear();
Check every smaller dimension, retained addresses and values, element destruction counts, repeated clear and regrowth with new infinities.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
resize_no_copy(new_dim) shall accept every admitted dimension. On success it shall establish the corresponding valid shape. Shrinking shall retain the prefix behavior of 🔗 18. Dimension shrinkage and complete clearing. Equal- dimension calls shall preserve the existing coefficient objects and values. Growing shall initialize all newly introduced coordinates to positive infinity; no old-prefix value preservation shall be required by this interface. A client needing that preservation shall use 🔗 17. Value-preserving dimension growth. Failure shall retain 🔗 20. Incomplete-owner cleanup and mutation failure states.
Rebuilding storage may avoid copying old bounds, while newly introduced coordinates and the resulting physical shape still require definite values.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
void resize_no_copy(dimension_type new_dim);
Exercise shrink, equal-size, in-capacity growth and replacement growth; check shape/new infinities and refill old entries before later value comparisons.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.
Failed sized/copy/upward construction shall release storage and destroy every completed coefficient of the incomplete matrix, preserving any source owner. Assignment preparation failure shall retain the stronger value-preserving guarantee of 🔗 5. Value assignment and assignment failure preservation.
A reported recoverable failure during growth or discarding resize may leave a partially extended or partially transferred target without a coherent full matrix shape. Its completed coefficients and owned storage shall remain safely destructible and replaceable by a complete successful assignment or clearing operation. No ordinary matrix access or traversal shall be required before such replacement. A failure before mutation, including failure to allocate replacement backing storage, shall preserve the old completed value. Resources owned by a discarded incomplete replacement shall be released.
These guarantees shall require selected element operations to retain their own documented exceptional states and nonthrowing destruction. They shall not require recovery from fatal GMP allocation failure or caller-precondition violations, or classify reported failure as a successful numerical value.
Raw single-row ownership supports safe cleanup after partial coefficient construction without implying value rollback for every resizing path.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; member signatures apply to OR_Matrix<T> unless an indicated nested type or free function owns the declaration. Nested aliases retain their source-declared dependent types.
OR_Matrix(dimension_type n); OR_Matrix(const OR_Matrix& y); template <typename U> explicit OR_Matrix(const OR_Matrix<U>& y); OR_Matrix& operator=(const OR_Matrix& y); void grow(dimension_type n); void resize_no_copy(dimension_type n); ~OR_Matrix();
Inject backing allocation, infinity construction, copy and assignment failures; count completed objects/resources, preserve sources, retry assignment and replace partially extended objects before ordinary access.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; tests/ormatrixspec1.cc; tests/ormatrixiteratorhistories1.cc.