cblas_ssyrk.c
Go to the documentation of this file.
00001 /*
00002  *
00003  * cblas_ssyrk.c
00004  * This program is a C interface to ssyrk.
00005  * Written by Keita Teranishi
00006  * 4/8/1998
00007  *
00008  */
00009 
00010 #include "cblas.h"
00011 #include "cblas_f77.h"
00012 void cblas_ssyrk(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 float  *A, const int lda,
00015                  const float beta, float  *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 
00043       if( Uplo == CblasUpper) UL='U';
00044       else if ( Uplo == CblasLower ) UL='L';
00045       else 
00046       {
00047          cblas_xerbla(2, "cblas_ssyrk", 
00048                        "Illegal Uplo setting, %d\n", Uplo);
00049          CBLAS_CallFromC = 0;
00050          RowMajorStrg = 0;
00051          return;
00052       }
00053 
00054       if( Trans == CblasTrans) TR ='T';
00055       else if ( Trans == CblasConjTrans ) TR='C';
00056       else if ( Trans == CblasNoTrans )   TR='N';
00057       else 
00058       {
00059          cblas_xerbla(3, "cblas_ssyrk", 
00060                        "Illegal Trans setting, %d\n", Trans);
00061          CBLAS_CallFromC = 0;
00062          RowMajorStrg = 0;
00063          return;
00064       }
00065 
00066 
00067       #ifdef F77_CHAR
00068          F77_UL = C2F_CHAR(&UL);
00069          F77_TR = C2F_CHAR(&TR);
00070       #endif
00071 
00072       F77_ssyrk(F77_UL, F77_TR, &F77_N, &F77_K, &alpha, A, &F77_lda, &beta, C, &F77_ldc);
00073    } else if (Order == CblasRowMajor)
00074    {
00075       RowMajorStrg = 1;
00076       if( Uplo == CblasUpper) UL='L';
00077       else if ( Uplo == CblasLower ) UL='U';
00078       else 
00079       {
00080          cblas_xerbla(3, "cblas_ssyrk", 
00081                        "Illegal Uplo setting, %d\n", Uplo);
00082          CBLAS_CallFromC = 0;
00083          RowMajorStrg = 0;
00084          return;
00085       }
00086       if( Trans == CblasTrans) TR ='N';
00087       else if ( Trans == CblasConjTrans ) TR='N';
00088       else if ( Trans == CblasNoTrans )   TR='T';
00089       else 
00090       {
00091          cblas_xerbla(3, "cblas_ssyrk", 
00092                        "Illegal Trans setting, %d\n", Trans);
00093          CBLAS_CallFromC = 0;
00094          RowMajorStrg = 0;
00095          return;
00096       }
00097 
00098       #ifdef F77_CHAR
00099          F77_UL = C2F_CHAR(&UL);
00100          F77_TR = C2F_CHAR(&TR);
00101       #endif
00102 
00103       F77_ssyrk(F77_UL, F77_TR, &F77_N, &F77_K, &alpha, A, &F77_lda, &beta, C, &F77_ldc);
00104    } else  cblas_xerbla(1, "cblas_ssyrk",
00105                      "Illegal Order setting, %d\n", Order);
00106    CBLAS_CallFromC = 0;
00107    RowMajorStrg = 0;
00108    return;
00109 }
00110 


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:16