NAG Library Routine Document F08FAF (DSYEV)

Similar documents
NAG Library Routine Document F08FNF (ZHEEV).1

NAG Library Routine Document F08FPF (ZHEEVX)

NAG Library Routine Document F08PNF (ZGEES)

NAG Library Routine Document F08JDF (DSTEVR)

NAG Library Routine Document F07HAF (DPBSV)

NAG Library Routine Document F08UBF (DSBGVX)

NAG Library Routine Document F08VAF (DGGSVD)

NAG Library Routine Document F08QUF (ZTRSEN)

NAG Library Routine Document F08YUF (ZTGSEN).1

NAG Library Routine Document F02HDF.1

NAG Fortran Library Routine Document F04CFF.1

NAG Library Routine Document F08QVF (ZTRSYL)

NAG Library Routine Document F08ZFF (DGGRQF).1

F08BEF (SGEQPF/DGEQPF) NAG Fortran Library Routine Document

NAG Toolbox for Matlab nag_lapack_dggev (f08wa)

F04JGF NAG Fortran Library Routine Document

NAG Library Routine Document C02AGF.1

G01NBF NAG Fortran Library Routine Document

G03ACF NAG Fortran Library Routine Document

Module 6.6: nag nsym gen eig Nonsymmetric Generalized Eigenvalue Problems. Contents

NAG Fortran Library Routine Document D02JAF.1

NAG Library Routine Document D02JAF.1

G13DSF NAG Fortran Library Routine Document

G13CGF NAG Fortran Library Routine Document

G13CCF NAG Fortran Library Routine Document

G13BHF NAG Fortran Library Routine Document

Module 5.2: nag sym lin sys Symmetric Systems of Linear Equations. Contents

NAG C Library Function Document nag_dtrevc (f08qkc)

Exponentials of Symmetric Matrices through Tridiagonal Reductions

G13BAF NAG Fortran Library Routine Document

LAPACK-Style Codes for Level 2 and 3 Pivoted Cholesky Factorizations. C. Lucas. Numerical Analysis Report No February 2004

G13DCF NAG Fortran Library Routine Document

LAPACK-Style Codes for Pivoted Cholesky and QR Updating

LAPACK-Style Codes for Pivoted Cholesky and QR Updating. Hammarling, Sven and Higham, Nicholas J. and Lucas, Craig. MIMS EPrint: 2006.

Aasen s Symmetric Indefinite Linear Solvers in LAPACK

Algorithm 853: an Efficient Algorithm for Solving Rank-Deficient Least Squares Problems

NAG Library Routine Document D02KDF.1

Generalized interval arithmetic on compact matrix Lie groups

D03PEF NAG Fortran Library Routine Document

NAG Toolbox for MATLAB Chapter Introduction. F02 Eigenvalues and Eigenvectors

Computing least squares condition numbers on hybrid multicore/gpu systems

Using Godunov s Two-Sided Sturm Sequences to Accurately Compute Singular Vectors of Bidiagonal Matrices.

D02TYF NAG Fortran Library Routine Document

Positive Denite Matrix. Ya Yan Lu 1. Department of Mathematics. City University of Hong Kong. Kowloon, Hong Kong. Abstract

G13DJF NAG Fortran Library Routine Document

NAG Toolbox for Matlab. g03aa.1

Unsupervised Data Discretization of Mixed Data Types

Implementation for LAPACK of a Block Algorithm for Matrix 1-Norm Estimation

A note on eigenvalue computation for a tridiagonal matrix with real eigenvalues Akiko Fukuda

LAPACK Introduction. Zhaojun Bai University of California/Davis. James Demmel University of California/Berkeley

Module 10.1: nag polynom eqn Roots of Polynomials. Contents

Computation of a canonical form for linear differential-algebraic equations

Eigenvalue problems. Eigenvalue problems

A New Block Algorithm for Full-Rank Solution of the Sylvester-observer Equation.

Section 4.5 Eigenvalues of Symmetric Tridiagonal Matrices

NAG Fortran Library Routine Document D02KDF.1

1. Introduction. Applying the QR algorithm to a real square matrix A yields a decomposition of the form

Matrix Eigensystem Tutorial For Parallel Computation

Stability of a method for multiplying complex matrices with three real matrix multiplications. Higham, Nicholas J. MIMS EPrint: 2006.

2 MULTIPLYING COMPLEX MATRICES It is rare in matrix computations to be able to produce such a clear-cut computational saving over a standard technique

A hybrid Hermitian general eigenvalue solver

Module 10.2: nag nlin eqn Roots of a Single Nonlinear Equation. Contents

The QR Algorithm. Chapter The basic QR algorithm

D. Gimenez, M. T. Camara, P. Montilla. Aptdo Murcia. Spain. ABSTRACT

Jacobian conditioning analysis for model validation

The Matrix Package. March 9, 2001

On aggressive early deflation in parallel variants of the QR algorithm

OUTLINE 1. Introduction 1.1 Notation 1.2 Special matrices 2. Gaussian Elimination 2.1 Vector and matrix norms 2.2 Finite precision arithmetic 2.3 Fact

Algebraic Equations. 2.0 Introduction. Nonsingular versus Singular Sets of Equations. A set of linear algebraic equations looks like this:

The Godunov Inverse Iteration: A Fast and Accurate Solution to the Symmetric Tridiagonal Eigenvalue Problem

Accelerating computation of eigenvectors in the nonsymmetric eigenvalue problem

Symmetric Pivoting in ScaLAPACK Craig Lucas University of Manchester Cray User Group 8 May 2006, Lugano

Accelerating computation of eigenvectors in the dense nonsymmetric eigenvalue problem

11.2 Reduction of a Symmetric Matrix to Tridiagonal Form: Givens and Householder Reductions

Intel Math Kernel Library (Intel MKL) LAPACK

NAG Fortran Library Routine Document D01BBF.1

Beresford N. Parlett Λ. April 22, Early History of Eigenvalue Computations 1. 2 The LU and QR Algorithms 3. 3 The Symmetric Case 8

Eigenvalue Problems and Singular Value Decomposition

Performance Analysis of Parallel Alternating Directions Algorithm for Time Dependent Problems

problem Au = u by constructing an orthonormal basis V k = [v 1 ; : : : ; v k ], at each k th iteration step, and then nding an approximation for the e

MPI Implementations for Solving Dot - Product on Heterogeneous Platforms

NAG Toolbox for Matlab. g08cd.1

Solving Orthogonal Matrix Differential Systems in Mathematica

Porting a Sphere Optimization Program from lapack to scalapack

A Parallel Divide and Conquer Algorithm for the Symmetric Eigenvalue Problem on Distributed Memory Architectures. F Tisseur and J Dongarra

EIGIFP: A MATLAB Program for Solving Large Symmetric Generalized Eigenvalue Problems

COMPUTING THE CONDITION NUMBER OF TRIDIAGONAL AND DIAGONAL-PLUS-SEMISEPARABLE MATRICES IN LINEAR TIME

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

11.5 Reduction of a General Matrix to Hessenberg Form

Block-Partitioned Algorithms for. Solving the Linear Least Squares. Problem. Gregorio Quintana-Orti, Enrique S. Quintana-Orti, and Antoine Petitet

Testing Linear Algebra Software

More Gaussian Elimination and Matrix Inversion

SHHEIG Users Guide. Peter Benner, Vasile Sima, and Matthias Voigt June 10, 2015

CVXOPT Documentation. Release 1.2. Martin S. Andersen, Joachim Dahl, and Lieven Vandenberghe

Module 3.9: nag kelvin fun Kelvin Functions. Contents

Cuppen s Divide and Conquer Algorithm

Performance Evaluation of Some Inverse Iteration Algorithms on PowerXCell T M 8i Processor

