English | 日本語
Final update: Mar. 10, 2017

kv - a C++ Library for Verified Numerical Computation

Masahide Kashiwagi

1. Introduction

A set of libraries for verified numerical computations (kv library), which is written in the C++ language, is available to download in this page.

In old versions of kv library (which had been developed from the autumn, 2007 to the spring, 2013), the interval library in Boost (boost.interval) was used. In the present version of kv library (see, 3. Download and Install), all programs with respect to interval arithmetics are originally produced, whereas some functions in Boost still partially used in kv library, e.g., boost.ublas for linear algebras.

2. Requirement

A computational environment where C++ program and Boost can work, is required to use kv library.

Basically, the present kv library is developed on Ubuntu 14.04 (64bit). Unix operating systems (64bit) are recommended, while it was confirmed that kv library works on the following computational environments:

In order to obtain correct numerical results using rdouble.h in kv library (to be introduced in 5. Interval arithmetic ), one of the followings is required:

Note that the Intel FPU has a problem in the use of double-double (dd) precision arithmetics. Several preventive measures against the problem have been taken in kv library, however, the possibility of incorrect numerical results due to 32 bit operating systems, still remain (see 6. Double-double precision arithmetic for details).

Unix operating systems (64bit) are again recommended.

3. Download and Install

Download: kv-0.4.41.tar.gz (updated on Mar. 10, 2017)
(Old versions are available to download here.)

You can also access to the source code of kv on https://github.com/mskashi/kv .

kv library is designed to work without "install" (and therefore "make") but only with the header files in itself. After expanding the archive file of kv library, the three directory of "kv", "test", and "example" will be constructed. The main components of kv library are in "kv". Therefore, kv library is available after setting all files in "kv" into an appropriate directory (e.g., the current directory or /usr/local/include). The all functions provided by kv library are confined in the namespace of "kv" so that these functions does not compete with other libraries.

The operation confirmation of kv library can be done by compiling some .cc file in "test" or "example". For example, after

you can verify the operation of kv library by entering the following command (on "test" directory).
c++ -I.. -I/usr/local/include test-interval.cc
Note that the directories in which the files of kv library and Boost exist, should be specified in the above command.

It is recommended to specify the options -O3 (or other possible optimization options) and -DNDEBUG, both of which strongly affect the execution speed (the details of the NDEBUG macro can be found in boost.ublas). Additionally remark that the option of -DKV_FASTROUND is available to perform faster interval arithmetics when using an Intel's CPU and a 64bit operating system.

When you change your computational environment or compile options, it is recommended to re-check whether the rounding mode is correctly changed for the four arithmetic and square-root operations, by compiling and performing test/test-rounding.cc.

4. List of components

5. Interval arithmetic

6. Double-double precision arithmetics

The following sections are still written in Japanese, and the translation is in progress.

7. Wrapper for MPFR (in Japanese)

8. Complex number Arithmetic (in Japanese)

9. Automatic differentiation (in Japanese)

10. Affine Arithmetic (in Japanese)

11. Power series arithmetic (in Japanese)

12. Verification by the Krawczyk method for nonlinear equations (in Japanese)

13. Finding all solutions to nonlinear equations (in Japanese)

14. Verification for initial‐value problem for ODEs (in Japanese)

15. Solver for initial‐value problems and verification for boundary‐value problem by shooting method (in Japanese)

16. Numerical integration (in Japanese)

17. Verification for special functions (in Japanese)

18. Other functions (in Japanese)

19. Function objects (in Japanese)

20. Appendix

20.1 What is Boost? (in Japanese)

20.2 Matrix computation with boost.ublas (in Japanese)

20.3 Numeric types (in Japanese)

20.4 For a reference: a simple interval arithmetic library (in Japanese)

21. Web Demonstration of kv Library

22. Application Examples of kv Library (in Japanese)

23. Concluding remarks (in Japanese)

本ライブラリは、 HIKMOT のC++パートで使われ、その高速性に大きく寄与しています。 また、当研究室の学生の日々の研究にも使われ、 その意見を反映しながら開発を進めています。

大勢の人に使われて鍛えられないとライブラリは成長しないので、 なるべく多くの方に使って頂いてご意見を頂ければありがたいです。

本ライブラリの開発には、NTT未来ねっと研究所の柏木啓一郎氏の多大なる協力を 得ています。ここに感謝の意を表します。

(Added on October 5, 2015) This software is released under the MIT license.

Update history (in Japanese)

Acknowledgment (in Japanese)

kv - a C++ Library for Verified Numerical Computation /