PPL Configured Java Language Interface  1.2
parma_polyhedra_library.Parma_Polyhedra_Library Class Reference

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

Static Public Member Functions

Library initialization and finalization
static native void initialize_library ()
 Initializes the Parma Polyhedra Library. More...
 
static native void finalize_library ()
 Finalizes the Parma Polyhedra Library. More...
 
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. More...
 
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. More...
 
static native void restore_pre_PPL_rounding ()
 Sets the FPU rounding mode as it was before initialization of the PPL. More...
 
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. More...
 
Timeout handling
static native void set_timeout (int csecs)
 Sets the timeout for computations whose completion could require an exponential amount of time. More...
 
static native void reset_timeout ()
 Resets the timeout time so that the computation is not interrupted.
 
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. More...
 
static native void reset_deterministic_timeout ()
 Resets the deterministic timeout so that the computation is not interrupted.
 

Detailed Description

A class collecting library-level functions.

Member Function Documentation

static 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.

static native void parma_polyhedra_library.Parma_Polyhedra_Library.finalize_library ( )
static

Finalizes the Parma Polyhedra Library.

This method must be called when work with the library is done. 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().

static 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.

static 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.

static 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.

static 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.

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

Sets the timeout for computations whose completion could require an exponential amount of time.

Parameters
csecsThe number of centiseconds sometimes after which a timeout will occur; it must be strictly greater than zero.

Computations taking exponential time will be interrupted some time after csecs centiseconds have elapsed since the call to the timeout setting function, by throwing a Timeout_Exception object. Otherwise, if the computation completes without being interrupted, then the timeout should be reset by calling reset_timeout().

static 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.

The documentation for this class was generated from the following file: