An Ada 95 binding to the BLAS

Introduction

The "BLAS" is a Fortran library of Basic Linear Algebra Subprograms, routines for doing fundamental vector and matrix operations. These operations are grouped into "level 1", "level 2" and "level 3". Level 1 performs vector-vector operations, for example dot products. Level 2 performs matrix-vector operations, such as the product of a matrix and a vector. Level 3 performs matrix-matrix operations, for example multiplying two matrices. Efficient implementations of the BLAS exist for many platforms. A reference implementation and documentation can be obtained from NETLIB. Thanks to their efficiency, portability and availability, the BLAS are widely used, for example by LAPACK.

Ada 95

Ada is a high level standardized (ANSI/ISO/IEC-8652:1995) programming language. Ada 95 is the latest revision of the original standard. Ada is typically used in applications where robustness and correctness are of particular importance. Information about Ada, Ada tools, compilers and the Ada community can be found at www.adapower.com.

The binding

Here is the binding as a compressed tar file. In addition to the binding, the tar file contains a copy of this page as well as the copyright notices. The binding is also available as a text file in which the various routines are simply listed one after the other. Depending on your compiler, you may need to cut it up into the individual files. A tool like gnatchop (part of the GNAT distribution) can do this for you.

Copyright

The copyright for this binding is held by the Centre National de la Recherche Scientifique (CNRS). The copyright and licence notice can be found here. Note that, as described precisely in the notice, the binding is distributed under the GNU General Public License with a special exception that allows programs to use the binding without necessarily themselves becoming subject to the GNU General Public License as a consequence.

Structure

The binding consists of the following packages:

Please read the package specifications. You can browse the source here.

You will also find the following, which while not strictly speaking part of the binding will hopefully be helpful:

Warnings

Advice and troubleshooting

General principles

This is a thin binding. Each Fortran subroutine has been directly translated into an Ada subprogram. Here is an example that illustrates the rules of translation. The Fortran subroutine
      SUBROUTINE DGEMV ( TRANS, M, N, ALPHA, A, LDA, X, INCX,
     $                   BETA, Y, INCY )
*     .. Scalar Arguments ..
      DOUBLE PRECISION   ALPHA, BETA
      INTEGER            INCX, INCY, LDA, M, N
      CHARACTER*1        TRANS
*     .. Array Arguments ..
      DOUBLE PRECISION   A( LDA, * ), X( * ), Y( * )
corresponds to
   procedure GEMV (
     TRANS : in     Transpose_Type;
     M     : in     Natural;
     N     : in     Natural;
     ALPHA : in     Float_Type'Base;
     A     : in     Matrix_Type;
     X     : in     Vector_Type;
     INCX  : in     Integer;
     BETA  : in     Float_Type'Base;
     Y     : in out Vector_Type;
     INCY  : in     Integer
   );
The translation rules are:

Feedback

Please send me bug reports, suggestion, comments, jokes and so forth.

Back to Duncan's home page.