00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "cblas.h"
00010 #include "cblas_f77.h"
00011 void cblas_strmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
00012 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
00013 const int N, const float *A, const int lda,
00014 float *X, const int incX)
00015
00016 {
00017 char TA;
00018 char UL;
00019 char DI;
00020 #ifdef F77_CHAR
00021 F77_CHAR F77_TA, F77_UL, F77_DI;
00022 #else
00023 #define F77_TA &TA
00024 #define F77_UL &UL
00025 #define F77_DI &DI
00026 #endif
00027 #ifdef F77_INT
00028 F77_INT F77_N=N, F77_lda=lda, F77_incX=incX;
00029 #else
00030 #define F77_N N
00031 #define F77_lda lda
00032 #define F77_incX incX
00033 #endif
00034 extern int CBLAS_CallFromC;
00035 extern int RowMajorStrg;
00036 RowMajorStrg = 0;
00037
00038 CBLAS_CallFromC = 1;
00039 if (order == CblasColMajor)
00040 {
00041 if (Uplo == CblasUpper) UL = 'U';
00042 else if (Uplo == CblasLower) UL = 'L';
00043 else
00044 {
00045 cblas_xerbla(2, "cblas_strmv","Illegal Uplo setting, %d\n", Uplo);
00046 CBLAS_CallFromC = 0;
00047 RowMajorStrg = 0;
00048 return;
00049 }
00050 if (TransA == CblasNoTrans) TA = 'N';
00051 else if (TransA == CblasTrans) TA = 'T';
00052 else if (TransA == CblasConjTrans) TA = 'C';
00053 else
00054 {
00055 cblas_xerbla(3, "cblas_strmv","Illegal TransA setting, %d\n", TransA);
00056 CBLAS_CallFromC = 0;
00057 RowMajorStrg = 0;
00058 return;
00059 }
00060 if (Diag == CblasUnit) DI = 'U';
00061 else if (Diag == CblasNonUnit) DI = 'N';
00062 else
00063 {
00064 cblas_xerbla(4, "cblas_strmv","Illegal Diag setting, %d\n", Diag);
00065 CBLAS_CallFromC = 0;
00066 RowMajorStrg = 0;
00067 return;
00068 }
00069 #ifdef F77_CHAR
00070 F77_UL = C2F_CHAR(&UL);
00071 F77_TA = C2F_CHAR(&TA);
00072 F77_DI = C2F_CHAR(&DI);
00073 #endif
00074 F77_strmv( F77_UL, F77_TA, F77_DI, &F77_N, A, &F77_lda, X,
00075 &F77_incX);
00076 }
00077 else if (order == CblasRowMajor)
00078 {
00079 RowMajorStrg = 1;
00080 if (Uplo == CblasUpper) UL = 'L';
00081 else if (Uplo == CblasLower) UL = 'U';
00082 else
00083 {
00084 cblas_xerbla(2, "cblas_strmv","Illegal Uplo setting, %d\n", Uplo);
00085 CBLAS_CallFromC = 0;
00086 RowMajorStrg = 0;
00087 return;
00088 }
00089
00090 if (TransA == CblasNoTrans) TA = 'T';
00091 else if (TransA == CblasTrans) TA = 'N';
00092 else if (TransA == CblasConjTrans) TA = 'N';
00093 else
00094 {
00095 cblas_xerbla(3, "cblas_strmv","Illegal TransA setting, %d\n", TransA);
00096 CBLAS_CallFromC = 0;
00097 RowMajorStrg = 0;
00098 return;
00099 }
00100
00101 if (Diag == CblasUnit) DI = 'U';
00102 else if (Diag == CblasNonUnit) DI = 'N';
00103 else
00104 {
00105 cblas_xerbla(4, "cblas_strmv","Illegal Diag setting, %d\n", Diag);
00106 CBLAS_CallFromC = 0;
00107 RowMajorStrg = 0;
00108 return;
00109 }
00110 #ifdef F77_CHAR
00111 F77_UL = C2F_CHAR(&UL);
00112 F77_TA = C2F_CHAR(&TA);
00113 F77_DI = C2F_CHAR(&DI);
00114 #endif
00115 F77_strmv( F77_UL, F77_TA, F77_DI, &F77_N, A, &F77_lda, X,
00116 &F77_incX);
00117 }
00118 else cblas_xerbla(1, "cblas_strmv", "Illegal Order setting, %d\n", order);
00119 CBLAS_CallFromC = 0;
00120 RowMajorStrg = 0;
00121 return;
00122 }