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


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