00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "cblas.h"
00011 #include "cblas_f77.h"
00012 void cblas_ctrmm(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_ctrmm", "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_ctrmm", "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_ctrmm", "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 cblas_xerbla(5, "cblas_ctrmm",
00077 "Illegal Diag setting, %d\n", Diag);
00078
00079 #ifdef F77_CHAR
00080 F77_UL = C2F_CHAR(&UL);
00081 F77_TA = C2F_CHAR(&TA);
00082 F77_SD = C2F_CHAR(&SD);
00083 F77_DI = C2F_CHAR(&DI);
00084 #endif
00085
00086 F77_ctrmm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_M, &F77_N, alpha, A, &F77_lda, B, &F77_ldb);
00087 } else if (Order == CblasRowMajor)
00088 {
00089 RowMajorStrg = 1;
00090 if( Side == CblasRight ) SD='L';
00091 else if ( Side == CblasLeft ) SD='R';
00092 else
00093 {
00094 cblas_xerbla(2, "cblas_ctrmm", "Illegal Side setting, %d\n", Side);
00095 CBLAS_CallFromC = 0;
00096 RowMajorStrg = 0;
00097 return;
00098 }
00099
00100 if( Uplo == CblasUpper ) UL='L';
00101 else if ( Uplo == CblasLower ) UL='U';
00102 else
00103 {
00104 cblas_xerbla(3, "cblas_ctrmm", "Illegal Uplo setting, %d\n", Uplo);
00105 CBLAS_CallFromC = 0;
00106 RowMajorStrg = 0;
00107 return;
00108 }
00109
00110 if( TransA == CblasTrans ) TA ='T';
00111 else if ( TransA == CblasConjTrans ) TA='C';
00112 else if ( TransA == CblasNoTrans ) TA='N';
00113 else
00114 {
00115 cblas_xerbla(4, "cblas_ctrmm", "Illegal Trans setting, %d\n", TransA);
00116 CBLAS_CallFromC = 0;
00117 RowMajorStrg = 0;
00118 return;
00119 }
00120
00121 if( Diag == CblasUnit ) DI='U';
00122 else if ( Diag == CblasNonUnit ) DI='N';
00123 else
00124 {
00125 cblas_xerbla(5, "cblas_ctrmm", "Illegal Diag setting, %d\n", Diag);
00126 CBLAS_CallFromC = 0;
00127 RowMajorStrg = 0;
00128 return;
00129 }
00130
00131 #ifdef F77_CHAR
00132 F77_UL = C2F_CHAR(&UL);
00133 F77_TA = C2F_CHAR(&TA);
00134 F77_SD = C2F_CHAR(&SD);
00135 F77_DI = C2F_CHAR(&DI);
00136 #endif
00137
00138 F77_ctrmm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_N, &F77_M, alpha, A, &F77_lda, B, &F77_ldb);
00139 }
00140 else cblas_xerbla(1, "cblas_ctrmm", "Illegal Order setting, %d\n", Order);
00141 CBLAS_CallFromC = 0;
00142 RowMajorStrg = 0;
00143 return;
00144 }