C++ interval linear forms
- PPL-LLR-000084 Conservative arithmetic on interval linear forms (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000438 Thread entry and shared-facility use (Specifies)
For a selected interval type C, a live Linear_Form<C> of dimension d, with coefficient intervals Ai and constant interval B, shall represent the interval-affine expression B + ∑d − 1i = 0Aixi. At each real valuation x, it shall denote the set of sums obtained by choosing each coefficient and the constant independently from their intervals. Repeated use of an interval object shall not establish correlations between those choices. The constant shall occupy no variable coordinate. The declared dimension shall retain trailing zero coefficients.
C shall provide the interval construction, copying, predicates and arithmetic required by the selected operation. Stored values shall satisfy its initialization, canonical-value and metadata prerequisites. Each successful arithmetic operation shall retain the interval operations' enclosure guarantees and selected numerical-profile conditions; no common optimality or finite-bound guarantee shall be inferred. Native floating-point arithmetic shall require the selected supported boundary format and its rounding-state prerequisites. Storage access shall add no numerical rounding requirement. Shared-facility initialization shall be required where the selected coefficient operation, expression conversion or output formatter requires it; unrelated storage shall add no initialization owner.
Callers shall synchronize access against overlapping modification and obey shared-temporary restrictions in the selected configuration. Allocation and coefficient exceptions may propagate. Failed construction shall release resources owned by the incomplete form. Unchanged operands shall remain unchanged; modified destinations shall remain destructible, with no universal rollback guarantee.
Independent interval choices distinguish interval algebra from symbolic cancellation and make the numerical assumptions of every operation explicit.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> class Linear_Form;
Derive affine values with independent rational coefficient/valuation choices; check zero dimensions, trailing zeros, uncertain signs, native enclosures and source preservation. Inspect partial-construction cleanup and selected scalar/runtime prerequisites.
Mine04 | Whole work (background on floating-point expressions modeled by interval linear forms).
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Default construction shall produce dimension zero and the singleton-zero constant. Construction from an initialized interval n shall produce dimension zero and an independent copy of that interval as the constant. Both forms shall report zero coefficients at every valid queried variable. The constant constructor shall preserve empty, bounded, open, singleton and unbounded values admitted by C.
Constants and ambient dimensions are separate; default construction creates a usable zero rather than an uninitialized interval.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
Linear_Form(); explicit Linear_Form(const C& n);
Check literal zero/constant intervals, dimension zero, out-of-dimension zero queries, source mutation after construction and admitted open/empty/unbounded constants.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Construction from Variable v shall produce dimension v.space_dimension(), singleton coefficient one at v.id(), singleton zero at every other coordinate and a singleton-zero constant. The explicitly selected interval-type overload for v-w shall produce dimension max(v.space_dimension(), w.space_dimension()). Distinct variables shall have singleton coefficients one and minus one, respectively; equal variables shall produce all singleton-zero coefficients while retaining that dimension. The selected interval representation shall enclose the signed unit values even when its boundary type is unsigned.
A variable dimension exceeding max_space_dimension() shall cause std::length_error before a coefficient vector of that dimension is constructed.
Dimensioned variable forms provide the basis for building affine expressions without losing high zero coordinates after exact cancellation.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
Linear_Form(Variable v); template <typename C> Linear_Form<C> operator-(Variable v, Variable w);
Check equal/different/high variable indices, literal signed-unit coefficients, every remaining zero coordinate, unsigned-boundary enclosure, rejected dimensions and subsequent successful small construction.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Construction from Linear_Expression e shall preserve its declared dimension and enclose each integer coefficient and constant in the corresponding interval of C. Exactly representable integer values shall be singleton intervals; other supported conversions shall retain their coefficient-conversion enclosure guarantees. Source representation shall not alter the mathematical result, and the source shall remain unchanged. A source dimension greater than max_space_dimension() shall cause std::length_error. Reading e shall retain its configured coefficient profile and initialization prerequisites.
Integral expressions enter interval analysis through explicit coefficient conversion while retaining their ambient coordinates.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
Linear_Form(const Linear_Expression& e);
Convert independent literal integer vectors from dense/sparse expressions, zero/trailing dimensions and values above exact native precision; check enclosures, source preservation and oversized sparse-source rejection.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
- PPL-LLR-000084 Conservative arithmetic on interval linear forms (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
Copy construction and copy assignment shall preserve the dimension and all coefficient intervals, including their admitted endpoint metadata. Copies shall own independent coefficient storage. Subsequent mutation or destruction of one form shall not change the other. Assignment shall return the destination reference, including same-object assignment, which shall preserve its value and dimension. Destruction shall release the form's owned vector and constructed coefficient objects. Copying shall not promise to preserve allocation capacity or introduce a move interface beyond the declared C++ operations.
Independent owned values allow snapshots to survive further interval algebra and owner destruction.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
Linear_Form(const Linear_Form& source); Linear_Form& operator=(const Linear_Form& source); ~Linear_Form();
Check copy/assignment/self-assignment and independent mutation across distinct dimensions, large rational endpoints, source destruction and open/empty intervals; inspect cleanup through failed vector/coefficient construction.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Coefficient accessors shall require an lvalue receiver, with the corresponding const && overloads deleted. References shall not outlive the owning form.
max_space_dimension() shall report the maximum ambient dimension admitted by the form's coefficient-vector representation. This limit shall not promise that allocating every admitted dimension will succeed. space_dimension() shall return the declared ambient dimension. inhomogeneous_term() shall return a const reference to the owned constant. For a valid variable inside that dimension, coefficient(v) shall return a const reference to its owned coefficient. A valid variable outside the declared dimension shall return a const reference to a singleton zero, without extending the form or allocating a coefficient for that variable.
Owned coefficient references shall be usable until destruction or an operation that may replace/reallocate or transfer the owning vector. The shared zero shall remain usable during its owning type/context lifetime; callers shall not destroy or modify it through a cast.
Borrowing an absent zero coefficient does not change ambient dimension, while vector ownership determines view validity.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
static dimension_type max_space_dimension(); dimension_type space_dimension() const; const C& coefficient(Variable v) const &; const C& inhomogeneous_term() const &;
Check reference types and repeated identity for owned cells, zero queries far beyond declared dimensions without growth, constants, trailing dimensions and the representation limit without attempting maximal allocation.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Unary plus shall return an independent value copy with the same dimension. Unary minus shall return an independent form whose coefficient intervals, including the constant, enclose their entry-value negations. negate() shall apply the same interval negation to the current form and preserve its dimension. Negation shall exchange lower/upper roles and endpoint openness according to C. It shall not cancel an uncertain interval to zero.
Unary operations retain ambient coordinates and interval uncertainty while distinguishing a new value from in-place modification.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C> operator+(const Linear_Form<C>& f); template <typename C> Linear_Form<C> operator-(const Linear_Form<C>& f); void negate();
Use independent rational endpoint negation for positive/negative/straddling/open coefficients and constants; compare unary and in-place results, dimensions and unchanged donors.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
For a+b and a+=b, the result dimension shall be the maximum of the entry dimensions. Each common coefficient interval and the constant shall enclose the sum of the corresponding entry intervals. Coefficients belonging only to the larger form shall be preserved. Compound assignment shall return a by reference; noncompound addition shall return an independent form and preserve both operands. Same-object addition shall use the entry coefficient intervals and their independent-choice interval meaning.
Padding missing coordinates by exact zero preserves the meaning of addition across ambient dimensions.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C> operator+(const Linear_Form<C>& a, const Linear_Form<C>& b); template <typename C> Linear_Form<C>& operator+=(Linear_Form<C>& a, const Linear_Form<C>& b);
Derive sums independently over rational endpoint pairs and valuations for both dimension orders, constants, trailing zeros and same-object updates; check return references and unchanged independent inputs.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
For a-b and a-=b, the result dimension shall be the maximum of the entry dimensions. Each coefficient interval and constant shall enclose the corresponding entry interval difference. A coordinate present only in a shall be preserved; one present only in b shall be negated. Compound assignment shall return a by reference; the independent result shall preserve both operands. Same-object subtraction shall retain independent interval-choice semantics: subtracting an uncertain interval from itself shall not imply a singleton-zero coefficient.
Interval subtraction encloses all independently chosen differences, even for aliased operand objects.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C> operator-(const Linear_Form<C>& a, const Linear_Form<C>& b); template <typename C> Linear_Form<C>& operator-=(Linear_Form<C>& a, const Linear_Form<C>& b);
Check independent difference endpoints and affine valuations in both dimension orders, copied/aliased operands, zero tails and open coefficients; require uncertain self-differences to retain their widths.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Adding or subtracting a valid variable shall add or subtract singleton one at its coordinate, preserve every other entry coefficient and constant, and set dimension to the maximum of the form's entry dimension and the variable dimension. The reflected v-f shall negate every coefficient of f then add singleton one at v.id(). Compound operations shall return the modified form by reference. Returning operations shall preserve their operands. Exact cancellation shall not shrink the declared dimension. A variable dimension above max_space_dimension() shall cause std::length_error and leave the existing form unchanged.
Variable overloads must agree with interval-affine value meaning while safely extending coordinates.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C> operator+(Variable v, const Linear_Form<C>& f); template <typename C> Linear_Form<C> operator+(const Linear_Form<C>& f, Variable v); template <typename C> Linear_Form<C> operator-(Variable v, const Linear_Form<C>& f); template <typename C> Linear_Form<C> operator-(const Linear_Form<C>& f, Variable v); template <typename C> Linear_Form<C>& operator+=(Linear_Form<C>& f, Variable v); template <typename C> Linear_Form<C>& operator-=(Linear_Form<C>& f, Variable v);
Check every overload below/inside/above the entry dimension, literal coordinate updates, reflected signs, cancellation with retained dimensions, rejected maximal variables and retry.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Adding or subtracting an interval scalar shall change only the constant interval, by the corresponding interval sum or difference, and retain the form's dimension and homogeneous coefficients. n-f shall negate the homogeneous coefficients and produce the interval difference of entry scalar n and the entry constant. Returning operations shall preserve all inputs. Compound operations shall return the destination reference and use the scalar's entry value when it is borrowed from that form, including its constant.
Translating a form changes its constant without rewriting variable coefficients or silently correlating interval choices.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C> operator+(const C& n, const Linear_Form<C>& f); template <typename C> Linear_Form<C> operator+(const Linear_Form<C>& f, const C& n); template <typename C> Linear_Form<C> operator-(const C& n, const Linear_Form<C>& f); template <typename C> Linear_Form<C> operator-(const Linear_Form<C>& f, const C& n); template <typename C> Linear_Form<C>& operator+=(Linear_Form<C>& f, const C& n); template <typename C> Linear_Form<C>& operator-=(Linear_Form<C>& f, const C& n);
Compare independent rational endpoint sums/differences for both scalar positions, straddling/open intervals, zero and high dimensions, borrowed coefficients/constants and compound return identities.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Multiplying a form by interval scalar n shall preserve its declared dimension and produce coefficient intervals, including the constant, that enclose every product of the corresponding entry coefficient and the entry scalar. Both returning orders shall preserve their operands and return an independent form. Compound multiplication shall return the modified form reference. A scalar borrowed from the destination shall denote its entry interval for every coefficient update; changing an earlier coefficient shall not change that scalar's meaning for later updates.
All coefficients must use one entry scalar interval, including when the caller borrowed it from the destination.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C> operator*(const C& n, const Linear_Form<C>& f); template <typename C> Linear_Form<C> operator*(const Linear_Form<C>& f, const C& n); template <typename C> Linear_Form<C>& operator*=(Linear_Form<C>& f, const C& n);
Compute all four rational endpoint products independently for signed/zero/straddling scalars, verify affine enclosures over valuations and input preservation, and include scalar references borrowed from constant and homogeneous cells.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
For a supported interval divisor that excludes zero, compound division shall preserve the dimension and enclose, at every coefficient and constant, all quotients of the entry coefficient interval by the entry divisor interval. It shall return the destination reference. The divisor's entry interval shall apply to every coefficient even when borrowed from the destination. Callers shall satisfy the selected interval division's domain, representability and rounding prerequisites; this interface shall not imply that division by zero is admitted.
Coefficient-wise division needs a stable nonzero scalar value and an explicit valid numerical domain.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> Linear_Form<C>& operator/=(Linear_Form<C>& f, const C& n);
Derive rational endpoint quotients for positive/negative singleton/nonsingleton divisors, compare independent affine values and return identity, and include valid borrowed homogeneous/constant divisors.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Equality shall return true exactly when the constants compare equal under C and every homogeneous coefficient compares equal after padding the shorter form with singleton-zero intervals. Different declared dimensions alone shall not imply inequality. Inequality shall be the logical complement of equality. Neither operation shall modify its inputs or dimensions. This comparison shall compare interval coefficients; it shall not assert relational equivalence after correlating uncertain coefficient choices.
An ambient zero tail does not change an interval-affine coefficient description.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename C> bool operator==(const Linear_Form<C>& a, const Linear_Form<C>& b); // 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 both argument orders, equal/unequal constants and internal cells, trailing zero/nonzero/uncertain cells, all-zero dimensions, self-comparison and unchanged dimensions.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Member and free swap shall exchange the complete owned coefficient values and declared dimensions of two forms without numerical conversion. Future mutation of either form shall affect its received value independently. Same-object swap shall preserve its value and dimension. Swap shall not require copying or re-evaluating every interval coefficient.
Ownership exchange is a representation operation and must not alter interval meaning.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
void m_swap(Linear_Form& other); template <typename C> void swap(Linear_Form<C>& a, Linear_Form<C>& b);
Check both swap forms across zero/different dimensions, open/empty/unbounded/large rational values, self-swap, repeated cycles, snapshots and coefficient-copy/allocation inspection.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
OK() shall return true when every owned interval coefficient satisfies its interval invariant predicate, and false when any such predicate returns false. overflows() shall return false exactly when the constant and every stored homogeneous coefficient satisfy C::is_bounded(); otherwise it shall return true. The latter shall classify the current coefficient bounds, not certify past arithmetic exactness or the absence of modeled floating-point rounding error. Both queries shall preserve the form and its dimension.
Current interval validity and finite-bound availability are separate from numerical error proofs.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
bool OK() const; bool overflows() const;
Check finite forms, unbounded constant/early/late coefficients, zero tails, recovery by assignment; inspect every owned coefficient path and propagation of an individual interval invariant failure.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
- PPL-LLR-000084 Conservative arithmetic on interval linear forms (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
ascii_dump() shall write the dimension followed by the constant and homogeneous intervals in coordinate order, each in C's reloadable ascii_dump() format. Successful loading shall replace the complete form with that declared dimension and those intervals, including endpoint metadata and inactive payloads required by C's format. A dump shall round-trip under a compatible coefficient representation. The overload without a stream argument shall write that same frame on standard error. Dumping shall preserve the source and may propagate stream exceptions.
ascii_load() shall return false when no valid dimension can be read, when it exceeds max_space_dimension(), or when a required interval record cannot be loaded. Success shall return true after consuming the required record; trailing input shall remain available. A failed load shall leave the form destructible and reusable by complete assignment/loading, with no unchanged-state guarantee. Earlier display-based coefficient encodings shall not be accepted as equivalent machine records.
Interval metadata must survive machine serialization independently of human-readable formatting.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
void ascii_dump(std::ostream& stream) const; void ascii_dump() const; bool ascii_load(std::istream& stream);
Check literal and round-trip records for zero/high dimensions and scalar families, open/empty/unbounded intervals, stream extent, malformed headers/coefficient truncation and successful reuse after failure.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; src/globals_defs.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
Stream insertion shall return the supplied stream and preserve the form. It shall display nonzero homogeneous coefficients in increasing variable index order using the current variable formatter. A first singleton-minus-one coefficient shall display a leading minus; singleton-one factors shall omit the coefficient/product marker. A later minus-one coefficient shall use the separator " - "; every other later nonzero coefficient shall use " + ", displaying its interval and "*" when it is not singleton one. The nonzero constant shall follow existing variable terms with " + " and use C's display. If all coefficients are zero, the zero interval shall be displayed. A negative nonunit coefficient or constant shall retain its coefficient display rather than being rewritten into a subtraction. Coefficient display shall use the stream locale/format settings and retain the variable formatter's prerequisites. It shall not serve as the reloadable machine format. print() shall display the same form on standard error without adding a newline.
Literal coefficient and separator rules make public display stable while reserving reloadable metadata for ASCII serialization.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
namespace IO_Operators { template <typename C> std::ostream& operator<<(std::ostream& stream, const Linear_Form<C>& f); } void print() const;
Compare literal strings for zero/constant/unit/nonunit/negative/interval coefficients, gaps and canceled tails; check stream identity, formatter restoration, source preservation and separate machine round trips.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; src/globals_defs.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
external_memory_in_bytes() shall count allocated vector capacity in bytes and the external memory reported by every constructed coefficient interval. It shall not charge the form for shared zero storage borrowed by out-of-dimension queries. total_memory_in_bytes() shall equal the external count plus sizeof(*this). Counts shall retain the selected coefficient memory-reporting contracts and require representable aggregate byte counts; allocator bookkeeping outside those reports shall not be inferred.
Capacity and live coefficient payloads jointly determine memory owned by the form.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
memory_size_type external_memory_in_bytes() const; memory_size_type total_memory_in_bytes() const;
Check total/external identity, vector-capacity lower bounds, large GMP endpoint payload growth, unchanged counts after distant zero queries and ownership transfer through swaps/copies.
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
- PPL-LLR-000082 Sound successful floating-point linearization (Specifies)
- PPL-LLR-000083 Explicit failure of unsupported expression approximation (Specifies)
- PPL-LLR-000084 Conservative arithmetic on interval linear forms (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
For a live form with supported initialized interval coefficients, intervalize() shall ask the oracle for intervals of its declared variable coordinates. When the oracle supplies valid enclosures for every requested coordinate, a true result shall set result to an interval enclosing all entry-form affine values at independently admitted coefficient and coordinate choices. A dimension-zero form shall need no coordinate query and shall return its constant interval. The form shall remain unchanged.
If a required oracle query returns false, the method shall return false and shall not claim that result establishes a complete enclosure; no prior result-value preservation shall be promised. Exceptions from the oracle or coefficient operations may propagate. The oracle shall supply initialized intervals and remain valid for the call; overlapping mutation shall follow the operation's numerical/runtime prerequisites. Rational coefficient intervals shall not require native floating-point availability.
Interval evaluation composes independent coefficient/coordinate products and propagates refusal rather than reporting a partial sum as complete.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
template <typename Target> bool intervalize(const FP_Oracle<Target, C>& oracle, C& result) const;
Enumerate independent rational corner values for signed uncertain coefficients and coordinate boxes, including inexact native bounds, zero dimension, zero coefficients and failures at first/middle/last queried coordinates followed by recovery. Include exact rational oracle evaluation with native floating-point support disabled.
Mine04 | Whole work (background on floating-point expressions modeled by interval linear forms).
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.
- PPL-LLR-000082 Sound successful floating-point linearization (Specifies)
- PPL-LLR-000084 Conservative arithmetic on interval linear forms (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
For a form with nonempty bounded supported floating-point intervals, relative_error(format, result) shall preserve the entry dimension and replace result by a form whose coefficient at each coordinate and constant encloses the corresponding magnitude bound multiplied by [ − u, u]. The magnitude bound shall be the maximum absolute value of that entry interval's endpoints. The relative-error unit u shall be 2 − 10, 2 − 23, 2 − 52, 2 − 112 and 2 − 63 for IEEE754_HALF, IEEE754_SINGLE, IEEE754_DOUBLE, IEEE754_QUAD and INTEL_DOUBLE_EXTENDED, respectively. It shall be 2 − 20 for IBM_SINGLE and 2 − 52 for IBM_DOUBLE.
The source shall remain unchanged unless it is also result; in that case the complete result shall still use the source's entry intervals and dimension. This operation shall construct the relative-error component; it shall not alone establish a complete floating-point linearization or supply a separate absolute error term for underflow. All evaluated boundary and interval operations shall satisfy their supported-format, rounding and representability prerequisites.
Analyzed-format error units and entry-value alias semantics are needed to compose a sound rounding-error form.
Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member excerpts belong to Linear_Form<C>.
void relative_error(Floating_Point_Format format, Linear_Form& result) const;
Use independently specified powers of two and rational magnitude products for every named format, zero/unequal-dimensional outputs, signed/zero/uncertain coefficients, preserved donors and same-object output.
Mine04 | Whole work (background on floating-point expressions modeled by interval linear forms).
src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Linear_Form_templates.hh; tests/linearformspec1.cc; tests/linearformstorage1.cc; tests/linearformscalar1.cc; tests/linearformvariables1.cc; tests/linearformoutput1.cc; tests/linearformlegacy1.cc; tests/linearformpublic1.cc; tests/inactiveboundcodec.hh.