LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cblas_ztrmv.c
Go to the documentation of this file.
1/*
2 * cblas_ztrmv.c
3 * The program is a C interface to ztrmv.
4 *
5 * Keita Teranishi 5/20/98
6 *
7 */
8#include "cblas.h"
9#include "cblas_f77.h"
10void cblas_ztrmv(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo,
11 const CBLAS_TRANSPOSE TransA, const CBLAS_DIAG Diag,
12 const CBLAS_INT N, const void *A, const CBLAS_INT lda,
13 void *X, const CBLAS_INT incX)
14
15{
16 char TA;
17 char UL;
18 char DI;
19#ifdef F77_CHAR
20 F77_CHAR F77_TA, F77_UL, F77_DI;
21#else
22 #define F77_TA &TA
23 #define F77_UL &UL
24 #define F77_DI &DI
25#endif
26#ifdef F77_INT
27 F77_INT F77_N=N, F77_lda=lda, F77_incX=incX;
28#else
29 #define F77_N N
30 #define F77_lda lda
31 #define F77_incX incX
32#endif
33 CBLAS_INT n, i=0, tincX;
34 double *st=0,*x=(double *)X;
35 extern int CBLAS_CallFromC;
36 extern int RowMajorStrg;
37 RowMajorStrg = 0;
38
40 if (layout == CblasColMajor)
41 {
42 if (Uplo == CblasUpper) UL = 'U';
43 else if (Uplo == CblasLower) UL = 'L';
44 else
45 {
46 cblas_xerbla(2, "cblas_ztrmv","Illegal Uplo setting, %d\n", Uplo);
48 RowMajorStrg = 0;
49 return;
50 }
51 if (TransA == CblasNoTrans) TA = 'N';
52 else if (TransA == CblasTrans) TA = 'T';
53 else if (TransA == CblasConjTrans) TA = 'C';
54 else
55 {
56 cblas_xerbla(3, "cblas_ztrmv","Illegal TransA setting, %d\n", TransA);
58 RowMajorStrg = 0;
59 return;
60 }
61 if (Diag == CblasUnit) DI = 'U';
62 else if (Diag == CblasNonUnit) DI = 'N';
63 else
64 {
65 cblas_xerbla(4, "cblas_ztrmv","Illegal Diag setting, %d\n", Diag);
67 RowMajorStrg = 0;
68 return;
69 }
70 #ifdef F77_CHAR
71 F77_UL = C2F_CHAR(&UL);
72 F77_TA = C2F_CHAR(&TA);
73 F77_DI = C2F_CHAR(&DI);
74 #endif
76 &F77_incX);
77 }
78 else if (layout == CblasRowMajor)
79 {
80 RowMajorStrg = 1;
81 if (Uplo == CblasUpper) UL = 'L';
82 else if (Uplo == CblasLower) UL = 'U';
83 else
84 {
85 cblas_xerbla(2, "cblas_ztrmv","Illegal Uplo setting, %d\n", Uplo);
87 RowMajorStrg = 0;
88 return;
89 }
90
91 if (TransA == CblasNoTrans) TA = 'T';
92 else if (TransA == CblasTrans) TA = 'N';
93 else if (TransA == CblasConjTrans)
94 {
95 TA = 'N';
96 if ( N > 0)
97 {
98 if(incX > 0)
99 tincX = incX;
100 else
101 tincX = -incX;
102 i = tincX << 1;
103 n = i * N;
104 x++;
105 st = x + n;
106 do
107 {
108 *x = -(*x);
109 x += i;
110 }
111 while (x != st);
112 x -= n;
113 }
114 }
115 else
116 {
117 cblas_xerbla(3, "cblas_ztrmv","Illegal TransA setting, %d\n", TransA);
118 CBLAS_CallFromC = 0;
119 RowMajorStrg = 0;
120 return;
121 }
122
123 if (Diag == CblasUnit) DI = 'U';
124 else if (Diag == CblasNonUnit) DI = 'N';
125 else
126 {
127 cblas_xerbla(4, "cblas_ztrmv","Illegal Diag setting, %d\n", Diag);
128 CBLAS_CallFromC = 0;
129 RowMajorStrg = 0;
130 return;
131 }
132 #ifdef F77_CHAR
133 F77_UL = C2F_CHAR(&UL);
134 F77_TA = C2F_CHAR(&TA);
135 F77_DI = C2F_CHAR(&DI);
136 #endif
138 &F77_incX);
139 if (TransA == CblasConjTrans)
140 {
141 if (N > 0)
142 {
143 do
144 {
145 *x = -(*x);
146 x += i;
147 }
148 while (x != st);
149 }
150 }
151 }
152 else cblas_xerbla(1, "cblas_ztrmv", "Illegal layout setting, %d\n", layout);
153 CBLAS_CallFromC = 0;
154 RowMajorStrg = 0;
155 return;
156}
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_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_ztrmv(...)
Definition: cblas_f77.h:356
#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_incX
#define F77_TA
void cblas_ztrmv(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE TransA, const CBLAS_DIAG Diag, const CBLAS_INT N, const void *A, const CBLAS_INT lda, void *X, const CBLAS_INT incX)
Definition: cblas_ztrmv.c:10
#define F77_N
#define F77_lda
#define F77_UL
#define N
Definition: example_user.c:10