cblas_dtrmv.c
Go to the documentation of this file.
00001 /*
00002  *
00003  * cblas_dtrmv.c
00004  * This program is a C interface to sgemv.
00005  * Written by Keita Teranishi
00006  * 4/6/1998
00007  *
00008  */
00009  
00010 #include "cblas.h"
00011 #include "cblas_f77.h"
00012 void cblas_dtrmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
00013                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
00014                  const int N, const double  *A, const int lda,
00015                  double  *X, const int incX)
00016 
00017 {
00018    char TA;
00019    char UL;
00020    char DI;
00021 #ifdef F77_CHAR
00022    F77_CHAR F77_TA, F77_UL, F77_DI;
00023 #else
00024    #define F77_TA &TA
00025    #define F77_UL &UL
00026    #define F77_DI &DI   
00027 #endif
00028 #ifdef F77_INT
00029    F77_INT F77_N=N, F77_lda=lda, F77_incX=incX;
00030 #else
00031    #define F77_N N
00032    #define F77_lda lda
00033    #define F77_incX incX
00034 #endif
00035    extern int CBLAS_CallFromC;
00036    extern int RowMajorStrg;
00037    RowMajorStrg = 0;
00038 
00039    CBLAS_CallFromC = 1;
00040    if (order == CblasColMajor)
00041    {
00042       if (Uplo == CblasUpper) UL = 'U';
00043       else if (Uplo == CblasLower) UL = 'L';
00044       else 
00045       {
00046          cblas_xerbla(2, "cblas_dtrmv","Illegal Uplo setting, %d\n", Uplo);
00047          CBLAS_CallFromC = 0;
00048          RowMajorStrg = 0;
00049          return;
00050       }
00051       if (TransA == CblasNoTrans) TA = 'N';
00052       else if (TransA == CblasTrans) TA = 'T';
00053       else if (TransA == CblasConjTrans) TA = 'C';
00054       else 
00055       {
00056          cblas_xerbla(3, "cblas_dtrmv","Illegal TransA setting, %d\n", TransA);
00057          CBLAS_CallFromC = 0;
00058          RowMajorStrg = 0;
00059          return;
00060       }
00061       if (Diag == CblasUnit) DI = 'U';
00062       else if (Diag == CblasNonUnit) DI = 'N';
00063       else 
00064       {
00065          cblas_xerbla(4, "cblas_dtrmv","Illegal Diag setting, %d\n", Diag);
00066          CBLAS_CallFromC = 0;
00067          RowMajorStrg = 0;
00068          return;
00069       }
00070       #ifdef F77_CHAR
00071          F77_UL = C2F_CHAR(&UL);
00072          F77_TA = C2F_CHAR(&TA);
00073          F77_DI = C2F_CHAR(&DI);
00074       #endif
00075       F77_dtrmv( F77_UL, F77_TA, F77_DI, &F77_N, A, &F77_lda, X,
00076                       &F77_incX);
00077    }
00078    else if (order == CblasRowMajor)
00079    {
00080       RowMajorStrg = 1;
00081       if (Uplo == CblasUpper) UL = 'L';
00082       else if (Uplo == CblasLower) UL = 'U';
00083       else 
00084       {
00085          cblas_xerbla(2, "cblas_dtrmv","Illegal Uplo setting, %d\n", Uplo);
00086          CBLAS_CallFromC = 0;
00087          RowMajorStrg = 0;
00088          return;
00089       }
00090 
00091       if (TransA == CblasNoTrans) TA = 'T';
00092       else if (TransA == CblasTrans) TA = 'N';
00093       else if (TransA == CblasConjTrans) TA = 'N';
00094       else 
00095       {
00096          cblas_xerbla(3, "cblas_dtrmv","Illegal TransA setting, %d\n", TransA);
00097          CBLAS_CallFromC = 0;
00098          RowMajorStrg = 0;
00099          return;
00100       }
00101 
00102       if (Diag == CblasUnit) DI = 'U';
00103       else if (Diag == CblasNonUnit) DI = 'N';
00104       else 
00105       {
00106          cblas_xerbla(4, "cblas_dtrmv","Illegal Diag setting, %d\n", Diag);
00107          CBLAS_CallFromC = 0;
00108          RowMajorStrg = 0;
00109          return;
00110       }
00111       #ifdef F77_CHAR
00112          F77_UL = C2F_CHAR(&UL);
00113          F77_TA = C2F_CHAR(&TA);
00114          F77_DI = C2F_CHAR(&DI);
00115       #endif
00116       F77_dtrmv( F77_UL, F77_TA, F77_DI, &F77_N, A, &F77_lda, X,
00117                       &F77_incX);
00118    } else cblas_xerbla(1, "cblas_dtrmv", "Illegal order setting, %d\n", order);
00119    CBLAS_CallFromC = 0;
00120    RowMajorStrg = 0;
00121    return;
00122 }


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