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