LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 void F77_ssyr2k ( int * layout, char * uplow, char * transp, int * n, int * k, float * alpha, float * a, int * lda, float * b, int * ldb, float * beta, float * c, int * ldc )

Definition at line 175 of file c_sblas3.c.

177  {
178  int i,j,LDA,LDB,LDC;
179  float *A, *B, *C;
180  CBLAS_UPLO uplo;
181  CBLAS_TRANSPOSE trans;
182
183  get_uplo_type(uplow,&uplo);
184  get_transpose_type(transp,&trans);
185
186  if (*layout == TEST_ROW_MJR) {
187  if (trans == CblasNoTrans) {
188  LDA = *k+1;
189  LDB = *k+1;
190  A = ( float* )malloc( (*n)*LDA*sizeof( float ) );
191  B = ( float* )malloc( (*n)*LDB*sizeof( float ) );
192  for( i=0; i<*n; i++ )
193  for( j=0; j<*k; j++ ) {
194  A[i*LDA+j]=a[j*(*lda)+i];
195  B[i*LDB+j]=b[j*(*ldb)+i];
196  }
197  }
198  else {
199  LDA = *n+1;
200  LDB = *n+1;
201  A = ( float* )malloc( LDA*(*k)*sizeof( float ) );
202  B = ( float* )malloc( LDB*(*k)*sizeof( float ) );
203  for( i=0; i<*k; i++ )
204  for( j=0; j<*n; j++ ){
205  A[i*LDA+j]=a[j*(*lda)+i];
206  B[i*LDB+j]=b[j*(*ldb)+i];
207  }
208  }
209  LDC = *n+1;
210  C = ( float* )malloc( (*n)*LDC*sizeof( float ) );
211  for( i=0; i<*n; i++ )
212  for( j=0; j<*n; j++ )
213  C[i*LDC+j]=c[j*(*ldc)+i];
214  cblas_ssyr2k(CblasRowMajor, uplo, trans, *n, *k, *alpha, A, LDA,
215  B, LDB, *beta, C, LDC );
216  for( j=0; j<*n; j++ )
217  for( i=0; i<*n; i++ )
218  c[j*(*ldc)+i]=C[i*LDC+j];
219  free(A);
220  free(B);
221  free(C);
222  }
223  else if (*layout == TEST_COL_MJR)
224  cblas_ssyr2k(CblasColMajor, uplo, trans, *n, *k, *alpha, a, *lda,
225  b, *ldb, *beta, c, *ldc );
226  else
227  cblas_ssyr2k(UNDEFINED, uplo, trans, *n, *k, *alpha, a, *lda,
228  b, *ldb, *beta, c, *ldc );
229 }
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition: auxiliary.c:8
#define LDB
Definition: example_user.c:13
CBLAS_TRANSPOSE
Definition: cblas.h:20
#define LDA
Definition: example_user.c:12
void cblas_ssyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, const int N, const int K, const float alpha, const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc)
Definition: cblas_ssyr2k.c:12
#define UNDEFINED
Definition: cblas_test.h:19
#define TEST_COL_MJR
Definition: cblas_test.h:16
CBLAS_UPLO
Definition: cblas.h:21
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition: auxiliary.c:18
#define TEST_ROW_MJR
Definition: cblas_test.h:12

Here is the call graph for this function: