PPL Java Language Interface 2.0
parma_polyhedra_library.Parma_Polyhedra_Library Class Reference

A class collecting library-level functions. More...

Static Public Member Functions

static native boolean is_mixed_integer_satisfiable (long dimension, Constraint_System constraints, Variables_Set integers)
Library initialization and finalization
static native void initialize_library ()
 Initializes the Parma Polyhedra Library.
static native void finalize_library ()
 Finalizes the Parma Polyhedra Library.
Thread initialization and finalization
static native void initialize_thread ()
 Thread-specific initialization for the Parma Polyhedra Library.
static native void finalize_thread ()
 Thread-specific finalization for the Parma Polyhedra Library.
Version Checking
static native int version_major ()
 Returns the major number of the PPL version.
static native int version_minor ()
 Returns the minor number of the PPL version.
static native int version_revision ()
 Returns the revision number of the PPL version.
static native int version_beta ()
 Returns the beta number of the PPL version.
static native String version ()
 Returns a string containing the PPL version.
static native String banner ()
 Returns a string containing the PPL banner.
Floating-point rounding and precision settings.
static native void set_rounding_for_PPL ()
 Sets the FPU rounding mode so that the PPL abstractions based on floating point numbers work correctly.
static native void restore_pre_PPL_rounding ()
 Sets the FPU rounding mode as it was before initialization of the PPL.
static native int irrational_precision ()
 Returns the precision parameter for irrational calculations.
static native void set_irrational_precision (int p)
 Sets the precision parameter used for irrational calculations.
Timeout handling
static native void set_timeout (int csecs)
 Rejects requests for signal-based computation timeouts.
static native void reset_timeout ()
 Rejects requests to reset a signal-based computation timeout.
static native void set_deterministic_timeout (int unscaled_weight, int scale)
 Sets a threshold for computations whose completion could require an exponential amount of time.
static native void reset_deterministic_timeout ()
 Resets the deterministic timeout so that the computation is not interrupted. Only the calling thread's deterministic timeout is canceled. An unrelated interruption request is preserved.

Detailed Description

A class collecting library-level functions.

Member Function Documentation

◆ is_mixed_integer_satisfiable()

native boolean parma_polyhedra_library.Parma_Polyhedra_Library.is_mixed_integer_satisfiable ( long dimension,
Constraint_System constraints,
Variables_Set integers )
static

Tests exact strict mixed-integer feasibility in the given dimension. Inputs are preserved; indices/constraints outside that space are errors.

Parameters
dimensionThe dimension of the enclosing vector space.
constraintsThe constraints defining the feasible region.
integersThe dimensions whose coordinates must be integer.
Returns
true if the constraints admit a point with integer coordinates in the selected dimensions; false otherwise.

◆ initialize_library()

native void parma_polyhedra_library.Parma_Polyhedra_Library.initialize_library ( )
static

Initializes the Parma Polyhedra Library.

This method must be called after loading the library and before calling any other method from any other PPL package class.

◆ finalize_library()

native void parma_polyhedra_library.Parma_Polyhedra_Library.finalize_library ( )
static

Finalizes the Parma Polyhedra Library.

Call this method on the initializing thread after all workers have completed PPL work and thread cleanup, and after releasing owned native objects and ceasing use of borrowed views. After finalization, no other library method can be called (except those in class Parma_Polyhedra_Library), unless the library is re-initialized by calling initialize_library().

◆ initialize_thread()

native void parma_polyhedra_library.Parma_Polyhedra_Library.initialize_thread ( )
static

Thread-specific initialization for the Parma Polyhedra Library.

This method must be called after creating a new thread using the PPL and before calling any other method from any other PPL package class.

Note
The thread calling initialize_library() already has its thread state and uses the library lifecycle instead of this worker entry.

◆ finalize_thread()

native void parma_polyhedra_library.Parma_Polyhedra_Library.finalize_thread ( )
static

Thread-specific finalization for the Parma Polyhedra Library.

Call this method after releasing the worker's owned native objects and completing its PPL work. After thread finalization, no other library method can be called, unless the thread is re-initialized by calling initialize_thread().

Note
The library-initializing thread uses finalize_library() instead of this worker exit.

◆ version_major()

native int parma_polyhedra_library.Parma_Polyhedra_Library.version_major ( )
static

Returns the major number of the PPL version.

Returns
The major number of the PPL version.

◆ version_minor()

native int parma_polyhedra_library.Parma_Polyhedra_Library.version_minor ( )
static

Returns the minor number of the PPL version.

Returns
The minor number of the PPL version.

◆ version_revision()

native int parma_polyhedra_library.Parma_Polyhedra_Library.version_revision ( )
static

Returns the revision number of the PPL version.

Returns
The revision number of the PPL version.

◆ version_beta()

native int parma_polyhedra_library.Parma_Polyhedra_Library.version_beta ( )
static

Returns the beta number of the PPL version.

Returns
The beta number of the PPL version.

◆ version()

native String parma_polyhedra_library.Parma_Polyhedra_Library.version ( )
static

Returns a string containing the PPL version.

Returns
A string containing the PPL version.

◆ banner()

native String parma_polyhedra_library.Parma_Polyhedra_Library.banner ( )
static

Returns a string containing the PPL banner.

The banner provides information about the PPL version, the licensing, the lack of any warranty whatsoever, the C++ compiler used to build the library, where to report bugs and where to look for further information.

Returns
A string containing the PPL banner.

◆ set_rounding_for_PPL()

native void parma_polyhedra_library.Parma_Polyhedra_Library.set_rounding_for_PPL ( )
static

Sets the FPU rounding mode so that the PPL abstractions based on floating point numbers work correctly.

This is performed automatically at initialization-time. Calling this function is needed only if restore_pre_PPL_rounding() has been previously called.

◆ restore_pre_PPL_rounding()

native void parma_polyhedra_library.Parma_Polyhedra_Library.restore_pre_PPL_rounding ( )
static

Sets the FPU rounding mode as it was before initialization of the PPL.

After calling this function it is absolutely necessary to call set_rounding_for_PPL() before using any PPL abstractions based on floating point numbers. This is performed automatically at finalization-time.

◆ irrational_precision()

native int parma_polyhedra_library.Parma_Polyhedra_Library.irrational_precision ( )
static

Returns the precision parameter for irrational calculations.

Returns
The precision parameter for irrational calculations.

◆ set_irrational_precision()

native void parma_polyhedra_library.Parma_Polyhedra_Library.set_irrational_precision ( int p)
static

Sets the precision parameter used for irrational calculations.

If p is less than or equal to INT_MAX, sets the precision parameter used for irrational calculations to p. Then, in the irrational calculations returning an unbounded rational, (e.g., when computing a square root), the lesser between numerator and denominator will be limited to 2**p.

Parameters
pThe precision parameter limiting irrational rational calculations.

◆ set_timeout()

native void parma_polyhedra_library.Parma_Polyhedra_Library.set_timeout ( int csecs)
static

Rejects requests for signal-based computation timeouts.

Signal-based timeouts are unsupported in the Java interface: it cannot ensure that the JVM's internal threads satisfy the signal-delivery ownership required by the native watchdog. This method always throws Logic_Error_Exception, in every build and for every value of csecs, including negative values and zero. Unsupported-operation rejection takes precedence over duration validation.

No timer is armed or reset, and any deterministic timeout threshold is left unchanged. For supported computation interruption, use set_deterministic_timeout().

Parameters
csecsThe requested duration in centiseconds; its value is ignored.
Exceptions
Logic_Error_ExceptionAlways thrown because signal-based timeouts are unsupported.

◆ reset_timeout()

native void parma_polyhedra_library.Parma_Polyhedra_Library.reset_timeout ( )
static

Rejects requests to reset a signal-based computation timeout.

This method always throws Logic_Error_Exception, in every build. It does not change a native timer or a deterministic timeout threshold. Use reset_deterministic_timeout() to cancel a deterministic timeout.

Exceptions
Logic_Error_ExceptionAlways thrown because signal-based timeouts are unsupported.

◆ set_deterministic_timeout()

native void parma_polyhedra_library.Parma_Polyhedra_Library.set_deterministic_timeout ( int unscaled_weight,
int scale )
static

Sets a threshold for computations whose completion could require an exponential amount of time.

If unscaled_weight has value $u$ and scale has value $s$, then the (scaled) weight threshold is computed as $w = u \cdot 2^s$. Computations taking exponential time will be interrupted some time after reaching the complexity threshold $w$, by throwing a Timeout_Exception object. Otherwise, if the computation completes without being interrupted, then the deterministic timeout should be reset by calling reset_deterministic_timeout().

Parameters
unscaled_weightThe unscaled maximum computational weight; it has to be strictly greater than zero.
scaleThe scaling factor to be applied to unscaled_weight; it has to be non-negative.
Exceptions
Invalid_Argument_ExceptionThrown if the computation of the weight threshold exceeds the maximum allowed value.
Note
This "timeout" checking functionality is said to be deterministic because it is not based on actual elapsed time. Its behavior will only depend on (some of the) computations performed in the PPL library and it will be otherwise independent from the computation environment (CPU, operating system, compiler, etc.).
Warning
The weight mechanism is under beta testing. In particular, there is still no clear relation between the weight threshold and the actual computational complexity. As a consequence, client applications should be ready to reconsider the tuning of these weight thresholds when upgrading to newer version of the PPL. In a thread-safe build this budget belongs to the calling initialized thread. Other initialized threads may use independent budgets. Thread finalization cancels its pending deterministic timeout.

The documentation for this class was generated from the following file:
  • Parma_Polyhedra_Library.java