LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
sspsv.f
Go to the documentation of this file.
1*> \brief <b> SSPSV computes the solution to system of linear equations A * X = B for OTHER matrices</b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SSPSV + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sspsv.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sspsv.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sspsv.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SSPSV( UPLO, N, NRHS, AP, IPIV, B, LDB, INFO )
20*
21* .. Scalar Arguments ..
22* CHARACTER UPLO
23* INTEGER INFO, LDB, N, NRHS
24* ..
25* .. Array Arguments ..
26* INTEGER IPIV( * )
27* REAL AP( * ), B( LDB, * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> SSPSV computes the solution to a real system of linear equations
37*> A * X = B,
38*> where A is an N-by-N symmetric matrix stored in packed format and X
39*> and B are N-by-NRHS matrices.
40*>
41*> The diagonal pivoting method is used to factor A as
42*> A = U * D * U**T, if UPLO = 'U', or
43*> A = L * D * L**T, if UPLO = 'L',
44*> where U (or L) is a product of permutation and unit upper (lower)
45*> triangular matrices, D is symmetric and block diagonal with 1-by-1
46*> and 2-by-2 diagonal blocks. The factored form of A is then used to
47*> solve the system of equations A * X = B.
48*> \endverbatim
49*
50* Arguments:
51* ==========
52*
53*> \param[in] UPLO
54*> \verbatim
55*> UPLO is CHARACTER*1
56*> = 'U': Upper triangle of A is stored;
57*> = 'L': Lower triangle of A is stored.
58*> \endverbatim
59*>
60*> \param[in] N
61*> \verbatim
62*> N is INTEGER
63*> The number of linear equations, i.e., the order of the
64*> matrix A. N >= 0.
65*> \endverbatim
66*>
67*> \param[in] NRHS
68*> \verbatim
69*> NRHS is INTEGER
70*> The number of right hand sides, i.e., the number of columns
71*> of the matrix B. NRHS >= 0.
72*> \endverbatim
73*>
74*> \param[in,out] AP
75*> \verbatim
76*> AP is REAL array, dimension (N*(N+1)/2)
77*> On entry, the upper or lower triangle of the symmetric matrix
78*> A, packed columnwise in a linear array. The j-th column of A
79*> is stored in the array AP as follows:
80*> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
81*> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
82*> See below for further details.
83*>
84*> On exit, the block diagonal matrix D and the multipliers used
85*> to obtain the factor U or L from the factorization
86*> A = U*D*U**T or A = L*D*L**T as computed by SSPTRF, stored as
87*> a packed triangular matrix in the same storage format as A.
88*> \endverbatim
89*>
90*> \param[out] IPIV
91*> \verbatim
92*> IPIV is INTEGER array, dimension (N)
93*> Details of the interchanges and the block structure of D, as
94*> determined by SSPTRF. If IPIV(k) > 0, then rows and columns
95*> k and IPIV(k) were interchanged, and D(k,k) is a 1-by-1
96*> diagonal block. If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0,
97*> then rows and columns k-1 and -IPIV(k) were interchanged and
98*> D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If UPLO = 'L' and
99*> IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and
100*> -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2
101*> diagonal block.
102*> \endverbatim
103*>
104*> \param[in,out] B
105*> \verbatim
106*> B is REAL array, dimension (LDB,NRHS)
107*> On entry, the N-by-NRHS right hand side matrix B.
108*> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
109*> \endverbatim
110*>
111*> \param[in] LDB
112*> \verbatim
113*> LDB is INTEGER
114*> The leading dimension of the array B. LDB >= max(1,N).
115*> \endverbatim
116*>
117*> \param[out] INFO
118*> \verbatim
119*> INFO is INTEGER
120*> = 0: successful exit
121*> < 0: if INFO = -i, the i-th argument had an illegal value
122*> > 0: if INFO = i, D(i,i) is exactly zero. The factorization
123*> has been completed, but the block diagonal matrix D is
124*> exactly singular, so the solution could not be
125*> computed.
126*> \endverbatim
127*
128* Authors:
129* ========
130*
131*> \author Univ. of Tennessee
132*> \author Univ. of California Berkeley
133*> \author Univ. of Colorado Denver
134*> \author NAG Ltd.
135*
136*> \ingroup hpsv
137*
138*> \par Further Details:
139* =====================
140*>
141*> \verbatim
142*>
143*> The packed storage scheme is illustrated by the following example
144*> when N = 4, UPLO = 'U':
145*>
146*> Two-dimensional storage of the symmetric matrix A:
147*>
148*> a11 a12 a13 a14
149*> a22 a23 a24
150*> a33 a34 (aij = aji)
151*> a44
152*>
153*> Packed storage of the upper triangle of A:
154*>
155*> AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
156*> \endverbatim
157*>
158* =====================================================================
159 SUBROUTINE sspsv( UPLO, N, NRHS, AP, IPIV, B, LDB, INFO )
160*
161* -- LAPACK driver routine --
162* -- LAPACK is a software package provided by Univ. of Tennessee, --
163* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
164*
165* .. Scalar Arguments ..
166 CHARACTER UPLO
167 INTEGER INFO, LDB, N, NRHS
168* ..
169* .. Array Arguments ..
170 INTEGER IPIV( * )
171 REAL AP( * ), B( LDB, * )
172* ..
173*
174* =====================================================================
175*
176* .. External Functions ..
177 LOGICAL LSAME
178 EXTERNAL lsame
179* ..
180* .. External Subroutines ..
181 EXTERNAL ssptrf, ssptrs, xerbla
182* ..
183* .. Intrinsic Functions ..
184 INTRINSIC max
185* ..
186* .. Executable Statements ..
187*
188* Test the input parameters.
189*
190 info = 0
191 IF( .NOT.lsame( uplo, 'U' ) .AND.
192 $ .NOT.lsame( uplo, 'L' ) ) THEN
193 info = -1
194 ELSE IF( n.LT.0 ) THEN
195 info = -2
196 ELSE IF( nrhs.LT.0 ) THEN
197 info = -3
198 ELSE IF( ldb.LT.max( 1, n ) ) THEN
199 info = -7
200 END IF
201 IF( info.NE.0 ) THEN
202 CALL xerbla( 'SSPSV ', -info )
203 RETURN
204 END IF
205*
206* Compute the factorization A = U*D*U**T or A = L*D*L**T.
207*
208 CALL ssptrf( uplo, n, ap, ipiv, info )
209 IF( info.EQ.0 ) THEN
210*
211* Solve the system A*X = B, overwriting B with X.
212*
213 CALL ssptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
214*
215 END IF
216 RETURN
217*
218* End of SSPSV
219*
220 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine sspsv(uplo, n, nrhs, ap, ipiv, b, ldb, info)
SSPSV computes the solution to system of linear equations A * X = B for OTHER matrices
Definition sspsv.f:160
subroutine ssptrf(uplo, n, ap, ipiv, info)
SSPTRF
Definition ssptrf.f:155
subroutine ssptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
SSPTRS
Definition ssptrs.f:113