cblas_sgemv.c
Go to the documentation of this file.
00001 /*
00002  *
00003  * cblas_sgemv.c
00004  * This program is a C interface to sgemv.
00005  * Written by Keita Teranishi
00006  * 4/6/1998
00007  * 
00008  */
00009 #include "cblas.h"
00010 #include "cblas_f77.h"
00011 void cblas_sgemv(const enum CBLAS_ORDER order,
00012                  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
00013                  const float alpha, const float  *A, const int lda,
00014                  const float  *X, const int incX, const float beta,
00015                  float  *Y, const int incY)
00016 {
00017    char TA;
00018 #ifdef F77_CHAR
00019    F77_CHAR F77_TA;
00020 #else
00021    #define F77_TA &TA   
00022 #endif
00023 #ifdef F77_INT
00024    F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_incX=incX, F77_incY=incY;
00025 #else
00026    #define F77_M M
00027    #define F77_N N
00028    #define F77_lda lda
00029    #define F77_incX incX
00030    #define F77_incY incY
00031 #endif
00032 
00033    extern int CBLAS_CallFromC;
00034    extern int RowMajorStrg;
00035    RowMajorStrg = 0;
00036 
00037    CBLAS_CallFromC = 1;
00038    if (order == CblasColMajor)
00039    {
00040       if (TransA == CblasNoTrans) TA = 'N';
00041       else if (TransA == CblasTrans) TA = 'T';
00042       else if (TransA == CblasConjTrans) TA = 'C';
00043       else 
00044       {
00045          cblas_xerbla(2, "cblas_sgemv","Illegal TransA setting, %d\n", TransA);
00046          CBLAS_CallFromC = 0;
00047          RowMajorStrg = 0;
00048       }
00049       #ifdef F77_CHAR
00050          F77_TA = C2F_CHAR(&TA);
00051       #endif
00052       F77_sgemv(F77_TA, &F77_M, &F77_N, &alpha, A, &F77_lda, X, &F77_incX, 
00053                 &beta, Y, &F77_incY);
00054    }
00055    else if (order == CblasRowMajor)
00056    {
00057       RowMajorStrg = 1;
00058       if (TransA == CblasNoTrans) TA = 'T';
00059       else if (TransA == CblasTrans) TA = 'N';
00060       else if (TransA == CblasConjTrans) TA = 'N';
00061       else 
00062       {
00063          cblas_xerbla(2, "cblas_sgemv", "Illegal TransA setting, %d\n", TransA);
00064          CBLAS_CallFromC = 0;
00065          RowMajorStrg = 0;
00066          return;
00067       }
00068       #ifdef F77_CHAR
00069          F77_TA = C2F_CHAR(&TA);
00070       #endif
00071       F77_sgemv(F77_TA, &F77_N, &F77_M, &alpha, A, &F77_lda, X,
00072                 &F77_incX, &beta, Y, &F77_incY);
00073    }
00074    else cblas_xerbla(1, "cblas_sgemv", "Illegal Order setting, %d\n", order);
00075    CBLAS_CallFromC = 0;
00076    RowMajorStrg = 0;
00077    return;
00078 }


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:15