1CTFSM(1)LAPACK routine (version 3.2) CTFSM(1)
2
3
4
6 CTFSM - 3 BLAS like routine for A in RFP Format
7
9 SUBROUTINE CTFSM( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA, A,
10
11 + B, LDB )
12
13 CHARACTER TRANSR, DIAG, SIDE, TRANS, UPLO
14
15 INTEGER LDB, M, N
16
17 COMPLEX ALPHA
18
19 COMPLEX A( 0: * ), B( 0: LDB-1, 0: * )
20
22 Level 3 BLAS like routine for A in RFP Format. CTFSM solves the matrix
23 equation
24 op( A )*X = alpha*B or X*op( A ) = alpha*B
25 where alpha is a scalar, X and B are m by n matrices, A is a unit, or
26 non-unit, upper or lower triangular matrix and op( A ) is one of
27 op( A ) = A or op( A ) = conjg( A' ).
28 A is in Rectangular Full Packed (RFP) Format.
29 The matrix X is overwritten on B.
30
32 TRANSR - (input) CHARACTER = 'N': The Normal Form of RFP A is stored;
33 = 'C': The Conjugate-transpose Form of RFP A is stored.
34
35 SIDE - (input) CHARACTER
36 On entry, SIDE specifies whether op( A ) appears on the left or
37 right of X as follows: SIDE = 'L' or 'l' op( A )*X = alpha*B.
38 SIDE = 'R' or 'r' X*op( A ) = alpha*B. Unchanged on exit.
39
40 UPLO - (input) CHARACTER
41 On entry, UPLO specifies whether the RFP matrix A came from an
42 upper or lower triangular matrix as follows: UPLO = 'U' or 'u'
43 RFP A came from an upper triangular matrix UPLO = 'L' or 'l' RFP
44 A came from a lower triangular matrix Unchanged on exit.
45
46 TRANS - (input) CHARACTER
47 On entry, TRANS specifies the form of op( A ) to be used in the
48 matrix multiplication as follows:
49
50 TRANS = 'N' or 'n' op( A ) = A.
51
52 TRANS = 'C' or 'c' op( A ) = conjg( A' ).
53 Unchanged on exit.
54
55 DIAG - (input) CHARACTER
56 On entry, DIAG specifies whether or not RFP A is unit triangular
57 as follows: DIAG = 'U' or 'u' A is assumed to be unit triangu‐
58 lar. DIAG = 'N' or 'n' A is not assumed to be unit triangu‐
59 lar. Unchanged on exit.
60
61 M - (input) INTEGER.
62 On entry, M specifies the number of rows of B. M must be at
63 least zero. Unchanged on exit.
64
65 N - (input) INTEGER.
66 On entry, N specifies the number of columns of B. N must be at
67 least zero. Unchanged on exit.
68
69 ALPHA - (input) COMPLEX.
70 On entry, ALPHA specifies the scalar alpha. When alpha is
71 zero then A is not referenced and B need not be set before
72 entry. Unchanged on exit.
73
74 A - (input) COMPLEX array, dimension ( N*(N+1)/2 );
75 NT = N*(N+1)/2. On entry, the matrix A in RFP Format. RFP For‐
76 mat is described by TRANSR, UPLO and N as follows:
77 If TRANSR='N' then RFP A is (0:N,0:K-1) when N is even;
78 K=N/2. RFP A is (0:N-1,0:K) when N is odd; K=N/2. If TRANSR =
79 'C' then RFP is the Conjugate-transpose of RFP A as defined when
80 TRANSR = 'N'. The contents of RFP A are defined by UPLO as fol‐
81 lows: If UPLO = 'U' the RFP A contains the NT elements of upper
82 packed A either in normal or conjugate-transpose Format. If UPLO
83 = 'L' the RFP A contains the NT elements of lower packed A
84 either in normal or conjugate-transpose Format. The LDA of RFP A
85 is (N+1)/2 when TRANSR = 'C'. When TRANSR is 'N' the LDA is N+1
86 when N is even and is N when is odd. See the Note below for
87 more details. Unchanged on exit.
88
89 B - (input/ouptut) COMPLEX array, DIMENSION ( LDB, N )
90 Before entry, the leading m by n part of the array B must
91 contain the right-hand side matrix B, and on exit is
92 overwritten by the solution matrix X.
93
94 LDB - (input) INTEGER.
95 On entry, LDB specifies the first dimension of B as declared in
96 the calling (sub) program. LDB must be at least max( 1,
97 m ). Unchanged on exit.
98
100 We first consider Standard Packed Format when N is even.
101 We give an example where N = 6.
102 AP is Upper AP is Lower
103 00 01 02 03 04 05 00
104 11 12 13 14 15 10 11
105 22 23 24 25 20 21 22
106 33 34 35 30 31 32 33
107 44 45 40 41 42 43 44
108 55 50 51 52 53 54 55
109 Let TRANSR = 'N'. RFP holds AP as follows:
110 For UPLO = 'U' the upper trapezoid A(0:5,0:2) consists of the last
111 three columns of AP upper. The lower triangle A(4:6,0:2) consists of
112 conjugate-transpose of the first three columns of AP upper. For UPLO =
113 'L' the lower trapezoid A(1:6,0:2) consists of the first three columns
114 of AP lower. The upper triangle A(0:2,0:2) consists of conjugate-trans‐
115 pose of the last three columns of AP lower. To denote conjugate we
116 place -- above the element. This covers the case N even and TRANSR =
117 'N'.
118 RFP A RFP A
119 -- -- --
120 03 04 05 33 43 53
121 -- --
122 13 14 15 00 44 54
123 --
124 23 24 25 10 11 55
125 33 34 35 20 21 22
126 --
127 00 44 45 30 31 32
128 -- --
129 01 11 55 40 41 42
130 -- -- --
131 02 12 22 50 51 52
132 Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate-
133 transpose of RFP A above. One therefore gets:
134 RFP A RFP A
135 -- -- -- -- -- -- -- -- -- --
136 03 13 23 33 00 01 02 33 00 10 20 30 40 50
137 -- -- -- -- -- -- -- -- -- --
138 04 14 24 34 44 11 12 43 44 11 21 31 41 51
139 -- -- -- -- -- -- -- -- -- --
140 05 15 25 35 45 55 22 53 54 55 22 32 42 52
141 We next consider Standard Packed Format when N is odd.
142 We give an example where N = 5.
143 AP is Upper AP is Lower
144 00 01 02 03 04 00
145 11 12 13 14 10 11
146 22 23 24 20 21 22
147 33 34 30 31 32 33
148 44 40 41 42 43 44
149 Let TRANSR = 'N'. RFP holds AP as follows:
150 For UPLO = 'U' the upper trapezoid A(0:4,0:2) consists of the last
151 three columns of AP upper. The lower triangle A(3:4,0:1) consists of
152 conjugate-transpose of the first two columns of AP upper. For UPLO =
153 'L' the lower trapezoid A(0:4,0:2) consists of the first three columns
154 of AP lower. The upper triangle A(0:1,1:2) consists of conjugate-trans‐
155 pose of the last two columns of AP lower. To denote conjugate we
156 place -- above the element. This covers the case N odd and TRANSR =
157 'N'.
158 RFP A RFP A
159 -- --
160 02 03 04 00 33 43
161 --
162 12 13 14 10 11 44
163 22 23 24 20 21 22
164 --
165 00 33 34 30 31 32
166 -- --
167 01 11 44 40 41 42
168 Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate-
169 transpose of RFP A above. One therefore gets:
170 RFP A RFP A
171 -- -- -- -- -- -- -- -- --
172 02 12 22 00 01 00 10 20 30 40 50
173 -- -- -- -- -- -- -- -- --
174 03 13 23 33 11 33 11 21 31 41 51
175 -- -- -- -- -- -- -- -- --
176 04 14 24 34 44 43 44 22 32 42 52
177 ..
178
179
180
181 LAPACK routine (version 3.2) November 2008 CTFSM(1)