/*! \mainpage
[Mar. 27th 2010] "cpplapack-2010.03.27" has been released. This release is only for the users who don't like to use svn. (We still recomend users to use svn.:)) Not only "tar.gz" but also "rpm" and "deb" packages were prepared. See the logs of svn to get the "ChangeLog".
[Sep. 25th 2006] "cpplapack-2006_09_25" has been released. The general sparse matrix(dgsmatrix, zgsmatrix) and symmetric or hermitial sparse matrix(dssmatrix,zhsmatrix) were formally added. This release also contains some bug fixes. See "ChangeLog" for the detail.
[Mar. 25th 2005] "cpplapack-2005_03_25" has been released. This release contains some bug fixes and modification. See "ChangeLog" for the detail. It also contains the alpha version of sparse matrix classes (dssmatrix and zssmatrix). These classes are still so buggy, but it is OK as long as you don't use these classes in your code.
[Oct. 15th 2004] Mr. Ueshima wrote a tutorial of CPPLapack in Japanese. "cpplapack-2004_04_24" has been released. It is very useful for beginners of CPPLapack. The HTML version is available at http://cpplapack.sourceforge.net/tutorial/japanese/index.html, and the PDF version is available at http://cpplapack.sourceforge.net/tutorial/japanese/CPPLapack_Tutorial-Japanese.pdf
[Apr. 24th 2004]
"cpplapack-2004_04_24" has been released.
OpenMP macros (\#pragma omp parallel for private(j,k)
)
are added to all triple for-loops.
The search engine for this documentation is added.
This search engine is case-sensitive.
[Apr. 1st 2004] "cpplapack-2004_04_01" has been released. The complex double-precision matrix and vector classes (zgematrix, zgbmatrix, zhematrix, zcovector, zrovector) are newly added.
CPPLapack is a C++ class wrapper for BLAS and LAPACK.
The interfaces of Fortran BLAS, LAPACK, CBLAS, and CLAPACK are not user-friendly, and induce a lot of coding mistakes not only for LAPACK beginners but also experienced programmers. Because of its difficult interface, BLAS functions are not widely used for simple matrix calculations such as "+", "-", "*", and so on even though these calculations are frequently required. If there is a user-friendly library using BLAS and LAPACK in the background, it is really useful to minimize the program development time and computational time at the same time. Existing matrix libraries, however, are not sufficient as far as we know.
CPPLapack has a very user-friendly interface
as same as ordinary C++ matrix libraries.
Moreover, CPPLapack uses BLAS and LAPACK functions in the background
though programmers just need to write simple codes
such as "A=B*C;"
, "A.dgesv(y);"
, and so on.
The advantage of using CPPLapack are not only user-friendly interface and fast computational speed but also saving memory space. In case of large-size matrix calculation, the number of copy times of objects affects required memory space and computational time materially. CPPLapack has a mechanism called "Smart-Temporary" system to minimize the number of copy times. The "Smart-Temporary" system is also hidden in CPPLapack library so that programmers don't need to pay any attention for this system. (CPPLapack used to employed "to_return" system. Now CPPLapack uses this system to realize the same purpose with keeping the compatibility with old versions.)
This program is designed for large matrix calculation. If you don't have mind to handle large matrices, to use another matrix library is recommended.
CPPLapack is still a beta program so far. It is a shame but there are a few bugs and unsupported BLAS and LAPACK functions. If you are going to use CPPLapack, please be aware this situation. Of course, it is very nice if you help us to develop CPPLapack.
The official distribution site of CPPLapack is here.
Actually, you don't need to install CPPLapack. CPPLapack is a bunch of C++ header files. Just expand the package at somewhere you like, and write a include path in your "Makefile". All you need to include is only "cpplapack.h".
But CPPLapack needs BLAS and LAPACK written in Fortran installed. Just make sure these two libraries are installed and modify "Makefile" to include and link to them. In stead of original BLAS and LAPACK packages, bender-supplied libraries such as Intel math kernel library(MKL), Compaq extended math library(CXML), and so on are also acceptable.
What BLAS and LAPACK need to link depends on your platform. Some examples of "Makefile" are prepared. See \ref pg-makefile.
For Cygwin users, a simple instructions on how to install ATLAS and LAPACK is prepared. See \ref pg-cygwin.
A+B;
is not good.
For another example, when
"dcovector f(const dcovector& x){ return 2*x; }"
,
f(x);
is also not good.
These are because of the "Smart-Temporary" system.
See \ref pg-nt.
Some programs to estimate the speed of CPPLapack are prepared in "benchmark" directory.
The performance of CPPLapack is almost the same as the performance of original BLAS and LAPACK. However, some of arguments of BLAS and LAPACK functions such as ALPHA, BETA, TRANS, and so on are fixed at certain values. When you want to make the full-use of BLAS and LAPACK functions, you can call their functions directory in codes of CPPLapack as usual.
(Q)I found my program using CPPLapack consuming the memory larger and larger
in a loop. Why does this happen?
(A)Most likely, you leave out some returned matrix or vector object in the loop.
Please read "Important Specification" section carefully.
(Q)When I print components of a matrix or vector,
I sometimes see "nan" printed. What is the possible reason?
(A)First of all, please make sure that your objects are initialized.
The constructor with size arguments such as
"CPPL::dgematrix A(5,10);"
does NOT initialize its array components.
The "resize" function does NOT initialize, neither.
Please initialize objects using substitutions,
or use "identity" or "zero" function to initialize them.