EVAHF

Computes the largest or smallest eigenvalues of a complex Hermitian matrix.

Required Arguments

NEVAL — Number of eigenvalues to be calculated. (Input)

A — Complex Hermitian matrix of order N. (Input)

Only the upper triangle is used.

Only the upper triangle is used.

SMALL — Logical variable. (Input)

If .TRUE., the smallest NEVAL eigenvalues are computed. If .FALSE., the largest NEVAL eigenvalues are computed.

If .TRUE., the smallest NEVAL eigenvalues are computed. If .FALSE., the largest NEVAL eigenvalues are computed.

EVAL — Real vector of length N containing the extreme eigenvalues of A in decreasing order of magnitude in the first NEVAL elements. (Output)

Optional Arguments

N — Order of the matrix A. (Input)

Default: N = SIZE (A,2).

Default: N = SIZE (A,2).

LDA — Leading dimension of A exactly as specified in the dimension statement in the calling program. (Input)

Default: LDA = SIZE (A,1).

Default: LDA = SIZE (A,1).

FORTRAN 90 Interface

Generic: CALL EVAHF (NEVAL, A, SMALL, EVAL [,…])

Specific: The specific interface names are S_EVAHF and D_EVAHF.

FORTRAN 77 Interface

Single: CALL EVAHF (N, NEVAL, A, LDA, SMALL, EVAL)

Double: The double precision name is DEVAHF.

Description

Routine EVAHF computes the largest or smallest eigenvalues of a complex Hermitian matrix. Unitary transformations are used to reduce the matrix to an equivalent symmetric tridiagonal matrix. The rational QR algorithm with Newton corrections is used to compute the extreme eigenvalues of this tridiagonal matrix.

The reduction routine is based on the EISPACK routine HTRIDI. The QR routine is based on the EISPACK routine RATQR. See Smith et al. (1976) for the EISPACK routines.

Comments

1. Workspace may be explicitly provided, if desired, by use of E3AHF/DE3AHF. The reference is

CALL E3AHF (N, NEVAL, A, LDA, SMALL, EVAL, ACOPY, RWK, CWK, IWK)

The additional arguments are as follows:

ACOPY — Complex work array of length N2. A and ACOPY may be the same in which case A will be destroyed.

RWK — Work array of length 2N.

CWK — Complex work array of length 2N.

IWK — Work array of length N.

2. Informational errors

Type | Code | Description |
---|---|---|

3 | 1 | The iteration for an eigenvalue failed to converge. The best estimate will be returned. |

3 | 2 | The matrix is not Hermitian. It has a diagonal entry with a small imaginary part. |

4 | 2 | The matrix is not Hermitian. It has a diagonal entry with an imaginary part. |

Example

In this example, a DATA statement is used to set A to a matrix given by Gregory and Karney (1969, page 114). Its largest eigenvalue is computed and printed.

USE EVAHF_INT

USE WRRRN_INT

IMPLICIT NONE

! Declare variables

INTEGER LDA, N

PARAMETER (N=2, LDA=N)

!

INTEGER NEVAL

REAL EVAL(N)

COMPLEX A(LDA,N)

LOGICAL SMALL

! Set values of A

!

! A = ( 1 -i )

! ( i 1 )

!

DATA A/(1.0,0.0), (0.0,1.0), (0.0,-1.0), (1.0,0.0)/

!

! Find the largest eigenvalue of A

NEVAL = 1

SMALL = .FALSE.

CALL EVAHF (NEVAL, A, SMALL, EVAL)

! Print results

CALL WRRRN ('EVAL', EVAL, 1, NEVAl, 1)

END

Output

EVAL

2.000