LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cblas_ztrmm.c
Go to the documentation of this file.
1/*
2 *
3 * cblas_ztrmm.c
4 * This program is a C interface to ztrmm.
5 * Written by Keita Teranishi
6 * 4/8/1998
7 *
8 */
9
10#include "cblas.h"
11#include "cblas_f77.h"
12void cblas_ztrmm(const CBLAS_LAYOUT layout, const CBLAS_SIDE Side,
13 const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE TransA,
14 const CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N,
15 const void *alpha, const void *A, const CBLAS_INT lda,
16 void *B, const CBLAS_INT ldb)
17{
18 char UL, TA, SD, DI;
19#ifdef F77_CHAR
20 F77_CHAR F77_TA, F77_UL, F77_SD, F77_DI;
21#else
22 #define F77_TA &TA
23 #define F77_UL &UL
24 #define F77_SD &SD
25 #define F77_DI &DI
26#endif
27
28#ifdef F77_INT
29 F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_ldb=ldb;
30#else
31 #define F77_M M
32 #define F77_N N
33 #define F77_lda lda
34 #define F77_ldb ldb
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 cblas_xerbla(2, "cblas_ztrmm", "Illegal Side setting, %d\n", Side);
50 RowMajorStrg = 0;
51 return;
52 }
53 if( Uplo == CblasUpper ) UL='U';
54 else if ( Uplo == CblasLower ) UL='L';
55 else
56 {
57 cblas_xerbla(3, "cblas_ztrmm", "Illegal Uplo setting, %d\n", Uplo);
59 RowMajorStrg = 0;
60 return;
61 }
62
63 if( TransA == CblasTrans ) TA ='T';
64 else if ( TransA == CblasConjTrans ) TA='C';
65 else if ( TransA == CblasNoTrans ) TA='N';
66 else
67 {
68 cblas_xerbla(4, "cblas_ztrmm", "Illegal Trans setting, %d\n", TransA);
70 RowMajorStrg = 0;
71 return;
72 }
73
74 if( Diag == CblasUnit ) DI='U';
75 else if ( Diag == CblasNonUnit ) DI='N';
76 else
77 {
78 cblas_xerbla(5, "cblas_ztrmm", "Illegal Diag setting, %d\n", Diag);
80 RowMajorStrg = 0;
81 return;
82 }
83
84 #ifdef F77_CHAR
85 F77_UL = C2F_CHAR(&UL);
86 F77_TA = C2F_CHAR(&TA);
87 F77_SD = C2F_CHAR(&SD);
88 F77_DI = C2F_CHAR(&DI);
89 #endif
90
91 F77_ztrmm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_M, &F77_N, alpha, A, &F77_lda, B, &F77_ldb);
92 } else if (layout == CblasRowMajor)
93 {
94 RowMajorStrg = 1;
95 if( Side == CblasRight ) SD='L';
96 else if ( Side == CblasLeft ) SD='R';
97 else
98 {
99 cblas_xerbla(2, "cblas_ztrmm", "Illegal Side setting, %d\n", Side);
100 CBLAS_CallFromC = 0;
101 RowMajorStrg = 0;
102 return;
103 }
104
105 if( Uplo == CblasUpper ) UL='L';
106 else if ( Uplo == CblasLower ) UL='U';
107 else
108 {
109 cblas_xerbla(3, "cblas_ztrmm", "Illegal Uplo setting, %d\n", Uplo);
110 CBLAS_CallFromC = 0;
111 RowMajorStrg = 0;
112 return;
113 }
114
115 if( TransA == CblasTrans ) TA ='T';
116 else if ( TransA == CblasConjTrans ) TA='C';
117 else if ( TransA == CblasNoTrans ) TA='N';
118 else
119 {
120 cblas_xerbla(4, "cblas_ztrmm", "Illegal Trans setting, %d\n", TransA);
121 CBLAS_CallFromC = 0;
122 RowMajorStrg = 0;
123 return;
124 }
125
126 if( Diag == CblasUnit ) DI='U';
127 else if ( Diag == CblasNonUnit ) DI='N';
128 else
129 {
130 cblas_xerbla(5, "cblas_ztrmm", "Illegal Diag setting, %d\n", Diag);
131 CBLAS_CallFromC = 0;
132 RowMajorStrg = 0;
133 return;
134 }
135
136 #ifdef F77_CHAR
137 F77_UL = C2F_CHAR(&UL);
138 F77_TA = C2F_CHAR(&TA);
139 F77_SD = C2F_CHAR(&SD);
140 F77_DI = C2F_CHAR(&DI);
141 #endif
142
143 F77_ztrmm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_N, &F77_M, alpha, A, &F77_lda, B, &F77_ldb);
144 }
145 else cblas_xerbla(1, "cblas_ztrmm", "Illegal layout setting, %d\n", layout);
146 CBLAS_CallFromC = 0;
147 RowMajorStrg = 0;
148 return;
149}
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,...)
Definition: cblas_xerbla.c:12
CBLAS_TRANSPOSE
Definition: cblas.h:40
@ CblasNoTrans
Definition: cblas.h:40
@ CblasTrans
Definition: cblas.h:40
@ CblasConjTrans
Definition: cblas.h:40
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
CBLAS_DIAG
Definition: cblas.h:42
@ CblasUnit
Definition: cblas.h:42
@ CblasNonUnit
Definition: cblas.h:42
#define CBLAS_INT
Definition: cblas.h:24
#define F77_ztrmm(...)
Definition: cblas_f77.h:410
#define F77_INT
Definition: cblas_f77.h:32
int CBLAS_CallFromC
Definition: cblas_globals.c:1
int RowMajorStrg
Definition: cblas_globals.c:2
#define F77_DI
#define F77_ldb
#define F77_TA
#define F77_N
#define F77_SD
#define F77_lda
#define F77_UL
#define F77_M
void cblas_ztrmm(const CBLAS_LAYOUT layout, const CBLAS_SIDE Side, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE TransA, const CBLAS_DIAG Diag, const CBLAS_INT M, const CBLAS_INT N, const void *alpha, const void *A, const CBLAS_INT lda, void *B, const CBLAS_INT ldb)
Definition: cblas_ztrmm.c:12
#define N
Definition: example_user.c:10