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