LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ F77_cher2k()

void F77_cher2k ( int *  layout,
char *  uplow,
char *  transp,
int *  n,
int *  k,
CBLAS_TEST_COMPLEX alpha,
CBLAS_TEST_COMPLEX a,
int *  lda,
CBLAS_TEST_COMPLEX b,
int *  ldb,
float *  beta,
CBLAS_TEST_COMPLEX c,
int *  ldc 
)

Definition at line 320 of file c_cblas3.c.

323  {
324  int i,j,LDA,LDB,LDC;
325  CBLAS_TEST_COMPLEX *A, *B, *C;
326  CBLAS_UPLO uplo;
327  CBLAS_TRANSPOSE trans;
328 
329  get_uplo_type(uplow,&uplo);
330  get_transpose_type(transp,&trans);
331 
332  if (*layout == TEST_ROW_MJR) {
333  if (trans == CblasNoTrans) {
334  LDA = *k+1;
335  LDB = *k+1;
336  A=(CBLAS_TEST_COMPLEX* )malloc((*n)*LDA*sizeof(CBLAS_TEST_COMPLEX ));
337  B=(CBLAS_TEST_COMPLEX* )malloc((*n)*LDB*sizeof(CBLAS_TEST_COMPLEX ));
338  for( i=0; i<*n; i++ )
339  for( j=0; j<*k; j++ ) {
340  A[i*LDA+j].real=a[j*(*lda)+i].real;
341  A[i*LDA+j].imag=a[j*(*lda)+i].imag;
342  B[i*LDB+j].real=b[j*(*ldb)+i].real;
343  B[i*LDB+j].imag=b[j*(*ldb)+i].imag;
344  }
345  }
346  else {
347  LDA = *n+1;
348  LDB = *n+1;
349  A=(CBLAS_TEST_COMPLEX* )malloc( LDA*(*k)*sizeof(CBLAS_TEST_COMPLEX ) );
350  B=(CBLAS_TEST_COMPLEX* )malloc( LDB*(*k)*sizeof(CBLAS_TEST_COMPLEX ) );
351  for( i=0; i<*k; i++ )
352  for( j=0; j<*n; j++ ){
353  A[i*LDA+j].real=a[j*(*lda)+i].real;
354  A[i*LDA+j].imag=a[j*(*lda)+i].imag;
355  B[i*LDB+j].real=b[j*(*ldb)+i].real;
356  B[i*LDB+j].imag=b[j*(*ldb)+i].imag;
357  }
358  }
359  LDC = *n+1;
360  C=(CBLAS_TEST_COMPLEX* )malloc( (*n)*LDC*sizeof(CBLAS_TEST_COMPLEX ) );
361  for( i=0; i<*n; i++ )
362  for( j=0; j<*n; j++ ) {
363  C[i*LDC+j].real=c[j*(*ldc)+i].real;
364  C[i*LDC+j].imag=c[j*(*ldc)+i].imag;
365  }
366  cblas_cher2k(CblasRowMajor, uplo, trans, *n, *k, alpha, A, LDA,
367  B, LDB, *beta, C, LDC );
368  for( j=0; j<*n; j++ )
369  for( i=0; i<*n; i++ ) {
370  c[j*(*ldc)+i].real=C[i*LDC+j].real;
371  c[j*(*ldc)+i].imag=C[i*LDC+j].imag;
372  }
373  free(A);
374  free(B);
375  free(C);
376  }
377  else if (*layout == TEST_COL_MJR)
378  cblas_cher2k(CblasColMajor, uplo, trans, *n, *k, alpha, a, *lda,
379  b, *ldb, *beta, c, *ldc );
380  else
381  cblas_cher2k(UNDEFINED, uplo, trans, *n, *k, alpha, a, *lda,
382  b, *ldb, *beta, c, *ldc );
383 }
#define UNDEFINED
Definition: c_cblas3.c:12
#define TEST_ROW_MJR
Definition: c_cblas3.c:11
#define TEST_COL_MJR
Definition: c_cblas3.c:10
void cblas_cher2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, const void *alpha, const void *A, const CBLAS_INT lda, const void *B, const CBLAS_INT ldb, const float beta, void *C, const CBLAS_INT ldc)
Definition: cblas_cher2k.c:12
CBLAS_UPLO
Definition: cblas.h:29
CBLAS_TRANSPOSE
Definition: cblas.h:28
@ CblasNoTrans
Definition: cblas.h:28
@ CblasColMajor
Definition: cblas.h:27
@ CblasRowMajor
Definition: cblas.h:27
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition: auxiliary.c:18
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition: auxiliary.c:8
#define LDB
Definition: example_user.c:13
#define LDA
Definition: example_user.c:12
Here is the call graph for this function:
Here is the caller graph for this function: