LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ F77_dsyr2k()

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

Definition at line 178 of file c_dblas3.c.

180  {
181  int i,j,LDA,LDB,LDC;
182  double *A, *B, *C;
183  CBLAS_UPLO uplo;
184  CBLAS_TRANSPOSE trans;
185 
186  get_uplo_type(uplow,&uplo);
187  get_transpose_type(transp,&trans);
188 
189  if (*layout == TEST_ROW_MJR) {
190  if (trans == CblasNoTrans) {
191  LDA = *k+1;
192  LDB = *k+1;
193  A = ( double* )malloc( (*n)*LDA*sizeof( double ) );
194  B = ( double* )malloc( (*n)*LDB*sizeof( double ) );
195  for( i=0; i<*n; i++ )
196  for( j=0; j<*k; j++ ) {
197  A[i*LDA+j]=a[j*(*lda)+i];
198  B[i*LDB+j]=b[j*(*ldb)+i];
199  }
200  }
201  else {
202  LDA = *n+1;
203  LDB = *n+1;
204  A = ( double* )malloc( LDA*(*k)*sizeof( double ) );
205  B = ( double* )malloc( LDB*(*k)*sizeof( double ) );
206  for( i=0; i<*k; i++ )
207  for( j=0; j<*n; j++ ){
208  A[i*LDA+j]=a[j*(*lda)+i];
209  B[i*LDB+j]=b[j*(*ldb)+i];
210  }
211  }
212  LDC = *n+1;
213  C = ( double* )malloc( (*n)*LDC*sizeof( double ) );
214  for( i=0; i<*n; i++ )
215  for( j=0; j<*n; j++ )
216  C[i*LDC+j]=c[j*(*ldc)+i];
217  cblas_dsyr2k(CblasRowMajor, uplo, trans, *n, *k, *alpha, A, LDA,
218  B, LDB, *beta, C, LDC );
219  for( j=0; j<*n; j++ )
220  for( i=0; i<*n; i++ )
221  c[j*(*ldc)+i]=C[i*LDC+j];
222  free(A);
223  free(B);
224  free(C);
225  }
226  else if (*layout == TEST_COL_MJR)
227  cblas_dsyr2k(CblasColMajor, uplo, trans, *n, *k, *alpha, a, *lda,
228  b, *ldb, *beta, c, *ldc );
229  else
230  cblas_dsyr2k(UNDEFINED, uplo, trans, *n, *k, *alpha, a, *lda,
231  b, *ldb, *beta, c, *ldc );
232 }
#define UNDEFINED
Definition: c_dblas3.c:12
#define TEST_ROW_MJR
Definition: c_dblas3.c:11
#define TEST_COL_MJR
Definition: c_dblas3.c:10
CBLAS_UPLO
Definition: cblas.h:21
CBLAS_TRANSPOSE
Definition: cblas.h:20
@ CblasNoTrans
Definition: cblas.h:20
@ CblasColMajor
Definition: cblas.h:19
@ CblasRowMajor
Definition: cblas.h:19
void cblas_dsyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, const CBLAS_INDEX N, const CBLAS_INDEX K, const double alpha, const double *A, const CBLAS_INDEX lda, const double *B, const CBLAS_INDEX ldb, const double beta, double *C, const CBLAS_INDEX ldc)
Definition: cblas_dsyr2k.c:12
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: