org.ojalgo.matrix.decomposition

## Interface Eigenvalue<N extends Number>

• All Superinterfaces:
All Known Implementing Classes:
HermitianEvD

```public interface Eigenvalue<N extends Number>
extends MatrixDecomposition<N>, MatrixDecomposition.Hermitian<N>, MatrixDecomposition.Determinant<N>, MatrixDecomposition.Values<N>```
[A] = [V][D][V]-1 ([A][V] = [V][D])
• [A] = any square matrix.
• [V] = contains the eigenvectors as columns.
• [D] = a diagonal matrix with the eigenvalues on the diagonal (possibly in blocks).

[A] is normal if [A][A]H = [A]H[A], and [A] is normal if and only if there exists a unitary matrix [Q] such that [A] = [Q][D][Q]H. Hermitian matrices are normal.

[V] and [D] can always be calculated in the sense that they will satisfy [A][V] = [V][D], but it is not always possible to calculate [V]-1. (Check the rank and/or the condition number of [V] to determine the validity of [V][D][V]-1.)

The eigenvalues (and their corresponding eigenvectors) of a non-symmetric matrix could be complex.

Author:
apete
• ### Nested Class Summary

Nested Classes
Modifier and Type Interface and Description
`static class ` `Eigenvalue.Eigenpair`
`static interface ` `Eigenvalue.Factory<N extends Number>`
• ### Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition

`MatrixDecomposition.Determinant<N extends Number>, MatrixDecomposition.EconomySize<N extends Number>, MatrixDecomposition.Hermitian<N extends Number>, MatrixDecomposition.Ordered<N extends Number>, MatrixDecomposition.Pivoting<N extends Number>, MatrixDecomposition.RankRevealing<N extends Number>, MatrixDecomposition.Solver<N extends Number>, MatrixDecomposition.Values<N extends Number>`
• ### Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D

`Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,?>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.RowColumnCallback, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>`
• ### Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D

`Structure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback`
• ### Field Summary

Fields
Modifier and Type Field and Description
`static Eigenvalue.Factory<ComplexNumber>` `COMPLEX`
`static Eigenvalue.Factory<Double>` `PRIMITIVE`
`static Eigenvalue.Factory<Quaternion>` `QUATERNION`
`static Eigenvalue.Factory<RationalNumber>` `RATIONAL`
• ### Fields inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition

`TYPICAL`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`default void` ```copyEigenvector(int index, Array1D<ComplexNumber> destination)```
Deprecated.
With Java 9 this will be made private. Use `getEigenvectors()` or `getEigenpair(int)` instead.
`static <N extends Number>boolean` ```equals(MatrixStore<N> matrix, Eigenvalue<N> decomposition, NumberContext context)```
`MatrixStore<N>` `getD()`
The only requirements on [D] are that it should contain the eigenvalues and that [A][V] = [V][D].
`default Eigenvalue.Eigenpair` `getEigenpair(int index)`
`Array1D<ComplexNumber>` `getEigenvalues()`
Even for real matrices the eigenvalues (and eigenvectors) are potentially complex numbers.
`default void` ```getEigenvalues(double[] realParts, Optional<double[]> imaginaryParts)```
`default MatrixStore<ComplexNumber>` `getEigenvectors()`
`ComplexNumber` `getTrace()`
A matrix' trace is the sum of the diagonal elements.
`MatrixStore<N>` `getV()`
The columns of [V] represent the eigenvectors of [A] in the sense that [A][V] = [V][D].
`boolean` `isHermitian()`
If [A] is hermitian then [V][D][V]-1 becomes [Q][D][Q]H...
`boolean` `isOrdered()`
The eigenvalues in D (and the eigenvectors in V) are not necessarily ordered.
`static <N extends Number>Eigenvalue<N>` `make(Access2D<N> typical)`
`static <N extends Number>Eigenvalue<N>` ```make(Access2D<N> typical, boolean hermitian)```
`default MatrixStore<N>` `reconstruct()`
`static <N extends Number>MatrixStore<N>` `reconstruct(Eigenvalue<N> decomposition)`
Deprecated.
• ### Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Hermitian

`checkAndCompute, checkAndDecompose`
• ### Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Determinant

`getDeterminant`

`calculateDeterminant`
• ### Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Values

`computeValuesOnly`
• ### Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition

`decompose, isComputed, reset`
• ### Methods inherited from interface org.ojalgo.structure.Structure2D

`column, column, column, column, column, count, count, countColumns, countRows, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, row`
• ### Methods inherited from interface org.ojalgo.structure.Structure1D

`index, loopAll, loopMatching, loopRange, mapper, size`
• ### Field Detail

• #### COMPLEX

`static final Eigenvalue.Factory<ComplexNumber> COMPLEX`
• #### PRIMITIVE

`static final Eigenvalue.Factory<Double> PRIMITIVE`
• #### QUATERNION

`static final Eigenvalue.Factory<Quaternion> QUATERNION`
• #### RATIONAL

`static final Eigenvalue.Factory<RationalNumber> RATIONAL`
• ### Method Detail

• #### equals

```static <N extends Number> boolean equals(MatrixStore<N> matrix,
Eigenvalue<N> decomposition,
NumberContext context)```
• #### make

`static <N extends Number> Eigenvalue<N> make(Access2D<N> typical)`
• #### make

```static <N extends Number> Eigenvalue<N> make(Access2D<N> typical,
boolean hermitian)```
• #### reconstruct

```@Deprecated
static <N extends Number> MatrixStore<N> reconstruct(Eigenvalue<N> decomposition)```
Deprecated. v48 Use `reconstruct()` instead
• #### getD

`MatrixStore<N> getD()`
The only requirements on [D] are that it should contain the eigenvalues and that [A][V] = [V][D]. The ordering of the eigenvalues is not specified.
• If [A] is real and symmetric then [D] is (purely) diagonal with real eigenvalues.
• If [A] is real but not symmetric then [D] is block-diagonal with real eigenvalues in 1-by-1 blocks and complex eigenvalues in 2-by-2 blocks.
• If [A] is complex then [D] is (purely) diagonal with complex eigenvalues.
Returns:
The (block) diagonal eigenvalue matrix.
• #### getEigenpair

`default Eigenvalue.Eigenpair getEigenpair(int index)`
• #### getEigenvalues

`Array1D<ComplexNumber> getEigenvalues()`

Even for real matrices the eigenvalues (and eigenvectors) are potentially complex numbers. Typically they need to be expressed as complex numbers when [A] is not symmetric.

The values should be in the same order as the matrices "V" and "D", and if they is ordered or not is indicated by the `isOrdered()` method.

Returns:
The eigenvalues.
• #### getEigenvalues

```default void getEigenvalues(double[] realParts,
Optional<double[]> imaginaryParts)```
Parameters:
`realParts` - An array that will receive the real parts of the eigenvalues
`imaginaryParts` - An optional array that, if present, will receive the imaginary parts of the eigenvalues
• #### getEigenvectors

`default MatrixStore<ComplexNumber> getEigenvectors()`
Returns:
A complex valued alternative to `getV()`.
• #### getTrace

`ComplexNumber getTrace()`
A matrix' trace is the sum of the diagonal elements. It is also the sum of the eigenvalues. This method should return the sum of the eigenvalues.
Returns:
The matrix' trace
• #### getV

`MatrixStore<N> getV()`
The columns of [V] represent the eigenvectors of [A] in the sense that [A][V] = [V][D].
Returns:
The eigenvector matrix.
• #### isHermitian

`boolean isHermitian()`
If [A] is hermitian then [V][D][V]-1 becomes [Q][D][Q]H...
• #### isOrdered

`boolean isOrdered()`
The eigenvalues in D (and the eigenvectors in V) are not necessarily ordered. This is a property of the algorithm/implementation, not the data.
Specified by:
`isOrdered` in interface `MatrixDecomposition.Ordered<N extends Number>`
Returns:
true if they are ordered
• #### reconstruct

`default MatrixStore<N> reconstruct()`
Specified by:
`reconstruct` in interface `MatrixDecomposition<N extends Number>`