1 SUBROUTINE ZPTSV( N, NRHS, D, E, B, LDB, INFO )
2 *
3 * -- LAPACK routine (version 3.3.1) --
4 * -- LAPACK is a software package provided by Univ. of Tennessee, --
5 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
6 * -- April 2011 --
7 *
8 * .. Scalar Arguments ..
9 INTEGER INFO, LDB, N, NRHS
10 * ..
11 * .. Array Arguments ..
12 DOUBLE PRECISION D( * )
13 COMPLEX*16 B( LDB, * ), E( * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * ZPTSV computes the solution to a complex system of linear equations
20 * A*X = B, where A is an N-by-N Hermitian positive definite tridiagonal
21 * matrix, and X and B are N-by-NRHS matrices.
22 *
23 * A is factored as A = L*D*L**H, and the factored form of A is then
24 * used to solve the system of equations.
25 *
26 * Arguments
27 * =========
28 *
29 * N (input) INTEGER
30 * The order of the matrix A. N >= 0.
31 *
32 * NRHS (input) INTEGER
33 * The number of right hand sides, i.e., the number of columns
34 * of the matrix B. NRHS >= 0.
35 *
36 * D (input/output) DOUBLE PRECISION array, dimension (N)
37 * On entry, the n diagonal elements of the tridiagonal matrix
38 * A. On exit, the n diagonal elements of the diagonal matrix
39 * D from the factorization A = L*D*L**H.
40 *
41 * E (input/output) COMPLEX*16 array, dimension (N-1)
42 * On entry, the (n-1) subdiagonal elements of the tridiagonal
43 * matrix A. On exit, the (n-1) subdiagonal elements of the
44 * unit bidiagonal factor L from the L*D*L**H factorization of
45 * A. E can also be regarded as the superdiagonal of the unit
46 * bidiagonal factor U from the U**H*D*U factorization of A.
47 *
48 * B (input/output) COMPLEX*16 array, dimension (LDB,NRHS)
49 * On entry, the N-by-NRHS right hand side matrix B.
50 * On exit, if INFO = 0, the N-by-NRHS solution matrix X.
51 *
52 * LDB (input) INTEGER
53 * The leading dimension of the array B. LDB >= max(1,N).
54 *
55 * INFO (output) INTEGER
56 * = 0: successful exit
57 * < 0: if INFO = -i, the i-th argument had an illegal value
58 * > 0: if INFO = i, the leading minor of order i is not
59 * positive definite, and the solution has not been
60 * computed. The factorization has not been completed
61 * unless i = N.
62 *
63 * =====================================================================
64 *
65 * .. External Subroutines ..
66 EXTERNAL XERBLA, ZPTTRF, ZPTTRS
67 * ..
68 * .. Intrinsic Functions ..
69 INTRINSIC MAX
70 * ..
71 * .. Executable Statements ..
72 *
73 * Test the input parameters.
74 *
75 INFO = 0
76 IF( N.LT.0 ) THEN
77 INFO = -1
78 ELSE IF( NRHS.LT.0 ) THEN
79 INFO = -2
80 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
81 INFO = -6
82 END IF
83 IF( INFO.NE.0 ) THEN
84 CALL XERBLA( 'ZPTSV ', -INFO )
85 RETURN
86 END IF
87 *
88 * Compute the L*D*L**H (or U**H*D*U) factorization of A.
89 *
90 CALL ZPTTRF( N, D, E, INFO )
91 IF( INFO.EQ.0 ) THEN
92 *
93 * Solve the system A*X = B, overwriting B with X.
94 *
95 CALL ZPTTRS( 'Lower', N, NRHS, D, E, B, LDB, INFO )
96 END IF
97 RETURN
98 *
99 * End of ZPTSV
100 *
101 END
2 *
3 * -- LAPACK routine (version 3.3.1) --
4 * -- LAPACK is a software package provided by Univ. of Tennessee, --
5 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
6 * -- April 2011 --
7 *
8 * .. Scalar Arguments ..
9 INTEGER INFO, LDB, N, NRHS
10 * ..
11 * .. Array Arguments ..
12 DOUBLE PRECISION D( * )
13 COMPLEX*16 B( LDB, * ), E( * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * ZPTSV computes the solution to a complex system of linear equations
20 * A*X = B, where A is an N-by-N Hermitian positive definite tridiagonal
21 * matrix, and X and B are N-by-NRHS matrices.
22 *
23 * A is factored as A = L*D*L**H, and the factored form of A is then
24 * used to solve the system of equations.
25 *
26 * Arguments
27 * =========
28 *
29 * N (input) INTEGER
30 * The order of the matrix A. N >= 0.
31 *
32 * NRHS (input) INTEGER
33 * The number of right hand sides, i.e., the number of columns
34 * of the matrix B. NRHS >= 0.
35 *
36 * D (input/output) DOUBLE PRECISION array, dimension (N)
37 * On entry, the n diagonal elements of the tridiagonal matrix
38 * A. On exit, the n diagonal elements of the diagonal matrix
39 * D from the factorization A = L*D*L**H.
40 *
41 * E (input/output) COMPLEX*16 array, dimension (N-1)
42 * On entry, the (n-1) subdiagonal elements of the tridiagonal
43 * matrix A. On exit, the (n-1) subdiagonal elements of the
44 * unit bidiagonal factor L from the L*D*L**H factorization of
45 * A. E can also be regarded as the superdiagonal of the unit
46 * bidiagonal factor U from the U**H*D*U factorization of A.
47 *
48 * B (input/output) COMPLEX*16 array, dimension (LDB,NRHS)
49 * On entry, the N-by-NRHS right hand side matrix B.
50 * On exit, if INFO = 0, the N-by-NRHS solution matrix X.
51 *
52 * LDB (input) INTEGER
53 * The leading dimension of the array B. LDB >= max(1,N).
54 *
55 * INFO (output) INTEGER
56 * = 0: successful exit
57 * < 0: if INFO = -i, the i-th argument had an illegal value
58 * > 0: if INFO = i, the leading minor of order i is not
59 * positive definite, and the solution has not been
60 * computed. The factorization has not been completed
61 * unless i = N.
62 *
63 * =====================================================================
64 *
65 * .. External Subroutines ..
66 EXTERNAL XERBLA, ZPTTRF, ZPTTRS
67 * ..
68 * .. Intrinsic Functions ..
69 INTRINSIC MAX
70 * ..
71 * .. Executable Statements ..
72 *
73 * Test the input parameters.
74 *
75 INFO = 0
76 IF( N.LT.0 ) THEN
77 INFO = -1
78 ELSE IF( NRHS.LT.0 ) THEN
79 INFO = -2
80 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
81 INFO = -6
82 END IF
83 IF( INFO.NE.0 ) THEN
84 CALL XERBLA( 'ZPTSV ', -INFO )
85 RETURN
86 END IF
87 *
88 * Compute the L*D*L**H (or U**H*D*U) factorization of A.
89 *
90 CALL ZPTTRF( N, D, E, INFO )
91 IF( INFO.EQ.0 ) THEN
92 *
93 * Solve the system A*X = B, overwriting B with X.
94 *
95 CALL ZPTTRS( 'Lower', N, NRHS, D, E, B, LDB, INFO )
96 END IF
97 RETURN
98 *
99 * End of ZPTSV
100 *
101 END