The Basic Linear Algebra Subprograms (BLAS) define a set of fundamental operations on vectors and matrices which can be used to create optimized higher-level linear algebra functionality.

The library provides a low-level layer which corresponds directly to the C-language BLAS standard, referred to here as ``CBLAS'', and a higher-level interface for operations on GSL vectors and matrices. Users who are interested in simple operations on GSL vector and matrix objects should use the high-level layer, which is declared in the file gsl_blas.h.  This should satisfy the needs of most users.  Note that GSL matrices are implemented using dense-storage so the interface only includes the corresponding dense-storage BLAS functions.  The full BLAS functionality for band-format and packed-format matrices is available through the low-level CBLAS interface.

The interface for the gsl_cblas layer is specified in the file gsl_cblas.h.  This interface corresponds to the BLAS Technical Forum's draft standard for the C interface to legacy BLAS implementations. Users who have access to other conforming CBLAS implementations can use these in place of the version provided by the library.  Note that users who have only a Fortran BLAS library can use a CBLAS conformant wrapper to convert it into a CBLAS library.  A reference CBLAS wrapper for legacy Fortran implementations exists as part of the draft CBLAS standard and can be obtained from Netlib.  The complete set of CBLAS functions is listed in an appendix (see GSL CBLAS Library).

There are three levels of BLAS operations,

Level 1
     Vector operations, e.g. y = \alpha x + y

Level 2
     Matrix-vector operations, e.g. y = \alpha A x + \beta y

Level 3
     Matrix-matrix operations, e.g. C = \alpha A B + C

Each routine has a name which specifies the operation, the type of matrices involved and their precisions.  Some of the most common operations and their names are given below,

DOT
     scalar product, x^T y

AXPY
     vector sum, \alpha x + y

MV
     matrix-vector product, A x

SV
     matrix-vector solve, inv(A) x

MM
     matrix-matrix product, A B

SM
     matrix-matrix solve, inv(A) B

The types of matrices are,

GE
     general

GB
     general band

SY
     symmetric

SB
     symmetric band

SP
     symmetric packed

HE
     hermitian

HB
     hermitian band

HP
     hermitian packed

TR
     triangular

TB
     triangular band

TP
     triangular packed

Each operation is defined for four precisions,

S
     single real

D
     double real

C
     single complex

Z
     double complex

Thus, for example, the name SGEMM stands for ``single-precision general matrix-matrix multiply'' and ZGEMM stands for ``double-precision complex matrix-matrix multiply''.

GSL BLAS Interface
==================

GSL provides dense vector and matrix objects, based on the relevant built-in types.  The library provides an interface to the BLAS operations which apply to these objects.  The interface to this functionality is given in the file gsl_blas.h.

