Ada 2005 Math Extensions

The purpose of this project is to provide additional matrix capabilities beyond those defined in the Standard Ada Library (Annex G of the Ada Language Reference Manual or ARM).

The Standard defines real and complex matrix and vector operations. Not every possible operation is supported, so for example only symmetric real or hermitian complex matrices can be solved.

The implementations here, which are only for GNAT, are in the form of bindings to the LAPACK and BLAS libraries which are widely available if not already provided on all operating systems.

Prior to GNAT GPL 2012 and FSF GCC 4.7, a partial set was provided as part of GNAT GPL on those platforms that don't include them natively (specifically, Windows).

The BLAS can be built to support extended-precision (80-bit floats on Intel hardware) but often isn't (for example, in the standard vecLib framework on macOS). This implementation will allow you to process Long_Long_Float but, in the same way as earlier GNATs, it translates them to and from REAL*8 (Long_Float) for processing, so any gain in precision is illusory.

Like LAPACK and the BLAS, this implementation is entirely memory-based and therefore isn't appropriate for use with large matrices. For floating-point types which correspond to Fortran types (Float for REAL*4 or COMPLEX*8, Long_Float for REAL*8 or COMPLEX*16), an extra copy is created on the stack for each input matrix; for others (Long_Long_Float on Intel hardware, or constrained:

   type My_Float is Float range Float'Range;

two extra copies are created for each input matrix and one for each output matrix. Besides this, working space is allocated as requested by LAPACK for best performance.

See the Resources for links to sparse matrix software.

Resources

LAPACK- and BLAS-related

Sparse matrices