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