LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cblas_zhemm.c
Go to the documentation of this file.
1/*
2 *
3 * cblas_zhemm.c
4 * This program is a C interface to zhemm.
5 * Written by Keita Teranishi
6 * 4/8/1998
7 *
8 */
9
10#include "cblas.h"
11#include "cblas_f77.h"
12void API_SUFFIX(cblas_zhemm)(const CBLAS_LAYOUT layout, const CBLAS_SIDE Side,
13 const CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N,
14 const void *alpha, const void *A, const CBLAS_INT lda,
15 const void *B, const CBLAS_INT ldb, const void *beta,
16 void *C, const CBLAS_INT ldc)
17{
18 char SD, UL;
19#ifdef F77_CHAR
20 F77_CHAR F77_SD, F77_UL;
21#else
22 #define F77_SD &SD
23 #define F77_UL &UL
24#endif
25
26#ifdef F77_INT
27 F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_ldb=ldb;
28 F77_INT F77_ldc=ldc;
29#else
30 #define F77_M M
31 #define F77_N N
32 #define F77_lda lda
33 #define F77_ldb ldb
34 #define F77_ldc ldc
35#endif
36
37 extern int CBLAS_CallFromC;
38 extern int RowMajorStrg;
39 RowMajorStrg = 0;
41
42 if( layout == CblasColMajor )
43 {
44 if( Side == CblasRight) SD='R';
45 else if ( Side == CblasLeft ) SD='L';
46 else
47 {
48 API_SUFFIX(cblas_xerbla)(2, "cblas_zhemm", "Illegal Side setting, %d\n", Side);
50 RowMajorStrg = 0;
51 return;
52 }
53
54 if( Uplo == CblasUpper) UL='U';
55 else if ( Uplo == CblasLower ) UL='L';
56 else
57 {
58 API_SUFFIX(cblas_xerbla)(3, "cblas_zhemm", "Illegal Uplo setting, %d\n", Uplo);
60 RowMajorStrg = 0;
61 return;
62 }
63
64 #ifdef F77_CHAR
65 F77_UL = C2F_CHAR(&UL);
66 F77_SD = C2F_CHAR(&SD);
67 #endif
68
69 F77_zhemm(F77_SD, F77_UL, &F77_M, &F77_N, alpha, A, &F77_lda,
70 B, &F77_ldb, beta, C, &F77_ldc);
71 } else if (layout == CblasRowMajor)
72 {
73 RowMajorStrg = 1;
74 if( Side == CblasRight) SD='L';
75 else if ( Side == CblasLeft ) SD='R';
76 else
77 {
78 API_SUFFIX(cblas_xerbla)(2, "cblas_zhemm", "Illegal Side setting, %d\n", Side);
80 RowMajorStrg = 0;
81 return;
82 }
83
84 if( Uplo == CblasUpper) UL='L';
85 else if ( Uplo == CblasLower ) UL='U';
86 else
87 {
88 API_SUFFIX(cblas_xerbla)(3, "cblas_zhemm", "Illegal Uplo setting, %d\n", Uplo);
90 RowMajorStrg = 0;
91 return;
92 }
93
94 #ifdef F77_CHAR
95 F77_UL = C2F_CHAR(&UL);
96 F77_SD = C2F_CHAR(&SD);
97 #endif
98
99 F77_zhemm(F77_SD, F77_UL, &F77_N, &F77_M, alpha, A,
100 &F77_lda, B, &F77_ldb, beta, C, &F77_ldc);
101 }
102 else API_SUFFIX(cblas_xerbla)(1, "cblas_zhemm", "Illegal layout setting, %d\n", layout);
103 CBLAS_CallFromC = 0;
104 RowMajorStrg = 0;
105 return;
106}
CBLAS_UPLO
Definition cblas.h:41
@ CblasLower
Definition cblas.h:41
@ CblasUpper
Definition cblas.h:41
void cblas_xerbla(CBLAS_INT p, const char *rout, const char *form,...)
CBLAS_SIDE
Definition cblas.h:43
@ CblasRight
Definition cblas.h:43
@ CblasLeft
Definition cblas.h:43
CBLAS_LAYOUT
Definition cblas.h:39
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
#define API_SUFFIX(a)
Definition cblas.h:57
#define CBLAS_INT
Definition cblas.h:24
#define F77_INT
#define F77_zhemm(...)
Definition cblas_f77.h:419
int CBLAS_CallFromC
int RowMajorStrg
#define F77_ldc
#define F77_ldb
#define F77_N
#define F77_SD
#define F77_lda
#define F77_UL
void API_SUFFIX() cblas_zhemm(const CBLAS_LAYOUT layout, const CBLAS_SIDE Side, const CBLAS_UPLO Uplo, const CBLAS_INT M, const CBLAS_INT N, const void *alpha, const void *A, const CBLAS_INT lda, const void *B, const CBLAS_INT ldb, const void *beta, void *C, const CBLAS_INT ldc)
Definition cblas_zhemm.c:12
#define F77_M