Level 1
-------

 -- Function: int gsl_blas_sdsdot (float ALPHA, const gsl_vector_float * X, const gsl_vector_float * Y, float * RESULT)
     This function computes the sum \alpha + x^T y for the vectors X and Y, returning the result in RESULT.

 -- Function: int gsl_blas_sdot (const gsl_vector_float * X, const gsl_vector_float * Y, float * RESULT)
 -- Function: int gsl_blas_dsdot (const gsl_vector_float * X, const gsl_vector_float * Y, double * RESULT)
 -- Function: int gsl_blas_ddot (const gsl_vector * X, const gsl_vector * Y, double * RESULT)
     These functions compute the scalar product x^T y for the vectors X and Y, returning the result in RESULT.

 -- Function: int gsl_blas_cdotu (const gsl_vector_complex_float * X, const gsl_vector_complex_float * Y, gsl_complex_float * DOTU)
 -- Function: int gsl_blas_zdotu (const gsl_vector_complex * X, const gsl_vector_complex * Y, gsl_complex * DOTU)
     These functions compute the complex scalar product x^T y for the vectors X and Y, returning the result in RESULT

 -- Function: int gsl_blas_cdotc (const gsl_vector_complex_float * X, const gsl_vector_complex_float * Y, gsl_complex_float * DOTC)
 -- Function: int gsl_blas_zdotc (const gsl_vector_complex * X, const gsl_vector_complex * Y, gsl_complex * DOTC)
     These functions compute the complex conjugate scalar product x^H y for the vectors X and Y, returning the result in RESULT

 -- Function: float gsl_blas_snrm2 (const gsl_vector_float * X)
 -- Function: double gsl_blas_dnrm2 (const gsl_vector * X)
     These functions compute the Euclidean norm
     $||x||_2 = \sqrt\sum x_i^2$
     ||x||_2 = \sqrt {\sum x_i^2} of the vector X.

 -- Function: float gsl_blas_scnrm2 (const gsl_vector_complex_float * X)
 -- Function: double gsl_blas_dznrm2 (const gsl_vector_complex * X)
     These functions compute the Euclidean norm of the complex vector X,

          ||x||_2 = \sqrt {\sum (\Re(x_i)^2 + \Im(x_i)^2)}.

 -- Function: float gsl_blas_sasum (const gsl_vector_float * X)
 -- Function: double gsl_blas_dasum (const gsl_vector * X)
     These functions compute the absolute sum \sum |x_i| of the elements of the vector X.

 -- Function: float gsl_blas_scasum (const gsl_vector_complex_float * X)
 -- Function: double gsl_blas_dzasum (const gsl_vector_complex * X)
     These functions compute the sum of the magnitudes of the real and
     imaginary parts of the complex vector X,
     $\sum \left( |\Re(x_i)| + |\Im(x_i)| \right)$
     \sum |\Re(x_i)| + |\Im(x_i)|.

 -- Function: CBLAS_INDEX_t gsl_blas_isamax (const gsl_vector_float * X)
 -- Function: CBLAS_INDEX_t gsl_blas_idamax (const gsl_vector * X)
 -- Function: CBLAS_INDEX_t gsl_blas_icamax (const gsl_vector_complex_float * X)
 -- Function: CBLAS_INDEX_t gsl_blas_izamax (const gsl_vector_complex * X)
     These functions return the index of the largest element of the vector X. The largest element is determined by its absolute magnitude for real vectors and by the sum of the magnitudes of the real and imaginary parts |\Re(x_i)| + |\Im(x_i)| for complex vectors.  If the largest value occurs several times then the index of the first occurrence is returned.

 -- Function: int gsl_blas_sswap (gsl_vector_float * X, gsl_vector_float * Y)
 -- Function: int gsl_blas_dswap (gsl_vector * X, gsl_vector * Y)
 -- Function: int gsl_blas_cswap (gsl_vector_complex_float * X, gsl_vector_complex_float * Y)
 -- Function: int gsl_blas_zswap (gsl_vector_complex * X, gsl_vector_complex * Y)
     These functions exchange the elements of the vectors X and Y.

 -- Function: int gsl_blas_scopy (const gsl_vector_float * X, gsl_vector_float * Y)
 -- Function: int gsl_blas_dcopy (const gsl_vector * X, gsl_vector * Y)
 -- Function: int gsl_blas_ccopy (const gsl_vector_complex_float * X, gsl_vector_complex_float * Y)
 -- Function: int gsl_blas_zcopy (const gsl_vector_complex * X, gsl_vector_complex * Y)
     These functions copy the elements of the vector X into the vector Y.

 -- Function: int gsl_blas_saxpy (float ALPHA, const gsl_vector_float * X, gsl_vector_float * Y)
 -- Function: int gsl_blas_daxpy (double ALPHA, const gsl_vector * X, gsl_vector * Y)
 -- Function: int gsl_blas_caxpy (const gsl_complex_float ALPHA, const gsl_vector_complex_float * X, gsl_vector_complex_float * Y)
 -- Function: int gsl_blas_zaxpy (const gsl_complex ALPHA, const gsl_vector_complex * X, gsl_vector_complex * Y)
     These functions compute the sum y = \alpha x + y for the vectors X and Y.

 -- Function: void gsl_blas_sscal (float ALPHA, gsl_vector_float * X)
 -- Function: void gsl_blas_dscal (double ALPHA, gsl_vector * X)
 -- Function: void gsl_blas_cscal (const gsl_complex_float ALPHA, gsl_vector_complex_float * X)
 -- Function: void gsl_blas_zscal (const gsl_complex ALPHA, gsl_vector_complex * X)
 -- Function: void gsl_blas_csscal (float ALPHA, gsl_vector_complex_float * X)
 -- Function: void gsl_blas_zdscal (double ALPHA, gsl_vector_complex * X)
     These functions rescale the vector X by the multiplicative factor ALPHA.

 -- Function: int gsl_blas_srotg (float A[], float B[], float C[], float S[])
 -- Function: int gsl_blas_drotg (double A[], double B[], double C[], double S[])
     These functions compute a Givens rotation (c,s) which zeroes the vector (a,b),

          [  c  s ] [ a ] = [ r ]
          [ -s  c ] [ b ]   [ 0 ]

     The variables A and B are overwritten by the routine.

 -- Function: int gsl_blas_srot (gsl_vector_float * X, gsl_vector_float * Y, float C, float S)
 -- Function: int gsl_blas_drot (gsl_vector * X, gsl_vector * Y, const double C, const double S)
     These functions apply a Givens rotation (x', y') = (c x + s y, -s x + c y) to the vectors X, Y.

 -- Function: int gsl_blas_srotmg (float D1[], float D2[], float B1[], float B2, float P[])
 -- Function: int gsl_blas_drotmg (double D1[], double D2[], double B1[], double B2, double P[])
     These functions compute a modified Givens transformation.  The modified Givens transformation is defined in the original Level-1 BLAS specification, given in the references.

 -- Function: int gsl_blas_srotm (gsl_vector_float * X, gsl_vector_float * Y, const float P[])
 -- Function: int gsl_blas_drotm (gsl_vector * X, gsl_vector * Y, const double P[])
     These functions apply a modified Givens transformation.

