1 /*
2  *
3  * cblas_dsbmv.c
4  * This program is a C interface to dsbmv.
5  * Written by Keita Teranishi
6  * 4/6/1998
7  *
8  */
9 
10 #include "cblas.h"
11 #include "cblas_f77.h"
cblas_dsbmv(const enum CBLAS_ORDER order,const enum CBLAS_UPLO Uplo,const CBLAS_INT_TYPE N,const CBLAS_INT_TYPE K,const double alpha,const double * A,const CBLAS_INT_TYPE lda,const double * X,const CBLAS_INT_TYPE incX,const double beta,double * Y,const CBLAS_INT_TYPE incY)12 void cblas_dsbmv(const enum CBLAS_ORDER order,
13                  const enum CBLAS_UPLO Uplo, const CBLAS_INT_TYPE N, const CBLAS_INT_TYPE K,
14                  const double alpha, const double  *A, const CBLAS_INT_TYPE lda,
15                  const double  *X, const CBLAS_INT_TYPE incX, const double beta,
16                  double  *Y, const CBLAS_INT_TYPE incY)
17 {
18    char UL;
19 #ifdef F77_CHAR
20    F77_CHAR F77_UL;
21 #else
22    #define F77_UL &UL
23 #endif
24 #ifdef F77_INT
25    F77_INT F77_N=N, F77_K=K, F77_lda=lda, F77_incX=incX, F77_incY=incY;
26 #else
27    #define F77_N N
28    #define F77_K K
29    #define F77_lda lda
30    #define F77_incX incX
31    #define F77_incY incY
32 #endif
33 
34    if (order == CblasColMajor)
35    {
36       if (Uplo == CblasUpper) UL = 'U';
37       else if (Uplo == CblasLower) UL = 'L';
38       else
39       {
40          cblas_xerbla(2, "cblas_dsbmv","Illegal Uplo setting, %d\n",Uplo );
41          return;
42       }
43       #ifdef F77_CHAR
44          F77_UL = C2F_CHAR(&UL);
45       #endif
46       F77_dsbmv(F77_UL, &F77_N, &F77_K, &alpha, A, &F77_lda, X,
47                      &F77_incX, &beta, Y, &F77_incY);
48    }
49    else if (order == CblasRowMajor)
50    {
51       if (Uplo == CblasUpper) UL = 'L';
52       else if (Uplo == CblasLower) UL = 'U';
53       else
54       {
55          cblas_xerbla(2, "cblas_dsbmv","Illegal Uplo setting, %d\n", Uplo);
56          return;
57       }
58       #ifdef F77_CHAR
59          F77_UL = C2F_CHAR(&UL);
60       #endif
61       F77_dsbmv(F77_UL, &F77_N, &F77_K, &alpha,
62                      A ,&F77_lda, X,&F77_incX, &beta, Y, &F77_incY);
63    }
64    else cblas_xerbla(1, "cblas_dsbmv", "Illegal Order setting, %d\n", order);
65    return;
66 }
67