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