00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "cblas.h"
00011 #include "cblas_f77.h"
00012 void cblas_cherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
00013 const enum CBLAS_TRANSPOSE Trans, const int N, const int K,
00014 const float alpha, const void *A, const int lda,
00015 const float beta, void *C, const int ldc)
00016 {
00017 char UL, TR;
00018 #ifdef F77_CHAR
00019 F77_CHAR F77_TR, F77_UL;
00020 #else
00021 #define F77_TR &TR
00022 #define F77_UL &UL
00023 #endif
00024
00025 #ifdef F77_INT
00026 F77_INT F77_N=N, F77_K=K, F77_lda=lda;
00027 F77_INT F77_ldc=ldc;
00028 #else
00029 #define F77_N N
00030 #define F77_K K
00031 #define F77_lda lda
00032 #define F77_ldc ldc
00033 #endif
00034
00035 extern int CBLAS_CallFromC;
00036 extern int RowMajorStrg;
00037 RowMajorStrg = 0;
00038 CBLAS_CallFromC = 1;
00039
00040 if( Order == CblasColMajor )
00041 {
00042 if( Uplo == CblasUpper) UL='U';
00043 else if ( Uplo == CblasLower ) UL='L';
00044 else
00045 {
00046 cblas_xerbla(2, "cblas_cherk", "Illegal Uplo setting, %d\n", Uplo);
00047 CBLAS_CallFromC = 0;
00048 RowMajorStrg = 0;
00049 return;
00050 }
00051
00052 if( Trans == CblasTrans) TR ='T';
00053 else if ( Trans == CblasConjTrans ) TR='C';
00054 else if ( Trans == CblasNoTrans ) TR='N';
00055 else
00056 {
00057 cblas_xerbla(3, "cblas_cherk", "Illegal Trans setting, %d\n", Trans);
00058 CBLAS_CallFromC = 0;
00059 RowMajorStrg = 0;
00060 return;
00061 }
00062
00063 #ifdef F77_CHAR
00064 F77_UL = C2F_CHAR(&UL);
00065 F77_TR = C2F_CHAR(&TR);
00066 #endif
00067
00068 F77_cherk(F77_UL, F77_TR, &F77_N, &F77_K, &alpha, A, &F77_lda,
00069 &beta, C, &F77_ldc);
00070 } else if (Order == CblasRowMajor)
00071 {
00072 RowMajorStrg = 1;
00073 if( Uplo == CblasUpper) UL='L';
00074 else if ( Uplo == CblasLower ) UL='U';
00075 else
00076 {
00077 cblas_xerbla(3, "cblas_cherk", "Illegal Uplo setting, %d\n", Uplo);
00078 CBLAS_CallFromC = 0;
00079 RowMajorStrg = 0;
00080 return;
00081 }
00082 if( Trans == CblasTrans) TR ='N';
00083 else if ( Trans == CblasConjTrans ) TR='N';
00084 else if ( Trans == CblasNoTrans ) TR='C';
00085 else
00086 {
00087 cblas_xerbla(3, "cblas_cherk", "Illegal Trans setting, %d\n", Trans);
00088 CBLAS_CallFromC = 0;
00089 RowMajorStrg = 0;
00090 return;
00091 }
00092
00093 #ifdef F77_CHAR
00094 F77_UL = C2F_CHAR(&UL);
00095 F77_SD = C2F_CHAR(&SD);
00096 #endif
00097
00098 F77_cherk(F77_UL, F77_TR, &F77_N, &F77_K, &alpha, A, &F77_lda,
00099 &beta, C, &F77_ldc);
00100 }
00101 else cblas_xerbla(1, "cblas_cherk", "Illegal Order setting, %d\n", Order);
00102 CBLAS_CallFromC = 0;
00103 RowMajorStrg = 0;
00104 return;
00105 }