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