|
liblapackwrap 0.1
|
#include <liblapackwrap/lapackwrap_types_complex_double.h>#include <liblapackwrap/lapackwrap_types_complex_double.h>
Include dependency graph for blaswrap_complex_double.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Defines | |
| #define | LLW_CONST const |
Functions | |
| int | llw_complex_double_gemm_a (char transa, char transb, int M, int N, int K, LLW_complex_double_COMPLEX *alpha, LLW_CONST LLW_complex_double_COMPLEX *A, int LDA, LLW_CONST LLW_complex_double_COMPLEX *B, int LDB, LLW_complex_double_COMPLEX **C) |
| int | llw_complex_double_gemm (char transa, char transb, int M, int N, int K, LLW_complex_double_COMPLEX *alpha, LLW_CONST LLW_complex_double_COMPLEX *A, int LDA, LLW_CONST LLW_complex_double_COMPLEX *B, int LDB, LLW_complex_double_COMPLEX *beta, LLW_complex_double_COMPLEX *C, int LDC) |
| #define LLW_CONST const |
Definition at line 49 of file blaswrap_complex_double.h.
| int llw_complex_double_gemm | ( | char | transa, |
| char | transb, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| LLW_complex_double_COMPLEX * | alpha, | ||
| LLW_CONST LLW_complex_double_COMPLEX * | A, | ||
| int | LDA, | ||
| LLW_CONST LLW_complex_double_COMPLEX * | B, | ||
| int | LDB, | ||
| LLW_complex_double_COMPLEX * | beta, | ||
| LLW_complex_double_COMPLEX * | C, | ||
| int | LDC | ||
| ) |
Performs matrix-matrix multiplication.
Definition at line 43 of file blaswrap_complex_double.c.
References GEMM, LAPACK_COMPLEX_TYPENAME, LLW_complex_double_COMPLEX, and LLW_complex_double_IS_COMPLEX.
Referenced by llw_complex_double_gemm_a().
{
int ka=(transa=='N')?K:M;
int kb=(transb=='N')?K:N;
LLW_complex_double_COMPLEX *a;
LLW_complex_double_COMPLEX *b;
#ifdef LLW_CONST
a = (LLW_complex_double_COMPLEX*)malloc(LDA*ka*sizeof(LLW_complex_double_COMPLEX));
if(a == NULL) return 100;
b = (LLW_complex_double_COMPLEX*)malloc(LDA*kb*sizeof(LLW_complex_double_COMPLEX));
if(b == NULL) {
free(a);
return 100;
}
memcpy(a, A, LDA*ka*sizeof(LLW_complex_double_COMPLEX));
memcpy(b, B, LDB*kb*sizeof(LLW_complex_double_COMPLEX));
#else
a = A;
b = B;
#endif
#ifdef FCALL
GEMM(&transa, &transb, &M, &N, &K,
#ifdef LLW_complex_double_IS_COMPLEX
(LAPACK_COMPLEX_TYPENAME*)alpha,
#else
(LAPACK_COMPLEX_TYPENAME*)&alpha,
#endif
(LAPACK_COMPLEX_TYPENAME*)a, &LDA, (LAPACK_COMPLEX_TYPENAME*)b, &LDB,
#ifdef LLW_complex_double_IS_COMPLEX
(LAPACK_COMPLEX_TYPENAME*)beta,
#else
(LAPACK_COMPLEX_TYPENAME*)&beta,
#endif
(LAPACK_COMPLEX_TYPENAME*)C, &LDC);
#else
GEMM(transa, transb, M, N, K,
#ifdef LLW_complex_double_IS_COMPLEX
(LAPACK_COMPLEX_TYPENAME*)alpha,
#else
*alpha,
#endif
(LAPACK_COMPLEX_TYPENAME*)a, LDA, (LAPACK_COMPLEX_TYPENAME*)b, LDB,
#ifdef LLW_complex_double_IS_COMPLEX
(LAPACK_COMPLEX_TYPENAME*)beta,
#else
*beta,
#endif
(LAPACK_COMPLEX_TYPENAME*)C, LDC);
#endif
#ifdef LLW_CONST
free(a);
free(b);
#endif
return 0;
}
Here is the caller graph for this function:| int llw_complex_double_gemm_a | ( | char | transa, |
| char | transb, | ||
| int | M, | ||
| int | N, | ||
| int | K, | ||
| LLW_complex_double_COMPLEX * | alpha, | ||
| LLW_CONST LLW_complex_double_COMPLEX * | A, | ||
| int | LDA, | ||
| LLW_CONST LLW_complex_double_COMPLEX * | B, | ||
| int | LDB, | ||
| LLW_complex_double_COMPLEX ** | C | ||
| ) |
frontend for llw_double_gemm but if you don't have a matrix C yet (clearly, if you're calling this routine, you want one.
frontend for llw_complex_double_gemm but if you don't have a matrix C yet (clearly, if you're calling this routine, you want one.
Definition at line 29 of file blaswrap_complex_double.c.
References llw_bw_complex_double_set_from_double(), LLW_complex_double_COMPLEX, and llw_complex_double_gemm().
{
*C = (LLW_complex_double_COMPLEX*)malloc(M*N*sizeof(LLW_complex_double_COMPLEX));
if((*C) == NULL) return 100;
//fprintf(stderr, "N=%d M=%d N*M=%lu\n", M, N, (long unsigned)M*N);
for(long unsigned i=0; i<M*N; i++) {
//fprintf(stderr, "\tC=%p *C=%p (*C)[%lu]=%g\n", (void*)C, (void*)*C, i, (*C)[i]);
llw_bw_complex_double_set_from_double(&((*C)[i]), 0);
//fprintf(stderr, "\t\t->(*C)[%lu]=%g\n", i, (*C)[i]);
}
LLW_complex_double_COMPLEX zero;
llw_bw_complex_double_set_from_double(&zero, 0.0);
return llw_complex_double_gemm(transa, transb, M, N, K, alpha, A, LDA, B, LDB, &zero, *C, M);
}
Here is the call graph for this function: