nag_real_symm_general_eigenvalues (f02adc) (PDF version)
f02 Chapter Contents
f02 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_real_symm_general_eigenvalues (f02adc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_real_symm_general_eigenvalues (f02adc) calculates all the eigenvalues of Ax = λ Bx , where A  is a real symmetric matrix and B  is a real symmetric positive definite matrix.

2  Specification

#include <nag.h>
#include <nagf02.h>
void  nag_real_symm_general_eigenvalues (Integer n, double a[], Integer tda, double b[], Integer tdb, double r[], NagError *fail)

3  Description

The problem is reduced to the standard symmetric eigenproblem using Cholesky's method to decompose B  into triangular matrices, B = LLT , where L  is lower triangular. Then Ax = λ Bx  implies L -1 AL -T LT x = λ LT x ; hence the eigenvalues of Ax = λ Bx  are those of Py = λ y  where P  is the symmetric matrix L -1 AL -T . Householder's method is used to tridiagonalise the matrix P  and the eigenvalues are then found using the QL  algorithm.

4  References

Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag

5  Arguments

1:     nIntegerInput
On entry: n , the order of the matrices A  and B .
Constraint: n1 .
2:     a[n×tda]doubleInput/Output
Note: the i,jth element of the matrix A is stored in a[i-1×tda+j-1].
On entry: the upper triangle of the n  by n  symmetric matrix A . The elements of the array below the diagonal need not be set.
On exit: the lower triangle of the array is overwritten. The rest of the array is unchanged.
3:     tdaIntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: tdan .
4:     b[n×tdb]doubleInput/Output
Note: the i,jth element of the matrix B is stored in b[i-1×tdb+j-1].
On entry: the upper triangle of the n  by n  symmetric positive definite matrix B . The elements of the array below the diagonal need not be set.
On exit: the elements below the diagonal are overwritten. The rest of the array is unchanged.
5:     tdbIntegerInput
On entry: the stride separating matrix column elements in the array b.
Constraint: tdbn .
6:     r[n]doubleOutput
On exit: the eigenvalues in ascending order.
7:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, tda=value  while n=value . These arguments must satisfy tdan .
On entry, tdb=value  while n=value . These arguments must satisfy tdbn .
NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_INT_ARG_LT
On entry, n=value.
Constraint: n1.
NE_NOT_POS_DEF
The matrix B  is not positive definite, possibly due to rounding errors.
NE_TOO_MANY_ITERATIONS
More than value iterations are required to isolate all the eigenvalues.

7  Accuracy

In general this function is very accurate. However, if B  is ill-conditioned with respect to inversion, the eigenvalues could be inaccurately determined. For a detailed error analysis see pages 310, 222 and 235 Wilkinson and Reinsch (1971).

8  Parallelism and Performance

Not applicable.

9  Further Comments

The time taken by nag_real_symm_general_eigenvalues (f02adc) is approximately proportional to n 3 .

10  Example

To calculate all the eigenvalues of the general symmetric eigenproblem Ax = λ Bx  where A  is the symmetric matrix
0.5 1.5 6.6 4.8 1.5 6.5 16.2 8.6 6.6 16.2 37.6 9.8 4.8 8.6 9.8 -17.1
and B  is the symmetric positive definite matrix
1 3 4 1 3 13 16 11 4 16 24 18 1 11 18 27 .

10.1  Program Text

Program Text (f02adce.c)

10.2  Program Data

Program Data (f02adce.d)

10.3  Program Results

Program Results (f02adce.r)


nag_real_symm_general_eigenvalues (f02adc) (PDF version)
f02 Chapter Contents
f02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2014