1ZLATPS(1) LAPACK auxiliary routine (version 3.1) ZLATPS(1)
2
3
4
6 ZLATPS - one of the triangular systems A * x = s*b, A**T * x = s*b,
7 or A**H * x = s*b,
8
10 SUBROUTINE ZLATPS( UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM,
11 INFO )
12
13 CHARACTER DIAG, NORMIN, TRANS, UPLO
14
15 INTEGER INFO, N
16
17 DOUBLE PRECISION SCALE
18
19 DOUBLE PRECISION CNORM( * )
20
21 COMPLEX*16 AP( * ), X( * )
22
24 ZLATPS solves one of the triangular systems
25
26 with scaling to prevent overflow, where A is an upper or lower triangu‐
27 lar matrix stored in packed form. Here A**T denotes the transpose of
28 A, A**H denotes the conjugate transpose of A, x and b are n-element
29 vectors, and s is a scaling factor, usually less than or equal to 1,
30 chosen so that the components of x will be less than the overflow
31 threshold. If the unscaled problem will not cause overflow, the Level
32 2 BLAS routine ZTPSV is called. If the matrix A is singular (A(j,j) = 0
33 for some j), then s is set to 0 and a non-trivial solution to A*x = 0
34 is returned.
35
36
38 UPLO (input) CHARACTER*1
39 Specifies whether the matrix A is upper or lower triangular. =
40 'U': Upper triangular
41 = 'L': Lower triangular
42
43 TRANS (input) CHARACTER*1
44 Specifies the operation applied to A. = 'N': Solve A * x =
45 s*b (No transpose)
46 = 'T': Solve A**T * x = s*b (Transpose)
47 = 'C': Solve A**H * x = s*b (Conjugate transpose)
48
49 DIAG (input) CHARACTER*1
50 Specifies whether or not the matrix A is unit triangular. =
51 'N': Non-unit triangular
52 = 'U': Unit triangular
53
54 NORMIN (input) CHARACTER*1
55 Specifies whether CNORM has been set or not. = 'Y': CNORM
56 contains the column norms on entry
57 = 'N': CNORM is not set on entry. On exit, the norms will be
58 computed and stored in CNORM.
59
60 N (input) INTEGER
61 The order of the matrix A. N >= 0.
62
63 AP (input) COMPLEX*16 array, dimension (N*(N+1)/2)
64 The upper or lower triangular matrix A, packed columnwise in a
65 linear array. The j-th column of A is stored in the array AP
66 as follows: if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for
67 1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for
68 j<=i<=n.
69
70 X (input/output) COMPLEX*16 array, dimension (N)
71 On entry, the right hand side b of the triangular system. On
72 exit, X is overwritten by the solution vector x.
73
74 SCALE (output) DOUBLE PRECISION
75 The scaling factor s for the triangular system A * x = s*b,
76 A**T * x = s*b, or A**H * x = s*b. If SCALE = 0, the matrix
77 A is singular or badly scaled, and the vector x is an exact or
78 approximate solution to A*x = 0.
79
80 CNORM (input or output) DOUBLE PRECISION array, dimension (N)
81
82 If NORMIN = 'Y', CNORM is an input argument and CNORM(j) con‐
83 tains the norm of the off-diagonal part of the j-th column of
84 A. If TRANS = 'N', CNORM(j) must be greater than or equal to
85 the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j) must be
86 greater than or equal to the 1-norm.
87
88 If NORMIN = 'N', CNORM is an output argument and CNORM(j)
89 returns the 1-norm of the offdiagonal part of the j-th column
90 of A.
91
92 INFO (output) INTEGER
93 = 0: successful exit
94 < 0: if INFO = -k, the k-th argument had an illegal value
95
97 A rough bound on x is computed; if that is less than overflow, ZTPSV is
98 called, otherwise, specific code is used which checks for possible
99 overflow or divide-by-zero at every operation.
100
101 A columnwise scheme is used for solving A*x = b. The basic algorithm
102 if A is lower triangular is
103
104 x[1:n] := b[1:n]
105 for j = 1, ..., n
106 x(j) := x(j) / A(j,j)
107 x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j]
108 end
109
110 Define bounds on the components of x after j iterations of the loop:
111 M(j) = bound on x[1:j]
112 G(j) = bound on x[j+1:n]
113 Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}.
114
115 Then for iteration j+1 we have
116 M(j+1) <= G(j) / | A(j+1,j+1) |
117 G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] |
118 <= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | )
119
120 where CNORM(j+1) is greater than or equal to the infinity-norm of col‐
121 umn j+1 of A, not counting the diagonal. Hence
122
123 G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | )
124 1<=i<=j
125 and
126
127 |x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| )
128 1<=i< j
129
130 Since |x(j)| <= M(j), we use the Level 2 BLAS routine ZTPSV if the
131 reciprocal of the largest M(j), j=1,..,n, is larger than
132 max(underflow, 1/overflow).
133
134 The bound on x(j) is also used to determine when a step in the column‐
135 wise method can be performed without fear of overflow. If the computed
136 bound is greater than a large constant, x is scaled to prevent over‐
137 flow, but if the bound overflows, x is set to 0, x(j) to 1, and scale
138 to 0, and a non-trivial solution to A*x = 0 is found.
139
140 Similarly, a row-wise scheme is used to solve A**T *x = b or A**H *x =
141 b. The basic algorithm for A upper triangular is
142
143 for j = 1, ..., n
144 x(j) := ( b(j) - A[1:j-1,j]' * x[1:j-1] ) / A(j,j)
145 end
146
147 We simultaneously compute two bounds
148 G(j) = bound on ( b(i) - A[1:i-1,i]' * x[1:i-1] ), 1<=i<=j
149 M(j) = bound on x(i), 1<=i<=j
150
151 The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we add
152 the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1. Then the
153 bound on x(j) is
154
155 M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) |
156
157 <= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| )
158 1<=i<=j
159
160 and we can safely call ZTPSV if 1/M(n) and 1/G(n) are both greater than
161 max(underflow, 1/overflow).
162
163
164
165
166 LAPACK auxiliary routine (versionNo3v.e1m)ber 2006 ZLATPS(1)