Internal octagonal matrix records, diagnostics and entry distances
For a valid matrix of admitted finite or positive-infinite coefficients, ascii_dump shall emit its space dimension, a space and a newline, followed by each physical row in 🔗 1. Pseudo-triangular matrix values and physical coordinates order. Each row shall contain its coefficient values in increasing column order, with a space after each coefficient and a newline after the row. A zero-dimensional record shall contain only the dimension line. Coefficient output shall retain 🔗 5. Mathematical numeric output and stream delivery status and 🔗 6. Checked numeric stream policy integration for the selected profile; finite native values shall retain their exact mathematical value independently of caller precision. These records shall not promise preservation of native zero signs or object representations.
The matrix shall remain unchanged. Dumping shall not consume following stream data or promise a checksum, a trailing delimiter beyond its own frame, or an interchange guarantee across incompatible scalar profiles. The no-argument form shall write the same record to std::cerr. Stream failures shall retain the stream's selected reporting mechanism.
Persistent raw entry values need a complete dimensioned frame and exact mathematical scalar meaning, distinct from ABI-dependent scalar object dumps.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
void ascii_dump(std::ostream& s) const; void ascii_dump() const;
Compare independent exact record text, concatenate empty/nonempty records and a following token, test rational/infinite and low-precision native-boundary round-trips, and capture the convenience output.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
The decoded space dimension shall not exceed max_num_rows()/2. ascii_load shall return false for a greater dimension before resizing, computing its storage size or requesting storage for that extent. For a valid admitted record under 🔗 1. Pseudo-triangular matrix values and physical coordinates, it shall read exactly the physical row-major coefficient count required by its shape. It shall return true only after every coefficient has been accepted exactly by the selected scalar profile and every stored value is finite or positive infinity. True shall establish the specified dimension and values in independently owned coefficients and leave any following frame token available after permitted separating whitespace.
The packed matrix shall be allocated after its coefficient payload has been read. Missing, nonnumeric or negative-signed dimension tokens, truncated or invalid coefficient tokens, negative infinity, NaN and non-exact scalar conversion shall return false through the scalar input's ordinary rejection channel. A rejected or exceptional load may leave a partial target without useful entry values or a coherent old/new dimension promise. Its completed objects shall remain safely destructible, and it may be replaced by a complete successful load or assignment before ordinary value access. Resource/stream exceptions shall retain their selected reporting channel; they shall not be true results. No strong rollback guarantee shall be required. Admitted extents shall retain their normal resource requirements and resource-exception behavior.
Dimension admission must precede unsigned storage-size arithmetic. The admitted row bound ensures representable doubled row counts and triangular storage. Exact scalar acceptance and completion determine a successful raw-bound record result.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
bool ascii_load(std::istream& s);
Reject the first unsupported space dimension and the reserved non-dimension before payload extraction; check zero and small admitted dimensions, exact replacement after rejection and following-token preservation. Check every incomplete/forbidden payload position, missing headers, inexact integral/native tokens, valid exact fractional and positive-infinite records, following-token preservation, owner independence and replacement after rejection.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
The stream insertion operator shall write every stored row in physical order, each coefficient followed by a space and each row followed by a newline, and return the supplied stream. It shall omit the space- dimension header used by 🔗 1. Pseudo-triangular mathematical-value records. An empty matrix shall write no row text. Coefficient output shall retain the selected scalar's mathematical output contract. print() shall write that same human- readable representation to std::cerr. Both forms shall preserve the matrix, and stream failure shall follow the selected stream policy.
Human-readable rows and machine reloadable records need distinct framing while sharing scalar output meaning.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
template <typename T> std::ostream& operator<<(std::ostream& s, const OR_Matrix<T>& m); void print() const;
Compare exact independent row text, empty output and stream identity; capture print output and inject stream failure without changing matrix values.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
external_memory_in_bytes() shall report the bytes owned outside the matrix wrapper: the backing row allocation, including its retained capacity and metadata, plus externally owned payload of every physically live coefficient under 🔗 8. Row storage and live-payload memory accounting. It shall not count borrowed views or unrelated allocations. Removing logical entries shall not remove still-retained backing capacity from that count. total_memory_in_bytes() shall equal the external count plus sizeof(*this). Counts shall require supported representable memory arithmetic and the selected coefficient type's own accounting contract.
The owner retains the actual row capacity, so its reported owned memory must account for that allocation even when logical dimensions shrink.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
memory_size_type external_memory_in_bytes() const; memory_size_type total_memory_in_bytes() const;
Compare backing metadata/capacity and live coefficient payloads against independent allocation/accounting witnesses for tight and spare-capacity owners, copies, shrinkage, empty states and multi-limb values.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
For an otherwise safely inspectable owner, OK() shall accept exactly when its live logical coefficient count matches 2n(n + 1) for its recorded space dimension and its owned DB_Row<T> satisfies 🔗 9. Constructed-row validity checks and diagnostic metadata with the recorded logical size and capacity. This includes each selected coefficient's OK() hook and rejection of NaN. Available extra-debug checks shall retain their configuration scope. A valid empty matrix shall pass.
This checker shall not establish octagonal strong closure, consistency, coherent mirrored constraints or semantic diagonal conventions, and shall not substitute for higher-level finite/positive-infinite operation domains. Callers shall not pass corrupted ownership metadata or read beyond live storage merely to obtain a diagnostic. The checker shall preserve entry values and ownership.
Raw storage validity and higher-level octagonal geometric invariants have different meanings and admissible checks.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
bool OK() const;
Check constructed and transformed valid matrices, permitted extended values, selected false coefficient hooks and NaN at every actual physical coordinate, restoring values before ordinary matrix access.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
With the conditions of 🔗 9. Distance workspace protocol and admissible overlaps, rectilinear distance shall return false on unequal space dimensions without modifying result or workspaces. For equal dimensions it shall return true and assign the requested directed approximation of ∑(k, j) ∈ Dndkj, where Dn is exactly the physical coordinate domain of 🔗 1. Pseudo-triangular matrix values and physical coordinates and each finite dkj is the absolute difference of the entry values on call entry. Equal positive infinities shall contribute zero; exactly one positive infinity at any stored coordinate shall make the distance positive infinity. Empty equal-dimensional matrices shall have distance zero.
Accumulation and result conversion shall retain the selected profile's rounding guarantees: successful upward bounds shall be no smaller than the exact sum and downward bounds no larger. Source entries shall be preserved except where the admitted result output overlaps an entry. Reported numerical/resource failures shall not be true results.
A physical bound-entry norm counts each stored coordinate once; it is not a distance between represented octagonal geometric sets.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
template <typename Temp, typename To, typename T> bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r, const OR_Matrix<T>& x, const OR_Matrix<T>& y, Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);
Use independent rational sums with differences at every stored coordinate, all shared/one-sided infinity cases, empty/dimension mismatch, symmetry and supported result overlaps.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
With the conditions of 🔗 9. Distance workspace protocol and admissible overlaps, Euclidean distance shall return false on unequal space dimensions without modifying result or workspaces. For equal dimensions it shall return true and assign the requested directed approximation of √(∑(k, j) ∈ Dnd 2kj), using exactly the physical coordinate domain of 🔗 1. Pseudo-triangular matrix values and physical coordinates and finite absolute entry differences on call entry. Equal positive infinities shall contribute zero; exactly one positive infinity at any stored coordinate shall make the distance positive infinity. Empty equal-dimensional matrices shall have distance zero.
Accumulation, square root and result conversion shall retain the selected profile's directed enclosure guarantees. Rational square-root bounds shall retain 🔗 2. Finite rational square root at the selected irrational precision and the context precision of 🔗 3. Selection and ownership of irrational rational precision, without promising every rational perfect square is exact on the selected grid. Source entries shall be preserved except where the admitted result output overlaps an entry. Reported failures shall not be true results.
The entry-array Euclidean norm needs both a fixed physical coordinate count and the selected square-root enclosure semantics.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
template <typename Temp, typename To, typename T> bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r, const OR_Matrix<T>& x, const OR_Matrix<T>& y, Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);
Compare literal Pythagorean families at all stored coordinates with independently calculated rational-grid bounds, integer/native sqrt(2) enclosures, infinity/empty/dimension cases and supported result overlaps.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
With the conditions of 🔗 9. Distance workspace protocol and admissible overlaps, maximum-coordinate distance shall return false on unequal space dimensions without changing result or workspaces. For equal dimensions it shall return true and assign the requested directed approximation of max(k, j) ∈ Dndkj, using exactly the physical coordinate domain of 🔗 1. Pseudo-triangular matrix values and physical coordinates and finite absolute entry differences on call entry. Equal positive infinities shall contribute zero; exactly one positive infinity at any stored coordinate shall make the distance positive infinity. Empty equal-dimensional matrices shall have distance zero.
Coordinate difference, maximum and result conversion shall retain the selected profile's directed guarantees. Source entries shall be preserved except where the admitted result output overlaps an entry. Reported numerical/resource failures shall not be true results.
A maximum over physical bound entries must visit every stored row and column without introducing unstored symmetric coordinates.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
template <typename Temp, typename To, typename T> bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r, const OR_Matrix<T>& x, const OR_Matrix<T>& y, Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);
Compare independent coordinate maxima with differences at every stored coordinate, symmetry, all infinity cases, empty/dimension mismatch and admitted result overlaps.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
Distance operations shall require valid matrices of admitted finite or positive-infinite entries, supported rounding directions and temporary/ result profiles supporting every required conversion, subtraction, accumulation, square-root or maximum operation. Negative infinity and NaN shall remain outside these metric domains. Every intermediate shall satisfy the selected arithmetic, precision and resource prerequisites. Initialization and synchronization shall retain 🔗 3. Thread initialization, default state and finalization where required.
The three mutable workspaces shall be pairwise distinct and independent of matrix coefficients; their values may be overwritten. The result may be independent, overlap one workspace when types permit, or overlap one live input entry while all workspaces remain independent. Results shall use input values on entry. Identical matrix owners may be passed as both inputs. Dimension mismatch shall precede any result/workspace update. Other failures shall retain the selected numerical policy's permitted output states without a universal rollback guarantee. The generic helper shall apply these conditions with the library's rectilinear, Euclidean or maximum-coordinate specialization for the same temporary type.
Exact input-value and scratch alias rules are necessary for sound results when callers supply reusable workspaces.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
template <typename Specialization, typename Temp, typename To, typename T> bool l_m_distance_assign(Checked_Number<To, Extended_Number_Policy>& r, const OR_Matrix<T>& x, const OR_Matrix<T>& y, Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);
Exercise result overlap with each workspace and source entries, identical owners, unchanged result/workspaces on dimension mismatch and supported exact/native temporary profiles.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.
For every dimension_type input x, isqrt shall return the nonnegative integer r satisfying r2 ≤ x < (r + 1)2. The inequalities describe mathematical integers and shall not require overflowing machine multiplication to check their meaning. The helper shall not allocate or require numerical-library initialization. Its result shall be valid for the actual radicand used in the row-bound calculation of 🔗 2. Sized construction, destruction and the supported row bound.
The capacity helper needs an exact integer floor characterization across its input type and actual production caller domain.
Internal source header: OR_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library; unqualified members apply to OR_Matrix<T>. The stream insertion operator belongs to its IO_Operators namespace.
dimension_type isqrt(dimension_type x);
Use independent division or arbitrary-precision inequalities across zero, every small radicand, perfect-square neighbors, all binary boundaries, the full input-type range and actual row-capacity radicands.
src/OR_Matrix_defs.hh; src/OR_Matrix_inlines.hh; src/OR_Matrix_templates.hh; src/distances_defs.hh; src/distances_inlines.hh; tests/ormatrixoperationsspec1.cc; tests/ormatrixiteratorhistories1.cc; tests/rawmatrixmetricshistories1.cc.