Generated by DocFX

Class GeneralizedEigenvalueDecomposition

Determines the Generalized eigenvalues and eigenvectors of two real square matrices.

Inheritance
System.Object
GeneralizedEigenvalueDecomposition
Namespace: ISynergy.Framework.Mathematics.Decompositions
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public sealed class GeneralizedEigenvalueDecomposition : ICloneable
Remarks

A generalized eigenvalue problem is the problem of finding a vector v that obeys A * v = λ * B * v where A and B are matrices. If v obeys this equation, with some λ, then we call v the generalized eigenvector of A and B, and λ is called the generalized eigenvalue of A and B which corresponds to the generalized eigenvector v. The possible values of λ, must obey the identity det(A - λ*B) = 0.

Part of this code has been adapted from the original EISPACK routines in Fortran.

References:

  • http://en.wikipedia.org/wiki/Generalized_eigenvalue_problem#Generalized_eigenvalue_problem
  • http://www.netlib.org/eispack/

Examples

// Suppose we have the following // matrices A and B shown below: double[,] A = { { 1, 2, 3}, { 8, 1, 4}, { 3, 2, 3} }; double[,] B = { { 5, 1, 1}, { 1, 5, 1}, { 1, 1, 5} }; // Now, suppose we would like to find values for λ // that are solutions for the equation det(A - λB) = 0 // For this, we can use a Generalized Eigendecomposition var gevd = new GeneralizedEigenvalueDecomposition(A, B); // Now, if A and B are Hermitian and B is positive // -definite, then the eigenvalues λ will be real: double[] lambda = gevd.RealEigenvalues; // Lets check if they are indeed a solution: for (var i = 0; i < lambda.Length; i++) { // Compute the determinant equation show above double det = Matrix.Determinant(A.Subtract(lambda[i].Multiply(B))); // almost zero }

Constructors

View Source

GeneralizedEigenvalueDecomposition(Double[,], Double[,], Boolean)

Constructs a new generalized eigenvalue decomposition.

Declaration
public GeneralizedEigenvalueDecomposition(double[, ] a, double[, ] b, bool sort = false)
Parameters
Type Name Description
System.Double[,] a

The first matrix of the (A,B) matrix pencil.

System.Double[,] b

The second matrix of the (A,B) matrix pencil.

System.Boolean sort

Pass true to sort the eigenvalues and eigenvectors at the end of the decomposition.

Properties

View Source

Betas

Returns the beta values.

Declaration
public double[] Betas { get; }
Property Value
Type Description
System.Double[]
View Source

DiagonalMatrix

Returns the block diagonal eigenvalue matrix.

Declaration
public double[, ] DiagonalMatrix { get; }
Property Value
Type Description
System.Double[,]
View Source

Eigenvectors

Returns the eigenvector matrix.

Declaration
public double[, ] Eigenvectors { get; }
Property Value
Type Description
System.Double[,]
View Source

ImaginaryAlphas

Returns the imaginary parts of the alpha values.

Declaration
public double[] ImaginaryAlphas { get; }
Property Value
Type Description
System.Double[]
View Source

ImaginaryEigenvalues

Returns the imaginary parts of the eigenvalues.

Declaration
public double[] ImaginaryEigenvalues { get; }
Property Value
Type Description
System.Double[]
Remarks

The eigenvalues are computed using the ratio alpha[i]/beta[i], which can lead to valid, but infinite eigenvalues.

View Source

IsDegenerate

Returns true if the eigenvalue problem is degenerate (ill-posed).

Declaration
public bool IsDegenerate { get; }
Property Value
Type Description
System.Boolean
View Source

IsSingular

Returns true if matrix B is singular.

Declaration
public bool IsSingular { get; }
Property Value
Type Description
System.Boolean
Remarks

This method checks if any of the generated betas is zero. It does not says that the problem is singular, but only that one of the matrices of the pencil (A,B) is singular.

View Source

RealAlphas

Returns the real parts of the alpha values.

Declaration
public double[] RealAlphas { get; }
Property Value
Type Description
System.Double[]
View Source

RealEigenvalues

Returns the real parts of the eigenvalues.

Declaration
public double[] RealEigenvalues { get; }
Property Value
Type Description
System.Double[]
Remarks

The eigenvalues are computed using the ratio alpha[i]/beta[i], which can lead to valid, but infinite eigenvalues.

Methods

View Source

Clone()

Creates a new object that is a copy of the current instance.

Declaration
public object Clone()
Returns
Type Description
System.Object

A new object that is a copy of this instance.

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)

See Also

EigenvalueDecomposition
SingularValueDecomposition
JaggedEigenvalueDecomposition
JaggedSingularValueDecomposition