]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - blis/frame/compat/cblas/src/cblas_sgbmv.c
TI Linear Algebra Library (LINALG) Rlease 1.0.0
[dense-linear-algebra-libraries/linalg.git] / blis / frame / compat / cblas / src / cblas_sgbmv.c
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_sgbmv.c
9  * This program is a C interface to sgbmv.
10  * Written by Keita Teranishi
11  * 4/6/1998
12  *
13  */
15 #include "cblas.h"
16 #include "cblas_f77.h"
17 void cblas_sgbmv(const enum CBLAS_ORDER order,
18                  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
19                  const int KL, const int KU,
20                  const float alpha, const float *A, const int lda,
21                  const float  *X, const int incX, const float beta,
22                  float  *Y, const int incY)
23 {
24    char TA;
25 #ifdef F77_CHAR
26    F77_CHAR F77_TA;
27 #else
28    #define F77_TA &TA   
29 #endif
30 #ifdef F77_INT
31    F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_incX=incX, F77_incY=incY;
32    F77_INT F77_KL=KL,F77_KU=KU;
33 #else
34    #define F77_M M
35    #define F77_N N
36    #define F77_lda lda
37    #define F77_KL KL
38    #define F77_KU KU
39    #define F77_incX incX
40    #define F77_incY incY
41 #endif
42    extern int CBLAS_CallFromC;
43    extern int RowMajorStrg;
44    RowMajorStrg = 0;
46    CBLAS_CallFromC = 1;
47    if (order == CblasColMajor)
48    {
49       if (TransA == CblasNoTrans) TA = 'N';
50       else if (TransA == CblasTrans) TA = 'T';
51       else if (TransA == CblasConjTrans) TA = 'C';
52       else 
53       {
54          cblas_xerbla(2, "cblas_sgbmv","Illegal TransA setting, %d\n", TransA);
55          CBLAS_CallFromC = 0;
56          RowMajorStrg = 0;
57          return;
58       }
59       #ifdef F77_CHAR
60          F77_TA = C2F_CHAR(&TA);
61       #endif
62       F77_sgbmv(F77_TA, &F77_M, &F77_N, &F77_KL, &F77_KU, &alpha,  
63                      A, &F77_lda, X, &F77_incX, &beta, Y, &F77_incY);
64    }
65    else if (order == CblasRowMajor)
66    {
67       RowMajorStrg = 1;
68       if (TransA == CblasNoTrans) TA = 'T';
69       else if (TransA == CblasTrans) TA = 'N';
70       else if (TransA == CblasConjTrans) TA = 'N';
71       else 
72       {
73          cblas_xerbla(2, "cblas_sgbmv","Illegal TransA setting, %d\n", TransA);
74          CBLAS_CallFromC = 0;
75          RowMajorStrg = 0;
76          return;
77       }
78       #ifdef F77_CHAR
79          F77_TA = C2F_CHAR(&TA);
80       #endif
81       F77_sgbmv(F77_TA, &F77_N, &F77_M, &F77_KU, &F77_KL, &alpha, 
82                      A ,&F77_lda, X, &F77_incX, &beta, Y, &F77_incY);
83    }
84    else cblas_xerbla(1, "cblas_sgbmv", "Illegal Order setting, %d\n", order);
85    CBLAS_CallFromC = 0;
86    RowMajorStrg = 0;
87    return;
88 }
89 #endif