GSL CBLAS Library
*****************

The prototypes for the low-level CBLAS functions are declared in the file gsl_cblas.h.  For the definition of the functions consult the documentation available from Netlib.

Level 1
=======

 -- Function: float cblas_sdsdot (const int N, const float ALPHA, const float *X, const int INCX, const float *Y, const int INCY)

 -- Function: double cblas_dsdot (const int N, const float *X, const int INCX, const float *Y, const int INCY)

 -- Function: float cblas_sdot (const int N, const float *X, const int INCX, const float *Y, const int INCY)

 -- Function: double cblas_ddot (const int N, const double *X, const int INCX, const double *Y, const int INCY)

 -- Function: void cblas_cdotu_sub (const int N, const void *X, const int INCX, const void *Y, const int INCY, void *DOTU)

 -- Function: void cblas_cdotc_sub (const int N, const void *X, const int INCX, const void *Y, const int INCY, void *DOTC)

 -- Function: void cblas_zdotu_sub (const int N, const void *X, const int INCX, const void *Y, const int INCY, void *DOTU)

 -- Function: void cblas_zdotc_sub (const int N, const void *X, const int INCX, const void *Y, const int INCY, void *DOTC)

 -- Function: float cblas_snrm2 (const int N, const float *X, const int INCX)

 -- Function: float cblas_sasum (const int N, const float *X, const int INCX)

 -- Function: double cblas_dnrm2 (const int N, const double *X, const int INCX)

 -- Function: double cblas_dasum (const int N, const double *X, const int INCX)

 -- Function: float cblas_scnrm2 (const int N, const void *X, const int INCX)

 -- Function: float cblas_scasum (const int N, const void *X, const int INCX)

 -- Function: double cblas_dznrm2 (const int N, const void *X, const int INCX)

 -- Function: double cblas_dzasum (const int N, const void *X, const int INCX)

 -- Function: CBLAS_INDEX cblas_isamax (const int N, const float *X, const int INCX)

 -- Function: CBLAS_INDEX cblas_idamax (const int N, const double *X, const int INCX)

 -- Function: CBLAS_INDEX cblas_icamax (const int N, const void *X, const int INCX)

 -- Function: CBLAS_INDEX cblas_izamax (const int N, const void *X, const int INCX)

 -- Function: void cblas_sswap (const int N, float *X, const int INCX, float *Y, const int INCY)

 -- Function: void cblas_scopy (const int N, const float *X, const int INCX, float *Y, const int INCY)

 -- Function: void cblas_saxpy (const int N, const float ALPHA, const float *X, const int INCX, float *Y, const int INCY)

 -- Function: void cblas_dswap (const int N, double *X, const int INCX, double *Y, const int INCY)

 -- Function: void cblas_dcopy (const int N, const double *X, const int INCX, double *Y, const int INCY)

 -- Function: void cblas_daxpy (const int N, const double ALPHA, const double *X, const int INCX, double *Y, const int INCY)

 -- Function: void cblas_cswap (const int N, void *X, const int INCX, void *Y, const int INCY)

 -- Function: void cblas_ccopy (const int N, const void *X, const int INCX, void *Y, const int INCY)

 -- Function: void cblas_caxpy (const int N, const void *ALPHA, const void *X, const int INCX, void *Y, const int INCY)

 -- Function: void cblas_zswap (const int N, void *X, const int INCX, void *Y, const int INCY)

 -- Function: void cblas_zcopy (const int N, const void *X, const int INCX, void *Y, const int INCY)

 -- Function: void cblas_zaxpy (const int N, const void *ALPHA, const void *X, const int INCX, void *Y, const int INCY)

 -- Function: void cblas_srotg (float *A, float *B, float *C, float *S)

 -- Function: void cblas_srotmg (float *D1, float *D2, float *B1, const float B2, float *P)

 -- Function: void cblas_srot (const int N, float *X, const int INCX, float *Y, const int INCY, const float C, const float S)

 -- Function: void cblas_srotm (const int N, float *X, const int INCX, float *Y, const int INCY, const float *P)

 -- Function: void cblas_drotg (double *A, double *B, double *C, double *S)

 -- Function: void cblas_drotmg (double *D1, double *D2, double *B1, const double B2, double *P)

 -- Function: void cblas_drot (const int N, double *X, const int INCX, double *Y, const int INCY, const double C, const double S)

 -- Function: void cblas_drotm (const int N, double *X, const int INCX, double *Y, const int INCY, const double *P)

 -- Function: void cblas_sscal (const int N, const float ALPHA, float *X, const int INCX)

 -- Function: void cblas_dscal (const int N, const double ALPHA, double *X, const int INCX)

 -- Function: void cblas_cscal (const int N, const void *ALPHA, void *X, const int INCX)

 -- Function: void cblas_zscal (const int N, const void *ALPHA, void *X, const int INCX)

 -- Function: void cblas_csscal (const int N, const float ALPHA, void *X, const int INCX)

 -- Function: void cblas_zdscal (const int N, const double ALPHA, void *X, const int INCX)

Level 2
=======

 -- Function: void cblas_sgemv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const float ALPHA, const float *A, const int LDA, const float *X, const int INCX, const float BETA, float *Y, const int INCY)

 -- Function: void cblas_sgbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const int KL, const int KU, const float ALPHA, const float *A, const int LDA, const float *X, const int INCX, const float BETA, float *Y, const int INCY)

 -- Function: void cblas_strmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const float *A, const int LDA, float *X, const int INCX)

 -- Function: void cblas_stbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const float *A, const int LDA, float *X, const int INCX)

 -- Function: void cblas_stpmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const float *AP, float *X, const int INCX)

 -- Function: void cblas_strsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const float *A, const int LDA, float *X, const int INCX)

 -- Function: void cblas_stbsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const float *A, const int LDA, float *X, const int INCX)

 -- Function: void cblas_stpsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const float *AP, float *X, const int INCX)

 -- Function: void cblas_dgemv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const double ALPHA, const double *A, const int LDA, const double *X, const int INCX, const double BETA, double *Y, const int INCY)

 -- Function: void cblas_dgbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const int KL, const int KU, const double ALPHA, const double *A, const int LDA, const double *X, const int INCX, const double BETA, double *Y, const int INCY)

 -- Function: void cblas_dtrmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const double *A, const int LDA, double *X, const int INCX)

 -- Function: void cblas_dtbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const double *A, const int LDA, double *X, const int INCX)

 -- Function: void cblas_dtpmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const double *AP, double *X, const int INCX)

 -- Function: void cblas_dtrsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const double *A, const int LDA, double *X, const int INCX)

 -- Function: void cblas_dtbsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const double *A, const int LDA, double *X, const int INCX)

 -- Function: void cblas_dtpsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const double *AP, double *X, const int INCX)

 -- Function: void cblas_cgemv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_cgbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const int KL, const int KU, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_ctrmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ctbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ctpmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *AP, void *X, const int INCX)

 -- Function: void cblas_ctrsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ctbsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ctpsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *AP, void *X, const int INCX)

 -- Function: void cblas_zgemv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_zgbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_TRANSPOSE TRANSA, const int M, const int N, const int KL, const int KU, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_ztrmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ztbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ztpmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *AP, void *X, const int INCX)

 -- Function: void cblas_ztrsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ztbsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const int K, const void *A, const int LDA, void *X, const int INCX)

 -- Function: void cblas_ztpsv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const enum CBLAS_TRANSPOSE TRANSA, const enum CBLAS_DIAG DIAG, const int N, const void *AP, void *X, const int INCX)

 -- Function: void cblas_ssymv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const float *A, const int LDA, const float *X, const int INCX, const float BETA, float *Y, const int INCY)

 -- Function: void cblas_ssbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const int K, const float ALPHA, const float *A, const int LDA, const float *X, const int INCX, const float BETA, float *Y, const int INCY)

 -- Function: void cblas_sspmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const float *AP, const float *X, const int INCX, const float BETA, float *Y, const int INCY)

 -- Function: void cblas_sger (const enum CBLAS_ORDER ORDER, const int M, const int N, const float ALPHA, const float *X, const int INCX, const float *Y, const int INCY, float *A, const int LDA)

 -- Function: void cblas_ssyr (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const float *X, const int INCX, float *A, const int LDA)

 -- Function: void cblas_sspr (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const float *X, const int INCX, float *AP)

 -- Function: void cblas_ssyr2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const float *X, const int INCX, const float *Y, const int INCY, float *A, const int LDA)

 -- Function: void cblas_sspr2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const float *X, const int INCX, const float *Y, const int INCY, float *A)

 -- Function: void cblas_dsymv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const double *A, const int LDA, const double *X, const int INCX, const double BETA, double *Y, const int INCY)

 -- Function: void cblas_dsbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const int K, const double ALPHA, const double *A, const int LDA, const double *X, const int INCX, const double BETA, double *Y, const int INCY)

 -- Function: void cblas_dspmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const double *AP, const double *X, const int INCX, const double BETA, double *Y, const int INCY)

 -- Function: void cblas_dger (const enum CBLAS_ORDER ORDER, const int M, const int N, const double ALPHA, const double *X, const int INCX, const double *Y, const int INCY, double *A, const int LDA)

 -- Function: void cblas_dsyr (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const double *X, const int INCX, double *A, const int LDA)

 -- Function: void cblas_dspr (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const double *X, const int INCX, double *AP)

 -- Function: void cblas_dsyr2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const double *X, const int INCX, const double *Y, const int INCY, double *A, const int LDA)

 -- Function: void cblas_dspr2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const double *X, const int INCX, const double *Y, const int INCY, double *A)

 -- Function: void cblas_chemv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_chbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const int K, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_chpmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *AP, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_cgeru (const enum CBLAS_ORDER ORDER, const int M, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *A, const int LDA)

 -- Function: void cblas_cgerc (const enum CBLAS_ORDER ORDER, const int M, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *A, const int LDA)

 -- Function: void cblas_cher (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const void *X, const int INCX, void *A, const int LDA)

 -- Function: void cblas_chpr (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const float ALPHA, const void *X, const int INCX, void *A)

 -- Function: void cblas_cher2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *A, const int LDA)

 -- Function: void cblas_chpr2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *AP)

 -- Function: void cblas_zhemv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_zhbmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const int K, const void *ALPHA, const void *A, const int LDA, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_zhpmv (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *AP, const void *X, const int INCX, const void *BETA, void *Y, const int INCY)

 -- Function: void cblas_zgeru (const enum CBLAS_ORDER ORDER, const int M, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *A, const int LDA)

 -- Function: void cblas_zgerc (const enum CBLAS_ORDER ORDER, const int M, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *A, const int LDA)

 -- Function: void cblas_zher (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const void *X, const int INCX, void *A, const int LDA)

 -- Function: void cblas_zhpr (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const double ALPHA, const void *X, const int INCX, void *A)

 -- Function: void cblas_zher2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *A, const int LDA)

 -- Function: void cblas_zhpr2 (const enum CBLAS_ORDER ORDER, const enum CBLAS_UPLO UPLO, const int N, const void *ALPHA, const void *X, const int INCX, const void *Y, const int INCY, void *AP)

Examples
========

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

     [ 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 but could be stored in column major order if the first argument of the call to cblas_sgemm was changed to CblasColMajor.

     #include <stdio.h>
     #include <gsl/gsl_cblas.h>

     int
     main (void)
     {
       int lda = 3;

       float A[] = { 0.11, 0.12, 0.13,
                     0.21, 0.22, 0.23 };

       int ldb = 2;

       float B[] = { 1011, 1012,
                     1021, 1022,
                     1031, 1032 };

       int ldc = 2;

       float C[] = { 0.00, 0.00,
                     0.00, 0.00 };

       /* Compute C = A B */

       cblas_sgemm (CblasRowMajor,
                    CblasNoTrans, CblasNoTrans, 2, 2, 3,
                    1.0, A, lda, B, ldb, 0.0, C, ldc);

       printf("[ %g, %g\n", C[0], C[1]);
       printf("  %g, %g ]\n", C[2], C[3]);

       return 0;
     }

To compile the program use the following command line,

     gcc demo.c -lgslcblas

There is no need to link with the main library -lgsl in this case as the CBLAS library is an independent unit. Here is the output from the program,

     $ ./a.out
     [ 367.76, 368.12
       674.06, 674.72 ]