LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cblas_ztrsm.c
Go to the documentation of this file.
1/*
2 *
3 * cblas_ztrsm.c
4 * This program is a C interface to ztrsm.
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_ztrsm)(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
45 if( Side == CblasRight) SD='R';
46 else if ( Side == CblasLeft ) SD='L';
47 else
48 {
49 API_SUFFIX(cblas_xerbla)(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side);
51 RowMajorStrg = 0;
52 return;
53 }
54
55 if( Uplo == CblasUpper) UL='U';
56 else if ( Uplo == CblasLower ) UL='L';
57 else
58 {
59 API_SUFFIX(cblas_xerbla)(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo);
61 RowMajorStrg = 0;
62 return;
63 }
64
65 if( TransA == CblasTrans) TA ='T';
66 else if ( TransA == CblasConjTrans ) TA='C';
67 else if ( TransA == CblasNoTrans ) TA='N';
68 else
69 {
70 API_SUFFIX(cblas_xerbla)(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA);
72 RowMajorStrg = 0;
73 return;
74 }
75
76 if( Diag == CblasUnit ) DI='U';
77 else if ( Diag == CblasNonUnit ) DI='N';
78 else
79 {
80 API_SUFFIX(cblas_xerbla)(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag);
82 RowMajorStrg = 0;
83 return;
84 }
85
86 #ifdef F77_CHAR
87 F77_UL = C2F_CHAR(&UL);
88 F77_TA = C2F_CHAR(&TA);
89 F77_SD = C2F_CHAR(&SD);
90 F77_DI = C2F_CHAR(&DI);
91 #endif
92
94 &F77_lda, B, &F77_ldb);
95 } else if (layout == CblasRowMajor)
96 {
97 RowMajorStrg = 1;
98
99 if( Side == CblasRight) SD='L';
100 else if ( Side == CblasLeft ) SD='R';
101 else
102 {
103 API_SUFFIX(cblas_xerbla)(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side);
104 CBLAS_CallFromC = 0;
105 RowMajorStrg = 0;
106 return;
107 }
108
109 if( Uplo == CblasUpper) UL='L';
110 else if ( Uplo == CblasLower ) UL='U';
111 else
112 {
113 API_SUFFIX(cblas_xerbla)(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo);
114 CBLAS_CallFromC = 0;
115 RowMajorStrg = 0;
116 return;
117 }
118
119 if( TransA == CblasTrans) TA ='T';
120 else if ( TransA == CblasConjTrans ) TA='C';
121 else if ( TransA == CblasNoTrans ) TA='N';
122 else
123 {
124 API_SUFFIX(cblas_xerbla)(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA);
125 CBLAS_CallFromC = 0;
126 RowMajorStrg = 0;
127 return;
128 }
129
130 if( Diag == CblasUnit ) DI='U';
131 else if ( Diag == CblasNonUnit ) DI='N';
132 else
133 {
134 API_SUFFIX(cblas_xerbla)(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag);
135 CBLAS_CallFromC = 0;
136 RowMajorStrg = 0;
137 return;
138 }
139
140 #ifdef F77_CHAR
141 F77_UL = C2F_CHAR(&UL);
142 F77_TA = C2F_CHAR(&TA);
143 F77_SD = C2F_CHAR(&SD);
144 F77_DI = C2F_CHAR(&DI);
145 #endif
146
147
148 F77_ztrsm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_N, &F77_M, alpha, A,
149 &F77_lda, B, &F77_ldb);
150 }
151 else API_SUFFIX(cblas_xerbla)(1, "cblas_ztrsm", "Illegal layout setting, %d\n", layout);
152 CBLAS_CallFromC = 0;
153 RowMajorStrg = 0;
154 return;
155}
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_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 API_SUFFIX(a)
Definition cblas.h:57
#define CBLAS_INT
Definition cblas.h:24
#define F77_INT
#define F77_ztrsm(...)
Definition cblas_f77.h:425
int CBLAS_CallFromC
int RowMajorStrg
#define F77_DI
#define F77_ldb
#define F77_TA
#define F77_N
#define F77_SD
#define F77_lda
#define F77_UL
void API_SUFFIX() cblas_ztrsm(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_ztrsm.c:12
#define F77_M