1 *> \brief <b> ZHESV_AASEN computes the solution to system of linear equations A * X = B for HE matrices</b>
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZHESV_AASEN + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zhesv_aasen.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zhesv_aasen.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhesv_aasen.f">
21 * SUBROUTINE ZHESV_AASEN( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK,
24 * .. Scalar Arguments ..
26 * INTEGER INFO, LDA, LDB, LWORK, N, NRHS
28 * .. Array Arguments ..
30 * COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
39 *> ZHESV_AASEN computes the solution to a complex system of linear equations
41 *> where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS
44 *> Aasen's algorithm is used to factor A as
45 *> A = U * T * U**H, if UPLO = 'U', or
46 *> A = L * T * L**H, if UPLO = 'L',
47 *> where U (or L) is a product of permutation and unit upper (lower)
48 *> triangular matrices, and T is Hermitian and tridiagonal. The factored form
49 *> of A is then used to solve the system of equations A * X = B.
57 *> UPLO is CHARACTER*1
58 *> = 'U': Upper triangle of A is stored;
59 *> = 'L': Lower triangle of A is stored.
65 *> The number of linear equations, i.e., the order of the
72 *> The number of right hand sides, i.e., the number of columns
73 *> of the matrix B. NRHS >= 0.
78 *> A is COMPLEX*16 array, dimension (LDA,N)
79 *> On entry, the Hermitian matrix A. If UPLO = 'U', the leading
80 *> N-by-N upper triangular part of A contains the upper
81 *> triangular part of the matrix A, and the strictly lower
82 *> triangular part of A is not referenced. If UPLO = 'L', the
83 *> leading N-by-N lower triangular part of A contains the lower
84 *> triangular part of the matrix A, and the strictly upper
85 *> triangular part of A is not referenced.
87 *> On exit, if INFO = 0, the tridiagonal matrix T and the
88 *> multipliers used to obtain the factor U or L from the
89 *> factorization A = U*T*U**H or A = L*T*L**H as computed by
96 *> The leading dimension of the array A. LDA >= max(1,N).
101 *> IPIV is INTEGER array, dimension (N)
102 *> On exit, it contains the details of the interchanges, i.e.,
103 *> the row and column k of A were interchanged with the
104 *> row and column IPIV(k).
109 *> B is COMPLEX*16 array, dimension (LDB,NRHS)
110 *> On entry, the N-by-NRHS right hand side matrix B.
111 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
117 *> The leading dimension of the array B. LDB >= max(1,N).
122 *> WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
123 *> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
129 *> The length of WORK. LWORK >= 1, and for best performance
130 *> LWORK >= max(1,N*NB), where NB is the optimal blocksize for
132 *> for LWORK < N, TRS will be done with Level BLAS 2
133 *> for LWORK >= N, TRS will be done with Level BLAS 3
135 *> If LWORK = -1, then a workspace query is assumed; the routine
136 *> only calculates the optimal size of the WORK array, returns
137 *> this value as the first entry of the WORK array, and no error
138 *> message related to LWORK is issued by XERBLA.
144 *> = 0: successful exit
145 *> < 0: if INFO = -i, the i-th argument had an illegal value
146 *> > 0: if INFO = i, D(i,i) is exactly zero. The factorization
147 *> has been completed, but the block diagonal matrix D is
148 *> exactly singular, so the solution could not be computed.
154 *> \author Univ. of Tennessee
155 *> \author Univ. of California Berkeley
156 *> \author Univ. of Colorado Denver
159 *> \date November 2016
161 *> \ingroup complex16HEsolve
163 * @precisions fortran z -> c
165 * =====================================================================
166 SUBROUTINE ZHESV_AASEN( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK,
169 * -- LAPACK driver routine (version 3.4.0) --
170 * -- LAPACK is a software package provided by Univ. of Tennessee, --
171 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
174 * .. Scalar Arguments ..
176 INTEGER INFO, LDA, LDB, LWORK, N, NRHS
178 * .. Array Arguments ..
180 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
183 * =====================================================================
185 * .. Local Scalars ..
189 * .. External Functions ..
192 EXTERNAL LSAME, ILAENV
194 * .. External Subroutines ..
195 EXTERNAL XERBLA, ZHETRF, ZHETRS, ZHETRS2
197 * .. Intrinsic Functions ..
200 * .. Executable Statements ..
202 * Test the input parameters.
205 LQUERY = ( LWORK.EQ.-1 )
206 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
208 ELSE IF( N.LT.0 ) THEN
210 ELSE IF( NRHS.LT.0 ) THEN
212 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
214 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
216 ELSE IF( LWORK.LT.MAX(2*N, 3*N-2) .AND. .NOT.LQUERY ) THEN
221 NB = ILAENV( 1, 'ZHETRF_AASEN', UPLO, N, -1, -1, -1 )
222 LWKOPT = MAX( 3*N-2, (1+NB)*N )
227 CALL XERBLA( 'ZHESV_AASEN ', -INFO )
229 ELSE IF( LQUERY ) THEN
233 * Compute the factorization A = U*T*U**H or A = L*T*L**H.
235 CALL ZHETRF_AASEN( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
238 * Solve the system A*X = B, overwriting B with X.
240 CALL ZHETRS_AASEN( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK,