LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ F77_dsyr2k()

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

Definition at line 178 of file c_dblas3.c.

180 {
181 CBLAS_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:41
CBLAS_TRANSPOSE
Definition cblas.h:40
@ CblasNoTrans
Definition cblas.h:40
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
#define CBLAS_INT
Definition cblas.h:24
void cblas_dsyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT lda, const double *B, const CBLAS_INT ldb, const double beta, double *C, const CBLAS_INT ldc)
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
Here is the call graph for this function: