TOWARDS GOOD C++ INTERVAL LIBRARIES: TRICKS AND TRAITS

Despite its usefulness for overcoming floating-point arithmetic defects, manipulating imprecise data, and performing non-linear global optimization, interval arithmetic is not yet a first-class type in any computer language. Some attempts are underway for Fortran and Java, not for C++. However, some add-on C++ interval libraries already exist though they do not respect the C++ standard library spirit since they are not generic (one cannot choose the type for the interval bounds). The design and implementation of JAIL, a C++ templated library based on the “traits” C++ programming technique, are presented in this paper; parameterization is shown to enhance the reliability, the versatily, and the portability of the library across multiple platforms. The impact on efficiency of parameterization through templated classes and of some implementation tricks is also investigated.