PPL
1.2
|
Class for initialization and finalization. More...
#include <Init_defs.hh>
Public Member Functions | |
Init () | |
Initializes the PPL. More... | |
~Init () | |
Finalizes the PPL. More... | |
Static Private Attributes | |
static const unsigned | DEFAULT_IRRATIONAL_PRECISION = 128U |
Default precision parameter used for irrational calculations. More... | |
static unsigned int | count = 0 |
Count the number of objects created. More... | |
static fpu_rounding_direction_type | old_rounding_direction |
Friends | |
void | set_rounding_for_PPL () |
Sets the FPU rounding mode so that the PPL abstractions based on floating point numbers work correctly. More... | |
void | restore_pre_PPL_rounding () |
Sets the FPU rounding mode as it was before initialization of the PPL. More... | |
Class for initialization and finalization.
Nifty Counter initialization class, ensuring that the library is initialized only once and before its first use. A count of the number of translation units using the library is maintained. A static object of Init type will be declared by each translation unit using the library. As a result, only one of them will initialize and properly finalize the library.
Definition at line 72 of file Init_defs.hh.
Parma_Polyhedra_Library::Init::Init | ( | ) |
Initializes the PPL.
Definition at line 133 of file Init.cc.
References Parma_Polyhedra_Library::Coefficient_constants_initialize(), count, DEFAULT_IRRATIONAL_PRECISION, Parma_Polyhedra_Library::Variable::default_output_function(), Parma_Polyhedra_Library::fpu_get_rounding_direction(), Parma_Polyhedra_Library::fpu_initialize_control_functions(), Parma_Polyhedra_Library::fpu_set_rounding_direction(), Parma_Polyhedra_Library::initialize(), Parma_Polyhedra_Library::Constraint_System::initialize(), Parma_Polyhedra_Library::Congruence_System::initialize(), Parma_Polyhedra_Library::Grid_Generator_System::initialize(), Parma_Polyhedra_Library::Generator_System::initialize(), Parma_Polyhedra_Library::Congruence::initialize(), Parma_Polyhedra_Library::Polyhedron::initialize(), Parma_Polyhedra_Library::Constraint::initialize(), Parma_Polyhedra_Library::Grid_Generator::initialize(), Parma_Polyhedra_Library::Generator::initialize(), Parma_Polyhedra_Library::Linear_Expression::initialize(), old_rounding_direction, ppl_set_GMP_memory_allocation_functions(), Parma_Polyhedra_Library::ROUND_DIRECT, Parma_Polyhedra_Library::round_fpu_dir(), Parma_Polyhedra_Library::set_irrational_precision(), and Parma_Polyhedra_Library::Variable::set_output_function().
Parma_Polyhedra_Library::Init::~Init | ( | ) |
Finalizes the PPL.
Definition at line 185 of file Init.cc.
References Parma_Polyhedra_Library::Coefficient_constants_finalize(), Parma_Polyhedra_Library::finalize(), Parma_Polyhedra_Library::Constraint_System::finalize(), Parma_Polyhedra_Library::Congruence_System::finalize(), Parma_Polyhedra_Library::Grid_Generator_System::finalize(), Parma_Polyhedra_Library::Generator_System::finalize(), Parma_Polyhedra_Library::Congruence::finalize(), Parma_Polyhedra_Library::Polyhedron::finalize(), Parma_Polyhedra_Library::Constraint::finalize(), Parma_Polyhedra_Library::Grid_Generator::finalize(), Parma_Polyhedra_Library::Generator::finalize(), Parma_Polyhedra_Library::Linear_Expression::finalize(), and Parma_Polyhedra_Library::fpu_set_rounding_direction().
|
friend |
Sets the FPU rounding mode as it was before initialization of the PPL.
This is important if the application uses floating-point computations outside the PPL. It is crucial when the application uses functions from a mathematical library that are not guaranteed to work correctly under all rounding modes.
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.
Definition at line 40 of file Init_inlines.hh.
|
friend |
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.
Definition at line 33 of file Init_inlines.hh.
|
staticprivate |
Count the number of objects created.
Definition at line 90 of file Init_defs.hh.
Referenced by Init().
|
staticprivate |
Default precision parameter used for irrational calculations.
The default is chosen to have a precision greater than most precise IEC 559 floating point (112 bits of mantissa).
Definition at line 87 of file Init_defs.hh.
Referenced by Init().
|
staticprivate |
Definition at line 91 of file Init_defs.hh.
Referenced by Init(), and Parma_Polyhedra_Library::restore_pre_PPL_rounding().