Solving the Inverse Toeplitz Eigenproblem Using ScaLAPACK and MPI *

Linear Algebra Methods for Data Mining

Review of Linear Algebra

Transcription:

NAG Library Routine Document (DSYEV) Note: before using this routine, please read the Users Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details. 1 Purpose (DSYEV) computes all the eigenvalues and, optionally, all the eigenvectors of a real n by n symmetric matrix A. 2 Specification SUBROUTINE (JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO) INTEGER N, LDA, LWORK, INFO REAL (KIND=nag_wp) A(LDA,*), W(N), WORK(max(1,LWORK)) CHARACTER(1) JOBZ, UPLO The routine may be called by its LAPACK name dsyev. 3 Description The symmetric matrix A is first reduced to tridiagonal form, using orthogonal similarity transformations, and then the QR algorithm is applied to the tridiagonal matrix to compute the eigenvalues and (optionally) the eigenvectors. 4 References Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore 5 Parameters 1: JOBZ CHARACTER(1) Input On entry: indicates whether eigenvectors are computed. JOBZ ¼ N Only eigenvalues are computed. JOBZ ¼ V Eigenvalues and eigenvectors are computed. Constraint: JOBZ ¼ N or V. 2: UPLO CHARACTER(1) Input On entry: if UPLO ¼ U, the upper triangular part of A is stored. If UPLO ¼ L, the lower triangular part of A is stored. Constraint: UPLO ¼ U or L..1

NAG Library Manual 3: N INTEGER Input On entry: n, the order of the matrix A. Constraint: N 0. 4: AðLDA,Þ REAL (KIND=nag_wp) array Input/Output Note: the second dimension of the array A must be at least maxð1; NÞ. On entry: the n by n symmetric matrix A. If UPLO ¼ U, the upper triangular part of A must be stored and the elements of the array below the diagonal are not referenced. If UPLO ¼ L, the lower triangular part of A must be stored and the elements of the array above the diagonal are not referenced. On exit: if JOBZ ¼ V, then A contains the orthonormal eigenvectors of the matrix A. If JOBZ ¼ N, then on exit the lower triangle (if UPLO ¼ L ) or the upper triangle (if UPLO ¼ U) of A, including the diagonal, is overwritten. 5: LDA INTEGER Input On entry: the first dimension of the array A as declared in the (sub)program from which (DSYEV) is called. Constraint: LDA maxð1; NÞ. 6: WðNÞ REAL (KIND=nag_wp) array Output On exit: the eigenvalues in ascending order. 7: WORKðmaxð1; LWORKÞÞ REAL (KIND=nag_wp) array Workspace On exit: if INFO ¼ 0, WORKð1Þ contains the minimum value of LWORK required for optimal performance. 8: LWORK INTEGER Input On entry: the dimension of the array WORK as declared in the (sub)program from which (DSYEV) is called. If LWORK ¼ 1, a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued. Suggested value: for optimal performance, LWORK ðnb þ 2ÞN, where nb is the optimal block size for F08FEF (DSYTRD). Constraint: LWORK maxð1; 3 N 1Þ. 9: INFO INTEGER Output On exit: INFO ¼ 0 unless the routine detects an error (see Section 6). 6 Error Indicators and Warnings Errors or warnings detected by the routine: INFO < 0 If INFO ¼ i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated..2

