1 #include "bli_config.h"
2 #include "bli_system.h"
3 #include "bli_type_defs.h"
4 #include "bli_cblas.h"
5 #ifdef BLIS_ENABLE_CBLAS
6 /*
7 *
8 * cblas_dgbmv.c
9 * This program is a C interface to dgbmv.
10 * Written by Keita Teranishi
11 * 4/6/1998
12 *
13 */
14 #include "cblas.h"
15 #include "cblas_f77.h"
16 void cblas_dgbmv(const enum CBLAS_ORDER order,
17 const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
18 const int KL, const int KU,
19 const double alpha, const double *A, const int lda,
20 const double *X, const int incX, const double beta,
21 double *Y, const int incY)
22 {
23 char TA;
24 #ifdef F77_CHAR
25 F77_CHAR F77_TA;
26 #else
27 #define F77_TA &TA
28 #endif
29 #ifdef F77_INT
30 F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_incX=incX, F77_incY=incY;
31 F77_INT F77_KL=KL,F77_KU=KU;
32 #else
33 #define F77_M M
34 #define F77_N N
35 #define F77_lda lda
36 #define F77_KL KL
37 #define F77_KU KU
38 #define F77_incX incX
39 #define F77_incY incY
40 #endif
41 extern int CBLAS_CallFromC;
42 extern int RowMajorStrg;
43 RowMajorStrg = 0;
45 CBLAS_CallFromC = 1;
46 if (order == CblasColMajor)
47 {
48 if (TransA == CblasNoTrans) TA = 'N';
49 else if (TransA == CblasTrans) TA = 'T';
50 else if (TransA == CblasConjTrans) TA = 'C';
51 else
52 {
53 cblas_xerbla(2, "cblas_dgbmv","Illegal TransA setting, %d\n", TransA);
54 CBLAS_CallFromC = 0;
55 RowMajorStrg = 0;
56 return;
57 }
58 #ifdef F77_CHAR
59 F77_TA = C2F_CHAR(&TA);
60 #endif
61 F77_dgbmv(F77_TA, &F77_M, &F77_N, &F77_KL, &F77_KU, &alpha,
62 A, &F77_lda, X, &F77_incX, &beta, Y, &F77_incY);
63 }
64 else if (order == CblasRowMajor)
65 {
66 RowMajorStrg = 1;
67 if (TransA == CblasNoTrans) TA = 'T';
68 else if (TransA == CblasTrans) TA = 'N';
69 else if (TransA == CblasConjTrans) TA = 'N';
70 else
71 {
72 cblas_xerbla(2, "cblas_dgbmv","Illegal TransA setting, %d\n", TransA);
73 CBLAS_CallFromC = 0;
74 RowMajorStrg = 0;
75 return;
76 }
77 #ifdef F77_CHAR
78 F77_TA = C2F_CHAR(&TA);
79 #endif
80 F77_dgbmv(F77_TA, &F77_N, &F77_M, &F77_KU, &F77_KL, &alpha,
81 A ,&F77_lda, X,&F77_incX, &beta, Y, &F77_incY);
82 }
83 else cblas_xerbla(1, "cblas_dgbmv", "Illegal Order setting, %d\n", order);
84 CBLAS_CallFromC = 0;
85 RowMajorStrg = 0;
86 }
87 #endif