cblas_dtrsm.c
Go to the documentation of this file.
00001 /*
00002  *
00003  * cblas_dtrsm.c
00004  * This program is a C interface to dtrsm.
00005  * Written by Keita Teranishi
00006  * 4/6/1998
00007  *
00008  */
00009 
00010 #include "cblas.h"
00011 #include "cblas_f77.h"
00012 void cblas_dtrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
00013                  const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
00014                  const enum CBLAS_DIAG Diag, const int M, const int N,
00015                  const double alpha, const double  *A, const int lda,
00016                  double  *B, const int ldb)
00017 
00018 {
00019    char UL, TA, SD, DI;   
00020 #ifdef F77_CHAR
00021    F77_CHAR F77_TA, F77_UL, F77_SD, F77_DI;
00022 #else
00023    #define F77_TA &TA  
00024    #define F77_UL &UL  
00025    #define F77_SD &SD
00026    #define F77_DI &DI
00027 #endif
00028 
00029 #ifdef F77_INT
00030    F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_ldb=ldb;
00031 #else
00032    #define F77_M M
00033    #define F77_N N
00034    #define F77_lda lda
00035    #define F77_ldb ldb
00036 #endif
00037 
00038    extern int CBLAS_CallFromC;
00039    extern int RowMajorStrg;
00040    RowMajorStrg = 0;
00041    CBLAS_CallFromC = 1;
00042 
00043    if( Order == CblasColMajor )
00044    {
00045       if      ( Side == CblasRight) SD='R';
00046       else if ( Side == CblasLeft ) SD='L';
00047       else 
00048       {
00049          cblas_xerbla(2, "cblas_dtrsm","Illegal Side setting, %d\n", Side);
00050          CBLAS_CallFromC = 0;
00051          RowMajorStrg = 0;
00052          return;
00053       }
00054       if      ( Uplo == CblasUpper) UL='U';
00055       else if ( Uplo == CblasLower) UL='L';
00056       else 
00057       {
00058          cblas_xerbla(3, "cblas_dtrsm","Illegal Uplo setting, %d\n", Uplo);
00059          CBLAS_CallFromC = 0;
00060          RowMajorStrg = 0;
00061          return;
00062       }
00063 
00064       if      ( TransA == CblasTrans    ) TA='T';
00065       else if ( TransA == CblasConjTrans) TA='C';
00066       else if ( TransA == CblasNoTrans  ) TA='N';
00067       else 
00068       {
00069          cblas_xerbla(4, "cblas_dtrsm","Illegal Trans setting, %d\n", TransA);
00070          CBLAS_CallFromC = 0;
00071          RowMajorStrg = 0;
00072          return;
00073       }
00074 
00075       if      ( Diag == CblasUnit   ) DI='U';
00076       else if ( Diag == CblasNonUnit) DI='N';
00077       else 
00078       {
00079          cblas_xerbla(5, "cblas_dtrsm","Illegal Diag setting, %d\n", Diag);
00080          CBLAS_CallFromC = 0;
00081          RowMajorStrg = 0;
00082          return;
00083       }
00084 
00085       #ifdef F77_CHAR
00086          F77_UL = C2F_CHAR(&UL);
00087          F77_TA = C2F_CHAR(&TA);
00088          F77_SD = C2F_CHAR(&SD);
00089          F77_DI = C2F_CHAR(&DI);
00090       #endif
00091 
00092       F77_dtrsm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_M, &F77_N, &alpha,
00093                 A, &F77_lda, B, &F77_ldb);
00094    } 
00095    else if (Order == CblasRowMajor)
00096    {
00097       RowMajorStrg = 1;
00098       if      ( Side == CblasRight) SD='L';
00099       else if ( Side == CblasLeft ) SD='R';
00100       else 
00101       {
00102          cblas_xerbla(2, "cblas_dtrsm","Illegal Side setting, %d\n", Side);
00103          CBLAS_CallFromC = 0;
00104          RowMajorStrg = 0;
00105          return;
00106       }
00107 
00108       if      ( Uplo == CblasUpper) UL='L';
00109       else if ( Uplo == CblasLower) UL='U';
00110       else 
00111       {
00112          cblas_xerbla(3, "cblas_dtrsm","Illegal Uplo setting, %d\n", Uplo);
00113          CBLAS_CallFromC = 0;
00114          RowMajorStrg = 0;
00115          return;
00116       }
00117 
00118       if      ( TransA == CblasTrans    ) TA='T';
00119       else if ( TransA == CblasConjTrans) TA='C';
00120       else if ( TransA == CblasNoTrans  ) TA='N';
00121       else 
00122       {
00123          cblas_xerbla(4, "cblas_dtrsm","Illegal Trans setting, %d\n", TransA);
00124          CBLAS_CallFromC = 0;
00125          RowMajorStrg = 0;
00126          return;
00127       }
00128 
00129       if      ( Diag == CblasUnit   ) DI='U';
00130       else if ( Diag == CblasNonUnit) DI='N';
00131       else 
00132       {
00133          cblas_xerbla(5, "cblas_dtrsm","Illegal Diag setting, %d\n", Diag);
00134          CBLAS_CallFromC = 0;
00135          RowMajorStrg = 0;
00136          return;
00137       }
00138 
00139       #ifdef F77_CHAR
00140          F77_UL = C2F_CHAR(&UL);
00141          F77_TA = C2F_CHAR(&TA);
00142          F77_SD = C2F_CHAR(&SD);
00143          F77_DI = C2F_CHAR(&DI);
00144       #endif
00145 
00146       F77_dtrsm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_N, &F77_M, &alpha, A, 
00147                &F77_lda, B, &F77_ldb);
00148    } 
00149    else cblas_xerbla(1, "cblas_dtrsm","Illegal Order setting, %d\n", Order);
00150    CBLAS_CallFromC = 0;
00151    RowMajorStrg = 0;
00152    return;
00153 }


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