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