Level 2
-------

 -- Function: int gsl_blas_sgemv (CBLAS_TRANSPOSE_t TRANSA, float ALPHA, const gsl_matrix_float * A, const gsl_vector_float * X, float BETA, gsl_vector_float * Y)
 -- Function: int gsl_blas_dgemv (CBLAS_TRANSPOSE_t TRANSA, double ALPHA, const gsl_matrix * A, const gsl_vector * X, double BETA, gsl_vector * Y)
 -- Function: int gsl_blas_cgemv (CBLAS_TRANSPOSE_t TRANSA, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_vector_complex_float * X, const gsl_complex_float BETA, gsl_vector_complex_float * Y)
 -- Function: int gsl_blas_zgemv (CBLAS_TRANSPOSE_t TRANSA, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_vector_complex * X, const gsl_complex BETA, gsl_vector_complex * Y)
     These functions compute the matrix-vector product and sum y = \alpha op(A) x + \beta y, where op(A) = A, A^T, A^H for TRANSA = CblasNoTrans, CblasTrans, CblasConjTrans.

 -- Function: int gsl_blas_strmv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix_float * A, gsl_vector_float * X)
 -- Function: int gsl_blas_dtrmv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix * A, gsl_vector * X)
 -- Function: int gsl_blas_ctrmv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix_complex_float * A, gsl_vector_complex_float * X)
 -- Function: int gsl_blas_ztrmv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix_complex * A, gsl_vector_complex * X)
     These functions compute the matrix-vector product x = op(A) x for the triangular matrix A, where op(A) = A, A^T, A^H for TRANSA = CblasNoTrans, CblasTrans, CblasConjTrans.  When UPLO is CblasUpper then the upper triangle of A is used, and when UPLO is CblasLower then the lower triangle of A is used.  If DIAG is CblasNonUnit then the diagonal of the matrix is used, but if DIAG is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

 -- Function: int gsl_blas_strsv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix_float * A, gsl_vector_float * X)
 -- Function: int gsl_blas_dtrsv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix * A, gsl_vector * X)
 -- Function: int gsl_blas_ctrsv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix_complex_float * A, gsl_vector_complex_float * X)
 -- Function: int gsl_blas_ztrsv (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_matrix_complex * A, gsl_vector_complex * X)
     These functions compute inv(op(A)) x for X, where op(A) = A, A^T, A^H for TRANSA = CblasNoTrans, CblasTrans, CblasConjTrans.  When UPLO is CblasUpper then the upper triangle of A is used, and when UPLO is CblasLower then the lower triangle of A is used.  If DIAG is CblasNonUnit then the diagonal of the matrix is used, but if DIAG is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

 -- Function: int gsl_blas_ssymv (CBLAS_UPLO_t UPLO, float ALPHA, const gsl_matrix_float * A, const gsl_vector_float * X, float BETA, gsl_vector_float * Y)
 -- Function: int gsl_blas_dsymv (CBLAS_UPLO_t UPLO, double ALPHA, const gsl_matrix * A, const gsl_vector * X, double BETA, gsl_vector * Y)
     These functions compute the matrix-vector product and sum y = \alpha A x + \beta y for the symmetric matrix A.  Since the matrix A is symmetric only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.

 -- Function: int gsl_blas_chemv (CBLAS_UPLO_t UPLO, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_vector_complex_float * X, const gsl_complex_float BETA, gsl_vector_complex_float * Y)
 -- Function: int gsl_blas_zhemv (CBLAS_UPLO_t UPLO, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_vector_complex * X, const gsl_complex BETA, gsl_vector_complex * Y)
     These functions compute the matrix-vector product and sum y = \alpha A x + \beta y for the hermitian matrix A.  Since the matrix A is hermitian only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.  The imaginary elements of the diagonal are automatically assumed to be zero and are not referenced.

 -- Function: int gsl_blas_sger (float ALPHA, const gsl_vector_float * X, const gsl_vector_float * Y, gsl_matrix_float * A)
 -- Function: int gsl_blas_dger (double ALPHA, const gsl_vector * X, const gsl_vector * Y, gsl_matrix * A)
 -- Function: int gsl_blas_cgeru (const gsl_complex_float ALPHA, const gsl_vector_complex_float * X, const gsl_vector_complex_float * Y, gsl_matrix_complex_float * A)
 -- Function: int gsl_blas_zgeru (const gsl_complex ALPHA, const gsl_vector_complex * X, const gsl_vector_complex * Y, gsl_matrix_complex * A)
     These functions compute the rank-1 update A = \alpha x y^T + A of the matrix A.

 -- Function: int gsl_blas_cgerc (const gsl_complex_float ALPHA, const gsl_vector_complex_float * X, const gsl_vector_complex_float * Y, gsl_matrix_complex_float * A)
 -- Function: int gsl_blas_zgerc (const gsl_complex ALPHA, const gsl_vector_complex * X, const gsl_vector_complex * Y, gsl_matrix_complex * A)
     These functions compute the conjugate rank-1 update A = \alpha x y^H + A of the matrix A.

 -- Function: int gsl_blas_ssyr (CBLAS_UPLO_t UPLO, float ALPHA, const gsl_vector_float * X, gsl_matrix_float * A)
 -- Function: int gsl_blas_dsyr (CBLAS_UPLO_t UPLO, double ALPHA, const gsl_vector * X, gsl_matrix * A)
     These functions compute the symmetric rank-1 update A = \alpha x x^T + A of the symmetric matrix A.  Since the matrix A is symmetric only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.

 -- Function: int gsl_blas_cher (CBLAS_UPLO_t UPLO, float ALPHA, const gsl_vector_complex_float * X, gsl_matrix_complex_float * A)
 -- Function: int gsl_blas_zher (CBLAS_UPLO_t UPLO, double ALPHA, const gsl_vector_complex * X, gsl_matrix_complex * A)
     These functions compute the hermitian rank-1 update A = \alpha x x^H + A of the hermitian matrix A.  Since the matrix A is hermitian only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.  The imaginary elements of the diagonal are automatically set to zero.

 -- Function: int gsl_blas_ssyr2 (CBLAS_UPLO_t UPLO, float ALPHA, const gsl_vector_float * X, const gsl_vector_float * Y, gsl_matrix_float * A)
 -- Function: int gsl_blas_dsyr2 (CBLAS_UPLO_t UPLO, double ALPHA, const gsl_vector * X, const gsl_vector * Y, gsl_matrix * A)
     These functions compute the symmetric rank-2 update A = \alpha x y^T + \alpha y x^T + A of the symmetric matrix A.  Since the matrix A is symmetric only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.

 -- Function: int gsl_blas_cher2 (CBLAS_UPLO_t UPLO, const gsl_complex_float ALPHA, const gsl_vector_complex_float * X, const gsl_vector_complex_float * Y, gsl_matrix_complex_float * A)
 -- Function: int gsl_blas_zher2 (CBLAS_UPLO_t UPLO, const gsl_complex ALPHA, const gsl_vector_complex * X, const gsl_vector_complex * Y, gsl_matrix_complex * A)
     These functions compute the hermitian rank-2 update A = \alpha x y^H + \alpha^* y x^H A of the hermitian matrix A.  Since the matrix A is hermitian only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.  The imaginary elements of the diagonal are automatically set to zero.

