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