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

Extreme Optimization User's Guide

User's Guide

Up: Matrix Decompositions Next: The Singular Value Decomposition Previous: The Symmetric Eigenvalue Decomposition Contents

The Non-Symmetric Eigenvalue Decomposition

The eigenvalue decomposition of a general matrix expresses the matrix as the product of a square matrix, a diagonal matrix, and the inverse of the first square matrix. The matrix must be square. The non-symmetric eigenvalue decomposition is usually written as

A = XLX-1,

where X is a square 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. However, the eigenvalues and eigenvectors need not be real. In this case, they come in complex conjugate pairs. The eigenvalues and eigenvectors of a real symmetric matrix are always real.

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

The EigenvalueDecompositionclass

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

C# CopyCode imageCopy Code
GeneralMatrix aED = new GeneralMatrix(4, 4,
    new double[] 
        {
                0.35, 0.09, -0.44, 0.25,
                0.45, 0.07, -0.33, -0.32,
                -0.14, -0.54, -0.03, -0.13,
                -0.17, 0.35, 0.17, 0.11
        });
EigenvalueDecomposition ed =    new EigenvalueDecomposition(aED);
Visual Basic CopyCode imageCopy Code
Dim aED As GeneralMatrix = New GeneralMatrix(4, 4, _
    New Double() _
        { _
                0.35, 0.09, -0.44, 0.25, _
                0.45, 0.07, -0.33, -0.32, _
                -0.14, -0.54, -0.03, -0.13, _
                -0.17, 0.35, 0.17, 0.11 _
        });
Dim ed As EigenvalueDecomposition = _
    New EigenvalueDecomposition(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
EigenvalueDecomposition ed2 =    new EigenvalueDecomposition(aED, true);
Visual Basic CopyCode imageCopy Code
Dim ed2 As EigenvalueDecomposition = _
    New EigenvalueDecomposition(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. However, unlike other decompositions, the non-symmetric eigenvalue decomposition does not give an advantage when solving equations or computing the inverse. For these methods, the EigenvalueDecomposition class simply defers to corresponding method of the base matrix.

C# CopyCode imageCopy Code
Console.WriteLine("Det A = {0}", ed.GetDeterminant());
Visual Basic CopyCode imageCopy Code
Console.WriteLine("Det A = {0}", ed.GetDeterminant())

The Eigenvalues property returns a ComplexGeneralVector that contains the eigenvalues of the matrix. The return value is a complex vector because the eigenvalues may be complex. The Eigenvectors property returns a GeneralMatrix whose columns contain the corresponding eigenvectors of the matrix. Once again, the return value is complex because the eigenvectors may themselves be complex. The eigenvectors are normalized so their Euclidian norm is one and the largest component is real.

The RealEigenvalues property returns a GeneralVector that contains only the real eigenvalues of the matrix. The RealEigenvectors property returns a GeneralMatrix whose columns contain only the eigenvectors corresponding to the real eigenvalues of the matrix.

The RawEigenvectors property returns a GeneralMatrix whose columns contain all the information about the eigenvectors. For real eigenvalues, the corresponding column contains the corresponding eigenvector. For complex eigenvalues, which always occur in complex conjugate pairs, two adjoining columns contain the real and imaginary components of the corresponding eigenvectors.

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

The managed implementation of the non-symmetric eigenvalue decomposition is based on the LINPACK routines ELMHES and HQR2. The native version uses the LAPACK routine DGEEV.

Up: Matrix Decompositions Next: The Singular Value Decomposition Previous: The Symmetric Eigenvalue 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