LAPACK 3.3.0
|
00001 SUBROUTINE CPTSV( N, NRHS, D, E, B, LDB, INFO ) 00002 * 00003 * -- LAPACK routine (version 3.2) -- 00004 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00005 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00006 * November 2006 00007 * 00008 * .. Scalar Arguments .. 00009 INTEGER INFO, LDB, N, NRHS 00010 * .. 00011 * .. Array Arguments .. 00012 REAL D( * ) 00013 COMPLEX B( LDB, * ), E( * ) 00014 * .. 00015 * 00016 * Purpose 00017 * ======= 00018 * 00019 * CPTSV computes the solution to a complex system of linear equations 00020 * A*X = B, where A is an N-by-N Hermitian positive definite tridiagonal 00021 * matrix, and X and B are N-by-NRHS matrices. 00022 * 00023 * A is factored as A = L*D*L**H, and the factored form of A is then 00024 * used to solve the system of equations. 00025 * 00026 * Arguments 00027 * ========= 00028 * 00029 * N (input) INTEGER 00030 * The order of the matrix A. N >= 0. 00031 * 00032 * NRHS (input) INTEGER 00033 * The number of right hand sides, i.e., the number of columns 00034 * of the matrix B. NRHS >= 0. 00035 * 00036 * D (input/output) REAL array, dimension (N) 00037 * On entry, the n diagonal elements of the tridiagonal matrix 00038 * A. On exit, the n diagonal elements of the diagonal matrix 00039 * D from the factorization A = L*D*L**H. 00040 * 00041 * E (input/output) COMPLEX array, dimension (N-1) 00042 * On entry, the (n-1) subdiagonal elements of the tridiagonal 00043 * matrix A. On exit, the (n-1) subdiagonal elements of the 00044 * unit bidiagonal factor L from the L*D*L**H factorization of 00045 * A. E can also be regarded as the superdiagonal of the unit 00046 * bidiagonal factor U from the U**H*D*U factorization of A. 00047 * 00048 * B (input/output) COMPLEX array, dimension (LDB,NRHS) 00049 * On entry, the N-by-NRHS right hand side matrix B. 00050 * On exit, if INFO = 0, the N-by-NRHS solution matrix X. 00051 * 00052 * LDB (input) INTEGER 00053 * The leading dimension of the array B. LDB >= max(1,N). 00054 * 00055 * INFO (output) INTEGER 00056 * = 0: successful exit 00057 * < 0: if INFO = -i, the i-th argument had an illegal value 00058 * > 0: if INFO = i, the leading minor of order i is not 00059 * positive definite, and the solution has not been 00060 * computed. The factorization has not been completed 00061 * unless i = N. 00062 * 00063 * ===================================================================== 00064 * 00065 * .. External Subroutines .. 00066 EXTERNAL CPTTRF, CPTTRS, XERBLA 00067 * .. 00068 * .. Intrinsic Functions .. 00069 INTRINSIC MAX 00070 * .. 00071 * .. Executable Statements .. 00072 * 00073 * Test the input parameters. 00074 * 00075 INFO = 0 00076 IF( N.LT.0 ) THEN 00077 INFO = -1 00078 ELSE IF( NRHS.LT.0 ) THEN 00079 INFO = -2 00080 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN 00081 INFO = -6 00082 END IF 00083 IF( INFO.NE.0 ) THEN 00084 CALL XERBLA( 'CPTSV ', -INFO ) 00085 RETURN 00086 END IF 00087 * 00088 * Compute the L*D*L' (or U'*D*U) factorization of A. 00089 * 00090 CALL CPTTRF( N, D, E, INFO ) 00091 IF( INFO.EQ.0 ) THEN 00092 * 00093 * Solve the system A*X = B, overwriting B with X. 00094 * 00095 CALL CPTTRS( 'Lower', N, NRHS, D, E, B, LDB, INFO ) 00096 END IF 00097 RETURN 00098 * 00099 * End of CPTSV 00100 * 00101 END