Extreme Optimization > User's Guide > Vector and Matrix Library > Matrix Decompositions > The Symmetric Eigenvalue Decomposition

Extreme Optimization User's Guide

User's Guide

Up: Matrix Decompositions Next: The Non-Symmetric Eigenvalue Decomposition Previous: The Cholesky Decomposition Contents

The Symmetric Eigenvalue Decomposition

The eigenvalue decomposition of a symmetric matrix expresses the matrix as the product of an orthogonal matrix, a diagonal matrix, and the transpose of the orthogonal matrix. The matrix must be square and symmetric. The symmetric eigenvalue decomposition is usually written as

A = XLXT,

where X is a square, orthogonal matrix, and L is a diagonal matrix.

An eigenvalue l and an eigenvector X are values such that

AX = lX.

There are as many eigenvalues and corresponding eigenvectors as there are rows or columns in the matrix. A real symmetric matrix always has real eigenvalues.

In the Extreme Optimization Mathematics Library for .NET, the symmetric eigenvalue decomposition is implemented by the SymmetricEigenvalueDecomposition class.

The SymmetricEigenvalueDecomposition class represents the eigenvalue decomposition of a real symmetric matrix. It has two constructors. The first variant takes a Matrix as its only parameter.

C# CopyCode imageCopy Code
SymmetricMatrix aED = new SymmetricMatrix(4,
    new double[] 
        {
                4.16,-3.12, 0.56,-0.10,
                0, 5.03,-0.83, 1.18,
                0,0, 0.76, 0.34,
                0,0,0, 1.18
        }, MatrixTriangleMode.Lower);
SymmetricEigenvalueDecomposition ed =    new SymmetricEigenvalueDecomposition(aED);
Visual Basic CopyCode imageCopy Code
Dim aED As SymmetricMatrix = New SymmetricMatrix(4, _
    New Double() _
    { _
     4.16, -3.12, 0.56, -0.1, _
     0, 5.03, -0.83, 1.18, _
     0, 0, 0.76, 0.34, _
     0, 0, 0, 1.18 _
    }, MatrixTriangleMode.Lower)
Dim ed As SymmetricEigenvalueDecomposition = _
    New SymmetricEigenvalueDecomposition(aED)

The second constructor has an additional Boolean parameter that specifies whether the contents of the first parameter may be destroyed during the calculation of the eigenvalue decomposition.

C# CopyCode imageCopy Code
SymmetricEigenvalueDecomposition ed2 =    new SymmetricEigenvalueDecomposition(aED, true);
Visual Basic CopyCode imageCopy Code
Dim ed2 As SymmetricEigenvalueDecomposition = _
    New SymmetricEigenvalueDecomposition(aED, True)

The Decompose method performs the actual decomposition. This method copies the matrix if necessary. It then calls the appropriate LAPACK routine to perform the actual decomposition. This method is called by other methods as needed. You will rarely need to call it explicitly.

Once the decomposition is computed, a number of operations can be performed in much less time.

C# CopyCode imageCopy Code
GeneralMatrix bED = new GeneralMatrix(4, 2,
    new double[] {8.70,-13.35,1.89,-4.14,8.30,2.13,1.61,5.00});
Matrix xED = ed.Solve(bED);
Console.WriteLine("x = {0}", xED);
Console.WriteLine("Inv A = {0}", ed.GetInverse().ToString("F4"));
Console.WriteLine("Det A = {0}", ed.GetDeterminant());
Visual Basic CopyCode imageCopy Code
Dim bED As GeneralMatrix = New GeneralMatrix(4, 2, _
    New Double() {8.7, -13.35, 1.89, -4.14, 8.3, 2.13, 1.61, 5.0})
Dim xED As Matrix = ed.Solve(bED)
Console.WriteLine("x = {0}", xED)
Console.WriteLine("Inv A = {0}", ed.GetInverse().ToString("F4"))
Console.WriteLine("Det A = {0}", ed.GetDeterminant())

The Eigenvalues property returns a GeneralVector that contains the eigenvalues of the matrix. The Eigenvectors property returns a GeneralMatrix whose columns contain the corresponding eigenvectors of the matrix.

C# CopyCode imageCopy Code
Console.WriteLine("L = {0}", ed.Eigenvalues.ToString("F4"));
Console.WriteLine("X = {0}", ed.Eigenvectors.ToString("F4"));
Visual Basic CopyCode imageCopy Code
Console.WriteLine("L = {0}", ed.Eigenvalues.ToString("F4"))
Console.WriteLine("X = {0}", ed.Eigenvectors.ToString("F4"))

The managed implementation of the symmetric eigenvalue decomposition is based on the LINPACK routines TRED2 and TQL2. The native version uses the LAPACK routine DSYEVR.

Up: Matrix Decompositions Next: The Non-Symmetric Eigenvalue Decomposition Previous: The Cholesky Decomposition Contents

Overview
Introduction
Features
Documentation
QuickStart Samples
Sample Applications
Downloads
Get it now!
Download trial version
How to Buy
Information
Resources
Contact Us
Search

"The Extreme Optimization Statistics Library for .NET is a major boon for those doing statistical work in .NET. I strongly recommend this product."
- Marc Brooks

"I have made it my mission to institutionalize the value of good API design.  I strongly believe that this is key to making developers more productive and happy on our platform. It is clear that you value good API design in your work, and take to heart developer productivity and synergy with the .NET framework."
- Brad Abrams,
Lead Program Manager, Microsoft.

This is a partial list of companies who are using our libraries:
ABB Robotics
Allstate
Applied Materials
Arcam
Astra Schedule
Babson College
Canadian Council on Learning
Canyon Associates
Caxton Associates
CECity
Constellation Energy
CreditSights
DeepOcean
Duke University
Dynamotive
Elecsoft
Engelhard Corporation
Epcor
Equipoise Software
Galileo International
GAM UK
Gammex
GlaxoSmithKline
Global Matrix
The Hartford
Infinera Corporation
Intel
JDS Uniphase
LaBranche & Co.
Learning & Skills Council
Jacobs Consultancy
Litman Gregory
Lucas Systems
Malvern Instruments
Medrio
Merck & Co.
Mintera.
Monitor Software
MorningStar
NanoString Technologies
Paletta Invent
Parametric Portfolio Associates
Prosanos
RATA Associates
RiskShield
Ramboll
Standard & Poor's
Strategic Analysis Corporation
Univ. of Alicante
Univ. of South Carolina
vielife
Xerox
US Army