1 *> \brief \b STFTTR copies a triangular matrix from the rectangular full packed format (TF) to the standard full format (TR).
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download STFTTR + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/stfttr.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/stfttr.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stfttr.f">
21 * SUBROUTINE STFTTR( TRANSR, UPLO, N, ARF, A, LDA, INFO )
23 * .. Scalar Arguments ..
24 * CHARACTER TRANSR, UPLO
25 * INTEGER INFO, N, LDA
27 * .. Array Arguments ..
28 * REAL A( 0: LDA-1, 0: * ), ARF( 0: * )
37 *> STFTTR copies a triangular matrix A from rectangular full packed
38 *> format (TF) to standard full format (TR).
46 *> TRANSR is CHARACTER*1
47 *> = 'N': ARF is in Normal format;
48 *> = 'T': ARF is in Transpose format.
53 *> UPLO is CHARACTER*1
54 *> = 'U': A is upper triangular;
55 *> = 'L': A is lower triangular.
61 *> The order of the matrices ARF and A. N >= 0.
66 *> ARF is REAL array, dimension (N*(N+1)/2).
67 *> On entry, the upper (if UPLO = 'U') or lower (if UPLO = 'L')
68 *> matrix A in RFP format. See the "Notes" below for more
74 *> A is REAL array, dimension (LDA,N)
75 *> On exit, the triangular matrix A. If UPLO = 'U', the
76 *> leading N-by-N upper triangular part of the array A contains
77 *> the upper triangular matrix, and the strictly lower
78 *> triangular part of A is not referenced. If UPLO = 'L', the
79 *> leading N-by-N lower triangular part of the array A contains
80 *> the lower triangular matrix, and the strictly upper
81 *> triangular part of A is not referenced.
87 *> The leading dimension of the array A. LDA >= max(1,N).
93 *> = 0: successful exit
94 *> < 0: if INFO = -i, the i-th argument had an illegal value
100 *> \author Univ. of Tennessee
101 *> \author Univ. of California Berkeley
102 *> \author Univ. of Colorado Denver
105 *> \date September 2012
107 *> \ingroup realOTHERcomputational
109 *> \par Further Details:
110 * =====================
114 *> We first consider Rectangular Full Packed (RFP) Format when N is
115 *> even. We give an example where N = 6.
117 *> AP is Upper AP is Lower
119 *> 00 01 02 03 04 05 00
120 *> 11 12 13 14 15 10 11
121 *> 22 23 24 25 20 21 22
122 *> 33 34 35 30 31 32 33
123 *> 44 45 40 41 42 43 44
124 *> 55 50 51 52 53 54 55
127 *> Let TRANSR = 'N'. RFP holds AP as follows:
128 *> For UPLO = 'U' the upper trapezoid A(0:5,0:2) consists of the last
129 *> three columns of AP upper. The lower triangle A(4:6,0:2) consists of
130 *> the transpose of the first three columns of AP upper.
131 *> For UPLO = 'L' the lower trapezoid A(1:6,0:2) consists of the first
132 *> three columns of AP lower. The upper triangle A(0:2,0:2) consists of
133 *> the transpose of the last three columns of AP lower.
134 *> This covers the case N even and TRANSR = 'N'.
146 *> Now let TRANSR = 'T'. RFP A in both UPLO cases is just the
147 *> transpose of RFP A above. One therefore gets:
152 *> 03 13 23 33 00 01 02 33 00 10 20 30 40 50
153 *> 04 14 24 34 44 11 12 43 44 11 21 31 41 51
154 *> 05 15 25 35 45 55 22 53 54 55 22 32 42 52
157 *> We then consider Rectangular Full Packed (RFP) Format when N is
158 *> odd. We give an example where N = 5.
160 *> AP is Upper AP is Lower
169 *> Let TRANSR = 'N'. RFP holds AP as follows:
170 *> For UPLO = 'U' the upper trapezoid A(0:4,0:2) consists of the last
171 *> three columns of AP upper. The lower triangle A(3:4,0:1) consists of
172 *> the transpose of the first two columns of AP upper.
173 *> For UPLO = 'L' the lower trapezoid A(0:4,0:2) consists of the first
174 *> three columns of AP lower. The upper triangle A(0:1,1:2) consists of
175 *> the transpose of the last two columns of AP lower.
176 *> This covers the case N odd and TRANSR = 'N'.
186 *> Now let TRANSR = 'T'. RFP A in both UPLO cases is just the
187 *> transpose of RFP A above. One therefore gets:
191 *> 02 12 22 00 01 00 10 20 30 40 50
192 *> 03 13 23 33 11 33 11 21 31 41 51
193 *> 04 14 24 34 44 43 44 22 32 42 52
196 * =====================================================================
197 SUBROUTINE STFTTR( TRANSR, UPLO, N, ARF, A, LDA, INFO )
199 * -- LAPACK computational routine (version 3.4.2) --
200 * -- LAPACK is a software package provided by Univ. of Tennessee, --
201 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
204 * .. Scalar Arguments ..
205 CHARACTER TRANSR, UPLO
208 * .. Array Arguments ..
209 REAL A( 0: LDA-1, 0: * ), ARF( 0: * )
212 * =====================================================================
215 * .. Local Scalars ..
216 LOGICAL LOWER, NISODD, NORMALTRANSR
217 INTEGER N1, N2, K, NT, NX2, NP1X2
220 * .. External Functions ..
224 * .. External Subroutines ..
227 * .. Intrinsic Functions ..
230 * .. Executable Statements ..
232 * Test the input parameters.
235 NORMALTRANSR = LSAME( TRANSR, 'N' )
236 LOWER = LSAME( UPLO, 'L' )
237 IF( .NOT.NORMALTRANSR .AND. .NOT.LSAME( TRANSR, 'T' ) ) THEN
239 ELSE IF( .NOT.LOWER .AND. .NOT.LSAME( UPLO, 'U' ) ) THEN
241 ELSE IF( N.LT.0 ) THEN
243 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
247 CALL XERBLA( 'STFTTR', -INFO )
251 * Quick return if possible
260 * Size of array ARF(0:nt-1)
264 * set N1 and N2 depending on LOWER: for N even N1=N2=K
274 * If N is odd, set NISODD = .TRUE., LDA=N+1 and A is (N+1)--by--K2.
275 * If N is even, set K = N/2 and NISODD = .FALSE., LDA=N and A is
278 IF( MOD( N, 2 ).EQ.0 ) THEN
293 IF( NORMALTRANSR ) THEN
295 * N is odd and TRANSR = 'N'
299 * N is odd, TRANSR = 'N', and UPLO = 'L'
304 A( N2+J, I ) = ARF( IJ )
308 A( I, J ) = ARF( IJ )
315 * N is odd, TRANSR = 'N', and UPLO = 'U'
320 A( I, J ) = ARF( IJ )
323 DO L = J - N1, N1 - 1
324 A( J-N1, L ) = ARF( IJ )
334 * N is odd and TRANSR = 'T'
338 * N is odd, TRANSR = 'T', and UPLO = 'L'
343 A( J, I ) = ARF( IJ )
347 A( I, N1+J ) = ARF( IJ )
353 A( J, I ) = ARF( IJ )
360 * N is odd, TRANSR = 'T', and UPLO = 'U'
365 A( J, I ) = ARF( IJ )
371 A( I, J ) = ARF( IJ )
375 A( N2+J, L ) = ARF( IJ )
388 IF( NORMALTRANSR ) THEN
390 * N is even and TRANSR = 'N'
394 * N is even, TRANSR = 'N', and UPLO = 'L'
399 A( K+J, I ) = ARF( IJ )
403 A( I, J ) = ARF( IJ )
410 * N is even, TRANSR = 'N', and UPLO = 'U'
415 A( I, J ) = ARF( IJ )
419 A( J-K, L ) = ARF( IJ )
429 * N is even and TRANSR = 'T'
433 * N is even, TRANSR = 'T', and UPLO = 'L'
438 A( I, J ) = ARF( IJ )
443 A( J, I ) = ARF( IJ )
446 DO I = K + 1 + J, N - 1
447 A( I, K+1+J ) = ARF( IJ )
453 A( J, I ) = ARF( IJ )
460 * N is even, TRANSR = 'T', and UPLO = 'U'
465 A( J, I ) = ARF( IJ )
471 A( I, J ) = ARF( IJ )
474 DO L = K + 1 + J, N - 1
475 A( K+1+J, L ) = ARF( IJ )
479 * Note that here, on exit of the loop, J = K-1
481 A( I, J ) = ARF( IJ )