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.
class
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# | Copy 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 | Copy 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# | Copy Code |
EigenvalueDecomposition ed2 = new EigenvalueDecomposition(aED, true); |
| Visual Basic | Copy 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# | Copy Code |
Console.WriteLine("Det A = {0}", ed.GetDeterminant()); |
| Visual Basic | Copy 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# | Copy 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 | Copy 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
Copyright 2004-2008,
Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M
Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual
Studio.NET, and the Visual Studio Logo are registered trademarks of Microsoft Corporation