LA library: C++ interface to BLAS, LAPACK and CUBLAS linear algebra libraries

Since release 0.6 supporting NVIDIA CUDA GPU computing in double precision by a transparent interface to CUBLAS.

Provides also a general (sparse) matrix diagonalization, linear solver, and exponentiation templates

Now interface to Intel MKL as preferential BLAS and LAPACK in the configure script

This software provides a lightweight C++ vector and matrix class with an interface to BLAS and LAPACK linear algebra libraries and a few additional features. Templates (including some simple template metaprogramming) are employed in order to achieve generic applicability of the algorithms (generic programming). In particular, iterative methods suitable for sparse matrices (Davidson diagonalization [modified Lanczos diagonalization algorithm], linear solvers, matrix exponential) can be applied to your custom matrix class, which does not need to provide any explicit storage of the matrix elements (only matrix times vector operation has to be implemented). (In quantum chemistry, a particular application of this technique is called direct-CI.) The library implements reference counting to avoid overhead when copying matrices and passing them by value; on the other hand it does NOT optimize matrix expressions by late evaluation etc.
The GPU computing is supported in a transparent way; the same code can work on matrix and vector objects both in CPU or in GPU memory; memory location of operands is inherited by the results to avoid unnecessary CPU-GPU memory transfers.

Documentation (not complete yet) to the most recent version of the LA library, as generated by Doxygen, is available here in HTML format and here in PDF format.

LA library installation instructions

As a prerequisity, install BLAS and LAPACK, for example Intel MKL
Set paths to include and library files, for example in csh:
setenv CXXFLAGS "-I/opt/intel/composer_xe_2013_sp1.1.106/mkl/include/"
setenv LDFLAGS "-L/opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/"
setenv LD_LIBRARY_PATH /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/
(optionally) autoreconf --install
./configure (options)
make install

Version 1.2 released on Oct 7, 2021 added support for permutations, partitions, Sn group, and polynomials; minor bugfixes and compatibility fixes
Version 1.1 released on Apr 21, 2021 minor bugfixes and migration to GIT
Version 0.10 released on Jan 12, 2020 minor bugfixes, new classes for quaternions and SO(3) rotation matrices (compatible with LA classes, but independently compilable, not relying on BLAS and usable on microcontrollers)
Version 0.9 released on Nov 13, 2019 configure support for Intel MKL, minor bugfixes, and extensions to class fourindex
Version 0.8 released on June 29, 2016 minor bugfixes
Version 0.7 released on Oct. 27, 2014 minor bugfixes and support of SVD of complex matrices
Version 0.6 released on Sept. 8, 2010 adds GPU computing support via CUBLAS, brings Doxygen documentation, some bugfixes and minor improvements.
Version 0.5 released on Nov. 13, 2009 encloses the library in namespace "LA", contains a new class for sparse symmetric matrices, some bugfixes and an improved configure script.
Version 0.4 released on Oct. 7, 2009 employs GNU autoconf/automake for a more user-friendly installation.
Version 0.3 released on Sept. 13, 2009 contains minor bugfixes and improvements again.
Version 0.2 contains minor bugfixes and improvements and has been checked to work with gcc-4.3.2.
Version 0.1 is an initial release, use it at your own risc. The library has already been in use, but not every function/method has been thoroughly tested. Only a very limited subset of LAPACK routines is presently interfaced, the selection was determined solely by the needs of our research in quantum chemistry.
I will appreciate your bugfixes, enhancements, suggestions and comments.
Jiri Pittner

Development GIT repository of the LA library is at

This software is distributed under the Gnu General Public License (v3).

Download release 1.2 (tar.bz2)
Download release 1.1 (tar.bz2)
Download release 0.10 (tar.bz2)
Download release 0.9 (tar.bz2)
Download release 0.8 (tar.bz2)
Download release 0.7 (tar.bz2)
Download release 0.6 (tar.bz2)
Download release 0.5 (tar.bz2)
Download release 0.4 (tar.bz2)
Download release 0.3 (tar.bz2)
Download release 0.2 (tar.bz2)
Download release 0.1 (tar.bz2)