Safe, pure (prefix: blas:) Safe routines check the sizes of their input arguments. For example, if a routine is supplied arguments that indicate that an input matrix is of dimensions M-by-N, then the argument corresponding to that matrix is checked that it is of size M * N.

Pure routines do not alter their arguments in any way. A new matrix or vector is allocated for the return value of the routine.

Safe, destructive (prefix: blas:, suffix: !) Safe routines check the sizes of their input arguments. For example, if a routine is supplied arguments that indicate that an input matrix is of dimensions M-by-N, then the argument corresponding to that matrix is checked that it is of size M * N.

Destructive routines can modify some or all of their arguments. They are given names ending in exclamation mark. Please consult the BLAS documentation to determine which functions modify their input arguments.

Unsafe, destructive (prefix: unsafe-blas:, suffix: !) Unsafe routines do not check the sizes of their input arguments. They invoke the corresponding BLAS routines directly. Unsafe routines do not have pure variants.

For example, function xGEMM (matrix-matrix multiplication) comes in the following variants:

BLAS name

Safe, pure

Safe, destructive

Unsafe, destructive

SGEMM

blas:sgemm

blas:sgemm!

unsafe-blas:sgemm!

DGEMM

blas:dgemm

blas:dgemm!

unsafe-blas:dgemm!

CGEMM

blas:cgemm

blas:cgemm!

unsafe-blas:cgemm!

ZGEMM

blas:zgemm

blas:zgemm!

unsafe-blas:zgemm!

Vector copy routines

These procedures return a copy of given input SRFI-4 vector. The returned vector is allocated with the corresponding SRFI-4 constructor, and the input vector is copied to it by the corresponding BLAS copy procedure.

BLAS level 1 routines

Conventions

The BLAS level 1 procedures in this egg differ from the actual routines they invoke by the position of the vector increment arguments (INCX and INCY). In this egg, these arguments are optional; the default value of INCX and INCY is 1.

In the procedure signatures below, these optional arguments are indicated by [ and ] (square brackets).

Sum of absolute values of the elements in a vector

xAMAX searches a vector for the first occurrence of its maximum absolute value, and returns the index of that element.

BLAS level 2 routines

Conventions

The BLAS level 2 procedures in this egg differ from the actual routines they invoke by the position of the leading dimension argument (LDA) and the vector increment arguments (INCX and INCY). In this egg, these arguments are optional; the default value of LDAis the largest matrix dimension, depending on the semantics of the respective operation, and the default value of INCX and INCY is 1.

In the procedure signatures below, these optional arguments are indicated by [ and ] (square brackets).

Argument ORDER is one of blas:RowMajor or blas:ColMajor to indicate that the input and output matrices are in row-major or column-major form, respectively.

Where present, argument TRANS can be one of blas:NoTrans or blas:Trans to indicate whether the input matrix is to be transposed or not.

Where present, argument UPLO can be one of blas:Upper or blas:Lower to indicate whether the upper or lower triangular part of an input symmetric matrix is to referenced,or to specify the type of an input triangular matrix.

Where present, argument DIAG can be one of blas:NonUnit or blas:Unit to indicate whether an input triangular matrix is unit triangular or not.

ALPHA is a scalar, X and Y are N element vectors, and A is an N x N symmetric matrix.

BLAS level 3 routines

Conventions

The BLAS level 3 procedures in this egg differ from the actual routines they invoke by the position of the leading dimension arguments (LDA, LDB, and LDC). In this egg, these arguments are optional, and their default values are set to the largest matrix dimension, depending on the semantics of the respective operation.

In the procedure signatures below, these optional arguments are indicated by [ and ] (square brackets).

Argument ORDER is one of blas:RowMajor or blas:ColMajor to indicate that the input and output matrices are in row-major or column-major form, respectively.

Where present, arguments TRANS, TRANSA, TRANSB can be one of blas:NoTrans or blas:Trans to indicate whether the respective input matrices are to be transposed or not.

Where present, argument SIDE can be one of blas:Left or blas:Right to indicate whether an input symmetric matrix appears on the left or right in the respective operation.

Where present, argument UPLO can be one of blas:Upper or blas:Lower to indicate whether the upper or lower triangular part of an input symmetric matrix is to referenced,or to specify the type of an input triangular matrix.

Where present, argument DIAG can be one of blas:NonUnit or blas:Unit to indicate whether an input triangular matrix is unit triangular or not.

An overhaul of the library to introduce safe, unsafe, and pure variants of each routine

1.8

Added icopy procedures [by Ivan Raikov]

1.7

Support for Mac OS X added [by Will Farr]

1.6

Fixed bug in blas library test code

1.5

Added support for CLAPACK [by Ivan Raikov]

1.4

Added support for atlas CBLAS library [by Stu Glaser]

1.3

Tries to find a proper CBLAS library (currently only GSL)

1.2

Adapted to new FFI macro-names

1.1

Adapted to new setup scheme

License

Copyright (c) 2003-2006, Felix L. Winkelmann
Copyright (c) 2007-2010 Ivan Raikov
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.