Level 3
-------

 -- Function: int gsl_blas_sgemm (CBLAS_TRANSPOSE_t TRANSA, CBLAS_TRANSPOSE_t TRANSB, float ALPHA, const gsl_matrix_float * A, const gsl_matrix_float * B, float BETA, gsl_matrix_float * C)
 -- Function: int gsl_blas_dgemm (CBLAS_TRANSPOSE_t TRANSA, CBLAS_TRANSPOSE_t TRANSB, double ALPHA, const gsl_matrix * A, const gsl_matrix * B, double BETA, gsl_matrix * C)
 -- Function: int gsl_blas_cgemm (CBLAS_TRANSPOSE_t TRANSA, CBLAS_TRANSPOSE_t TRANSB, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_matrix_complex_float * B, const gsl_complex_float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zgemm (CBLAS_TRANSPOSE_t TRANSA, CBLAS_TRANSPOSE_t TRANSB, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_matrix_complex * B, const gsl_complex BETA, gsl_matrix_complex * C)
     These functions compute the matrix-matrix product and sum C = \alpha op(A) op(B) + \beta C where op(A) = A, A^T, A^H for TRANSA = CblasNoTrans, CblasTrans, CblasConjTrans and similarly for the parameter TRANSB.

 -- Function: int gsl_blas_ssymm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, float ALPHA, const gsl_matrix_float * A, const gsl_matrix_float * B, float BETA, gsl_matrix_float * C)
 -- Function: int gsl_blas_dsymm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, double ALPHA, const gsl_matrix * A, const gsl_matrix * B, double BETA, gsl_matrix * C)
 -- Function: int gsl_blas_csymm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_matrix_complex_float * B, const gsl_complex_float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zsymm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_matrix_complex * B, const gsl_complex BETA, gsl_matrix_complex * C)
     These functions compute the matrix-matrix product and sum C = \alpha A B + \beta C for SIDE is CblasLeft and C = \alpha B A + \beta C for SIDE is CblasRight, where the matrix A is symmetric.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.

 -- Function: int gsl_blas_chemm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_matrix_complex_float * B, const gsl_complex_float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zhemm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_matrix_complex * B, const gsl_complex BETA, gsl_matrix_complex * C)
     These functions compute the matrix-matrix product and sum C = \alpha A B + \beta C for SIDE is CblasLeft and C = \alpha B A + \beta C for SIDE is CblasRight, where the matrix A is hermitian.  When UPLO is CblasUpper then the upper triangle and diagonal of A are used, and when UPLO is CblasLower then the lower triangle and diagonal of A are used.  The imaginary elements of the diagonal are automatically set to zero.

 -- Function: int gsl_blas_strmm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, float ALPHA, const gsl_matrix_float * A, gsl_matrix_float * B)
 -- Function: int gsl_blas_dtrmm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, double ALPHA, const gsl_matrix * A, gsl_matrix * B)
 -- Function: int gsl_blas_ctrmm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, gsl_matrix_complex_float * B)
 -- Function: int gsl_blas_ztrmm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_complex ALPHA, const gsl_matrix_complex * A, gsl_matrix_complex * B)
     These functions compute the matrix-matrix product B = \alpha op(A) B for SIDE is CblasLeft and B = \alpha B op(A) for SIDE is CblasRight.  The matrix A is triangular and op(A) = A, A^T, A^H for TRANSA = CblasNoTrans, CblasTrans, CblasConjTrans. When UPLO is CblasUpper then the upper triangle of A is used, and when UPLO is CblasLower then the lower triangle of A is used.  If DIAG is CblasNonUnit then the diagonal of A is used, but if DIAG is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

 -- Function: int gsl_blas_strsm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, float ALPHA, const gsl_matrix_float * A, gsl_matrix_float * B)
 -- Function: int gsl_blas_dtrsm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, double ALPHA, const gsl_matrix * A, gsl_matrix * B)
 -- Function: int gsl_blas_ctrsm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, gsl_matrix_complex_float * B)
 -- Function: int gsl_blas_ztrsm (CBLAS_SIDE_t SIDE, CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANSA, CBLAS_DIAG_t DIAG, const gsl_complex ALPHA, const gsl_matrix_complex * A, gsl_matrix_complex * B)
     These functions compute the inverse-matrix matrix product B = \alpha op(inv(A))B for SIDE is CblasLeft and B = \alpha B op(inv(A)) for SIDE is CblasRight.  The matrix A is triangular and op(A) = A, A^T, A^H for TRANSA = CblasNoTrans, CblasTrans, CblasConjTrans. When UPLO is CblasUpper then the upper triangle of A is used, and when UPLO is CblasLower then the lower triangle of A is used.  If DIAG is CblasNonUnit then the diagonal of A is used, but if DIAG is CblasUnit then the diagonal elements of the matrix A are taken as unity and are not referenced.

 -- Function: int gsl_blas_ssyrk (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, float ALPHA, const gsl_matrix_float * A, float BETA, gsl_matrix_float * C)
 -- Function: int gsl_blas_dsyrk (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, double ALPHA, const gsl_matrix * A, double BETA, gsl_matrix * C)
 -- Function: int gsl_blas_csyrk (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_complex_float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zsyrk (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_complex BETA, gsl_matrix_complex * C)
     These functions compute a rank-k update of the symmetric matrix C, C = \alpha A A^T + \beta C when TRANS is CblasNoTrans and C = \alpha A^T A + \beta C when TRANS is CblasTrans.  Since the matrix C is symmetric only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of C are used, and when UPLO is CblasLower then the lower triangle and diagonal of C are used.

 -- Function: int gsl_blas_cherk (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, float ALPHA, const gsl_matrix_complex_float * A, float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zherk (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, double ALPHA, const gsl_matrix_complex * A, double BETA, gsl_matrix_complex * C)
     These functions compute a rank-k update of the hermitian matrix C, C = \alpha A A^H + \beta C when TRANS is CblasNoTrans and C = \alpha A^H A + \beta C when TRANS is CblasTrans.  Since the matrix C is hermitian only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of C are used, and when UPLO is CblasLower then the lower triangle and diagonal of C are used.  The imaginary elements of the diagonal are automatically set to zero.

 -- Function: int gsl_blas_ssyr2k (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, float ALPHA, const gsl_matrix_float * A, const gsl_matrix_float * B, float BETA, gsl_matrix_float * C)
 -- Function: int gsl_blas_dsyr2k (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, double ALPHA, const gsl_matrix * A, const gsl_matrix * B, double BETA, gsl_matrix * C)
 -- Function: int gsl_blas_csyr2k (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_matrix_complex_float * B, const gsl_complex_float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zsyr2k (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_matrix_complex * B, const gsl_complex BETA, gsl_matrix_complex * C)
     These functions compute a rank-2k update of the symmetric matrix C, C = \alpha A B^T + \alpha B A^T + \beta C when TRANS is CblasNoTrans and C = \alpha A^T B + \alpha B^T A + \beta C when TRANS is CblasTrans.  Since the matrix C is symmetric only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of C are used, and when UPLO is CblasLower then the lower triangle and diagonal of C are used.

 -- Function: int gsl_blas_cher2k (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, const gsl_complex_float ALPHA, const gsl_matrix_complex_float * A, const gsl_matrix_complex_float * B, float BETA, gsl_matrix_complex_float * C)
 -- Function: int gsl_blas_zher2k (CBLAS_UPLO_t UPLO, CBLAS_TRANSPOSE_t TRANS, const gsl_complex ALPHA, const gsl_matrix_complex * A, const gsl_matrix_complex * B, double BETA, gsl_matrix_complex * C)
     These functions compute a rank-2k update of the hermitian matrix C, C = \alpha A B^H + \alpha^* B A^H + \beta C when TRANS is CblasNoTrans and C = \alpha A^H B + \alpha^* B^H A + \beta C when TRANS is CblasConjTrans.  Since the matrix C is hermitian only its upper half or lower half need to be stored.  When UPLO is CblasUpper then the upper triangle and diagonal of C are used, and when UPLO is CblasLower then the lower triangle and diagonal of C are used.  The imaginary elements of the diagonal are automatically set to zero.

Examples
========

The following program computes the product of two matrices using the Level-3 BLAS function DGEMM,

     [ 0.11 0.12 0.13 ]  [ 1011 1012 ]     [ 367.76 368.12 ]
     [ 0.21 0.22 0.23 ]  [ 1021 1022 ]  =  [ 674.06 674.72 ]
                         [ 1031 1032 ]

The matrices are stored in row major order, according to the C convention for arrays.

          [file blas.c not included]

Here is the output from the program,

     $ ./a.out
          [file blas.out not included]

References and Further Reading
==============================

Information on the BLAS standards, including both the legacy and draft interface standards, is available online from the BLAS Homepage and BLAS Technical Forum web-site.

  BLAS Homepage

     http://www.netlib.org/blas/

  BLAS Technical Forum

     http://www.netlib.org/cgi-bin/checkout/blast/blast.pl

The following papers contain the specifications for Level 1, Level 2 and Level 3 BLAS.

  C. Lawson, R. Hanson, D. Kincaid, F. Krogh, ``Basic Linear Algebra Subprograms for Fortran Usage'', ACM Transactions on Mathematical Software, Vol. 5 (1979), Pages 308--325.

  J.J. Dongarra, J. DuCroz, S. Hammarling, R. Hanson, ``An Extended Set of Fortran Basic Linear Algebra Subprograms'', ACM Transactions on Mathematical Software, Vol. 14, No. 1 (1988), Pages 1--32.

  J.J. Dongarra, I. Duff, J. DuCroz, S. Hammarling, ``A Set of Level 3 Basic Linear Algebra Subprograms'', ACM Transactions on Mathematical Software, Vol. 16 (1990), Pages 1--28.

Postscript versions of the latter two papers are available from http://www.netlib.org/blas/. A CBLAS wrapper for Fortran BLAS libraries is available from the same location.