OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
ctzcnjg.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine ctzcnjg (uplo, m, n, ioffd, alpha, a, lda)

Function/Subroutine Documentation

◆ ctzcnjg()

subroutine ctzcnjg ( character*1 uplo,
integer m,
integer n,
integer ioffd,
complex alpha,
complex, dimension( lda, * ) a,
integer lda )

Definition at line 1 of file ctzcnjg.f.

2*
3* -- PBLAS auxiliary routine (version 2.0) --
4* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5* and University of California, Berkeley.
6* April 1, 1998
7*
8* .. Scalar Arguments ..
9 CHARACTER*1 UPLO
10 INTEGER IOFFD, LDA, M, N
11 COMPLEX ALPHA
12* ..
13* .. Array Arguments ..
14 COMPLEX A( LDA, * )
15* ..
16*
17* Purpose
18* =======
19*
20* CTZCNJG conjugates a two-dimensional array A and then scales it by
21* the scalar alpha.
22*
23* Arguments
24* =========
25*
26* UPLO (input) CHARACTER*1
27* On entry, UPLO specifies which trapezoidal part of the ar-
28* ray A is to be conjugated and scaled as follows:
29* = 'L' or 'l': the lower trapezoid of A is scaled,
30* = 'U' or 'u': the upper trapezoid of A is scaled,
31* = 'D' or 'd': diagonal specified by IOFFD is scaled,
32* Otherwise: all of the array A is scaled.
33*
34* M (input) INTEGER
35* On entry, M specifies the number of rows of the array A. M
36* must be at least zero.
37*
38* N (input) INTEGER
39* On entry, N specifies the number of columns of the array A.
40* N must be at least zero.
41*
42* IOFFD (input) INTEGER
43* On entry, IOFFD specifies the position of the offdiagonal de-
44* limiting the upper and lower trapezoidal part of A as follows
45* (see the notes below):
46*
47* IOFFD = 0 specifies the main diagonal A( i, i ),
48* with i = 1 ... MIN( M, N ),
49* IOFFD > 0 specifies the subdiagonal A( i+IOFFD, i ),
50* with i = 1 ... MIN( M-IOFFD, N ),
51* IOFFD < 0 specifies the superdiagonal A( i, i-IOFFD ),
52* with i = 1 ... MIN( M, N+IOFFD ).
53*
54* ALPHA (input) COMPLEX
55* On entry, ALPHA specifies the scalar alpha, i.e., the value
56* by which the diagonal and offdiagonal entries of the array A
57* as specified by UPLO and IOFFD are scaled.
58*
59* A (input/output) COMPLEX array
60* On entry, A is an array of dimension (LDA,N). Before entry
61* with UPLO = 'U' or 'u', the leading m by n part of the array
62* A must contain the upper trapezoidal part of the matrix as
63* specified by IOFFD to be scaled, and the strictly lower tra-
64* pezoidal part of A is not referenced; When UPLO = 'L' or 'l',
65* the leading m by n part of the array A must contain the lower
66* trapezoidal part of the matrix as specified by IOFFD to be
67* scaled, and the strictly upper trapezoidal part of A is not
68* referenced. On exit, the entries of the trapezoid part of A
69* determined by UPLO and IOFFD are conjugated and scaled.
70*
71* LDA (input) INTEGER
72* On entry, LDA specifies the leading dimension of the array A.
73* LDA must be at least max( 1, M ).
74*
75* Notes
76* =====
77* N N
78* ---------------------------- -----------
79* | d | | |
80* M | d 'U' | | 'U' |
81* | 'L' 'D' | |d |
82* | d | M | d |
83* ---------------------------- | 'D' |
84* | d |
85* IOFFD < 0 | 'L' d |
86* | d|
87* N | |
88* ----------- -----------
89* | d 'U'|
90* | d | IOFFD > 0
91* M | 'D' |
92* | d| N
93* | 'L' | ----------------------------
94* | | | 'U' |
95* | | |d |
96* | | | 'D' |
97* | | | d |
98* | | |'L' d |
99* ----------- ----------------------------
100*
101* -- Written on April 1, 1998 by
102* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
103*
104* =====================================================================
105*
106* .. Parameters ..
107 COMPLEX ONE, ZERO
108 parameter( one = ( 1.0e+0, 0.0e+0 ),
109 $ zero = ( 0.0e+0, 0.0e+0 ) )
110* ..
111* .. Local Scalars ..
112 INTEGER I, J, JTMP, MN
113* ..
114* .. External Subroutines ..
115 EXTERNAL ctzpad
116* ..
117* .. External Functions ..
118 LOGICAL LSAME
119 EXTERNAL lsame
120* ..
121* .. Intrinsic Functions ..
122 INTRINSIC conjg, max, min
123* ..
124* .. Executable Statements ..
125*
126* Quick return if possible
127*
128 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
129 $ RETURN
130*
131* Start the operations
132*
133 IF( alpha.EQ.zero ) THEN
134*
135 CALL ctzpad( uplo, 'N', m, n, ioffd, zero, zero, a, lda )
136*
137 ELSE IF( alpha.EQ.one ) THEN
138*
139 IF( lsame( uplo, 'l' ) ) THEN
140*
141 MN = MAX( 0, -IOFFD )
142 DO 20 J = 1, MIN( MN, N )
143 DO 10 I = 1, M
144 A( I, J ) = CONJG( A( I, J ) )
145 10 CONTINUE
146 20 CONTINUE
147*
148 DO 40 J = MN + 1, MIN( M - IOFFD, N )
149 DO 30 I = J + IOFFD, M
150 A( I, J ) = CONJG( A( I, J ) )
151 30 CONTINUE
152 40 CONTINUE
153*
154 ELSE IF( LSAME( UPLO, 'u' ) ) THEN
155*
156* Scales the upper triangular part of the array by ALPHA.
157*
158 MN = MIN( M - IOFFD, N )
159 DO 60 J = MAX( 0, -IOFFD ) + 1, MN
160 DO 50 I = 1, J + IOFFD
161 A( I, J ) = CONJG( A( I, J ) )
162 50 CONTINUE
163 60 CONTINUE
164*
165 DO 80 J = MAX( 0, MN ) + 1, N
166 DO 70 I = 1, M
167 A( I, J ) = CONJG( A( I, J ) )
168 70 CONTINUE
169 80 CONTINUE
170*
171 ELSE IF( LSAME( UPLO, 'd' ) ) THEN
172*
173* Scales the diagonal entries by ALPHA.
174*
175 DO 90 J = MAX( 0, -IOFFD ) + 1, MIN( M - IOFFD, N )
176 JTMP = J + IOFFD
177 A( JTMP, J ) = CONJG( A( JTMP, J ) )
178 90 CONTINUE
179*
180 ELSE
181*
182* Scales the entire array by ALPHA.
183*
184 DO 110 J = 1, N
185 DO 100 I = 1, M
186 A( I, J ) = CONJG( A( I, J ) )
187 100 CONTINUE
188 110 CONTINUE
189*
190 END IF
191*
192 ELSE
193*
194 IF( LSAME( UPLO, 'l' ) ) THEN
195*
196* Scales the lower triangular part of the array by ALPHA.
197*
198 MN = MAX( 0, -IOFFD )
199 DO 130 J = 1, MIN( MN, N )
200 DO 120 I = 1, M
201 A( I, J ) = ALPHA * CONJG( A( I, J ) )
202 120 CONTINUE
203 130 CONTINUE
204*
205 DO 150 J = MN + 1, MIN( M - IOFFD, N )
206 DO 140 I = J + IOFFD, M
207 A( I, J ) = ALPHA * CONJG( A( I, J ) )
208 140 CONTINUE
209 150 CONTINUE
210*
211 ELSE IF( LSAME( UPLO, 'u' ) ) THEN
212*
213* Scales the upper triangular part of the array by ALPHA.
214*
215 MN = MIN( M - IOFFD, N )
216 DO 170 J = MAX( 0, -IOFFD ) + 1, MN
217 DO 160 I = 1, J + IOFFD
218 A( I, J ) = ALPHA * CONJG( A( I, J ) )
219 160 CONTINUE
220 170 CONTINUE
221*
222 DO 190 J = MAX( 0, MN ) + 1, N
223 DO 180 I = 1, M
224 A( I, J ) = ALPHA * CONJG( A( I, J ) )
225 180 CONTINUE
226 190 CONTINUE
227*
228 ELSE IF( LSAME( UPLO, 'd' ) ) THEN
229*
230* Scales the diagonal entries by ALPHA.
231*
232 DO 200 J = MAX( 0, -IOFFD ) + 1, MIN( M - IOFFD, N )
233 JTMP = J + IOFFD
234 A( JTMP, J ) = ALPHA * CONJG( A( JTMP, J ) )
235 200 CONTINUE
236*
237 ELSE
238*
239* Scales the entire array by ALPHA.
240*
241 DO 220 J = 1, N
242 DO 210 I = 1, M
243 A( I, J ) = ALPHA * CONJG( A( I, J ) )
244 210 CONTINUE
245 220 CONTINUE
246*
247 END IF
248*
249 END IF
250*
251 RETURN
252*
253* End of CTZCNJG
254*
subroutine ctzpad(uplo, herm, m, n, ioffd, alpha, beta, a, lda)
Definition ctzpad.f:2
#define alpha
Definition eval.h:35
logical function lsame(ca, cb)
LSAME
Definition lsame.f:53
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21