INFO > 0 If INFO ¼ i, the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero. 7 Accuracy The computed eigenvalues and eigenvectors are exact for a nearby matrix and is the machine precision. 8 Further Comments kek 2 ¼ OðÞA k k 2, ða þ EÞ, where See Section 4.7 of Anderson et al. (1999) for further details. The total number of floating point operations is proportional to n 3. The complex analogue of this routine is F08FNF (ZHEEV). 9 Example This example finds all the eigenvalues and eigenvectors of the symmetric matrix 0 1 1 2 3 4 2 2 3 4 A ¼ B C @ 3 3 3 4A, 4 4 4 4 together with approximate error bounds for the computed eigenvalues and eigenvectors. 9.1 Program Text Program f08fafe! Example Program Text! Release. NAG Copyright 2012.!.. Use Statements.. Use nag_library, Only: ddisna, dsyev, nag_wp, x02ajf, x04caf!.. Implicit None Statement.. Implicit None!.. Parameters.. Integer, Parameter :: nb = 64, nin = 5, nout = 6!.. Local Scalars.. Real (Kind=nag_wp) :: eerrbd, eps Integer :: i, ifail, info, lda, lwork, n!.. Local Arrays.. Real (Kind=nag_wp), Allocatable :: a(:,:), rcondz(:), w(:), work(:), & zerrbd(:) Real (Kind=nag_wp) :: dummy(1)!.. Intrinsic Procedures.. Intrinsic :: abs, max, nint!.. Executable Statements.. Example Program Results! Skip heading in data file Read (nin,*) Read (nin,*) n lda = n Allocate (a(lda,n),rcondz(n),w(n),zerrbd(n))! Use routine workspace query to get optimal workspace.! The NAG name equivalent of dsyev is f08faf lwork = -1 Call dsyev( Vectors, Upper,n,a,lda,w,dummy,lwork,info).3

NAG Library Manual! Make sure that there is enough workspace for blocksize nb. lwork = max((nb+2)*n,nint(dummy(1))) Allocate (work(lwork))! Read the upper triangular part of the matrix A from data file Read (nin,*)(a(i,i:n),i=1,n)! Solve the symmetric eigenvalue problem! The NAG name equivalent of dsyev is f08faf Call dsyev( Vectors, Upper,n,a,lda,w,work,lwork,info) If (info==0) Then! Print solution Eigenvalues Write (nout,99999) w(1:n) Flush (nout)! ifail: behaviour on error exit! =0 for hard exit, =1 for quiet-soft, =-1 for noisy-soft ifail = 0 Call x04caf( General,,n,n,a,lda, Eigenvectors,ifail)! Get the machine precision, EPS and compute the approximate! error bound for the computed eigenvalues. Note that for! the 2-norm, max( abs(w(i)) ) = norm(a), and since the! eigenvalues are returned in ascending order! max( abs(w(i)) ) = max( abs(w(1)), abs(w(n))) eps = x02ajf() eerrbd = eps*max(abs(w(1)),abs(w(n)))! Call DDISNA (F08FLF) to estimate reciprocal condition! numbers for the eigenvectors Call ddisna( Eigenvectors,n,n,w,rcondz,info)! Compute the error estimates for the eigenvectors Do i = 1, n zerrbd(i) = eerrbd/rcondz(i) End Do! Print the approximate error bounds for the eigenvalues! and vectors Error estimate for the eigenvalues Write (nout,99998) eerrbd Error estimates for the eigenvectors Write (nout,99998) zerrbd(1:n) Else Write (nout,99997) Failure in DSYEV. INFO =, info End If 99999 Format (3X,(8F8.4)) 99998 Format (4X,1P,6E11.1) 99997 Format (1X,A,I4) End Program f08fafe.4

9.2 Program Data Example Program Data 4 :Value of N 1.0 2.0 3.0 4.0 2.0 3.0 4.0 3.0 4.0 4.0 :End of matrix A 9.3 Program Results Example Program Results Eigenvalues -2.0531-0.5146-0.2943 12.8621 Eigenvectors 1 2 3 4 1 0.7003-0.5144-0.2767 0.4103 2 0.3592 0.4851 0.6634 0.4422 3-0.1569 0.5420-0.6504 0.5085 4-0.5965-0.4543 0.2457 0.6144 Error estimate for the eigenvalues 1.4E-15 Error estimates for the eigenvectors 9.3E-16 6.5E-15 6.5E-15 1.1E-16.5 (last)