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