Interface Eigenvalue<N extends java.lang.Comparable<N>>
-
- All Superinterfaces:
DeterminantTask<N>,MatrixDecomposition<N>,MatrixDecomposition.Determinant<N>,MatrixDecomposition.Hermitian<N>,MatrixDecomposition.Ordered<N>,MatrixDecomposition.Values<N>,MatrixTask<N>,Provider2D,Provider2D.Determinant<N>,Provider2D.Eigenpairs,Structure1D,Structure2D
- All Known Subinterfaces:
Eigenvalue.Generalised<N>,Eigenvalue.Spectral<N>
- All Known Implementing Classes:
DenseEigenvalue,DynamicEvD,DynamicEvD.R064,GeneralEvD,GeneralEvD.R064,GeneralisedEvD,HermitianEvD,HermitianEvD.C128,HermitianEvD.H256,HermitianEvD.Q128,HermitianEvD.R064,HermitianEvD.R128,RawEigenvalue,RawEigenvalue.Dynamic,RawEigenvalue.General,RawEigenvalue.Symmetric
public interface Eigenvalue<N extends java.lang.Comparable<N>> extends MatrixDecomposition.Hermitian<N>, MatrixDecomposition.Determinant<N>, MatrixDecomposition.Values<N>, Provider2D.Eigenpairs
[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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEigenvalue.Eigenpairstatic interfaceEigenvalue.Factory<N extends java.lang.Comparable<N>>static classEigenvalue.Generalisationstatic interfaceEigenvalue.Generalised<N extends java.lang.Comparable<N>>static interfaceEigenvalue.Spectral<N extends java.lang.Comparable<N>>“Spectral decomposition” refers specifically to the orthogonal/unitary eigen-decomposition of a normal matrix (most commonly Hermitian / symmetric).-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
MatrixDecomposition.Determinant<N extends java.lang.Comparable<N>>, MatrixDecomposition.EconomySize<N extends java.lang.Comparable<N>>, MatrixDecomposition.Hermitian<N extends java.lang.Comparable<N>>, MatrixDecomposition.Ordered<N extends java.lang.Comparable<N>>, MatrixDecomposition.Pivoting<N extends java.lang.Comparable<N>>, MatrixDecomposition.RankRevealing<N extends java.lang.Comparable<N>>, MatrixDecomposition.Solver<N extends java.lang.Comparable<N>>, MatrixDecomposition.Updatable<N extends java.lang.Comparable<N>>, MatrixDecomposition.Values<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.Provider2D
Provider2D.Condition, Provider2D.Determinant<N extends java.lang.Comparable<N>>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,B>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.Reshapable, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>
-
-
Field Summary
Fields Modifier and Type Field Description static Eigenvalue.Factory<ComplexNumber>C128static java.util.Comparator<ComplexNumber>DESCENDING_NORMSorts on the norm in descending order.static Eigenvalue.Factory<Quaternion>H256static Eigenvalue.Factory<RationalNumber>Q128static Eigenvalue.Factory<java.lang.Double>R064static Eigenvalue.Factory<Quadruple>R128-
Fields inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
TYPICAL
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description private voidcopyEigenvector(int index, Array1D<ComplexNumber> destination)static <N extends java.lang.Comparable<N>>
booleanequals(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.EigenpairgetEigenpair(int index)default java.util.List<Eigenvalue.Eigenpair>getEigenpairs()This list is always ordered in descending eigenvalue order – that's regardless of ifisOrdered()returns true or false.Array1D<ComplexNumber>getEigenvalues()Even for real matrices the eigenvalues (and eigenvectors) are potentially complex numbers.default voidgetEigenvalues(double[] realParts, java.util.Optional<double[]> imaginaryParts)default MatrixStore<ComplexNumber>getEigenvectors()ComplexNumbergetTrace()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].booleanisHermitian()If [A] is hermitian then [V][D][V]-1 becomes [Q][D][Q]H...booleanisOrdered()The eigenvalues in D (and the eigenvectors in V) are not necessarily ordered.default MatrixStore<N>reconstruct()static <N extends java.lang.Comparable<N>>
MatrixStore<N>reconstruct(Eigenvalue<N> decomposition)static voidsort(double[] values, ExchangeColumns vectorExchange)Sort eigenvalues and corresponding vectors.-
Methods inherited from interface org.ojalgo.matrix.task.DeterminantTask
calculateDeterminant
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
decompose, isComputed, reset
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Determinant
getDeterminant, toDeterminantProvider
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Hermitian
checkAndDecompose
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Values
computeValuesOnly
-
Methods inherited from interface org.ojalgo.structure.Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getColDim, getMaxDim, getMinDim, getRowDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
-
-
-
Field Detail
-
C128
static final Eigenvalue.Factory<ComplexNumber> C128
-
DESCENDING_NORM
static final java.util.Comparator<ComplexNumber> DESCENDING_NORM
Sorts on the norm in descending order. If the 2 eigenvalues have equal norm then the usualComplexNumbersort order is used (reversed).
-
H256
static final Eigenvalue.Factory<Quaternion> H256
-
Q128
static final Eigenvalue.Factory<RationalNumber> Q128
-
R064
static final Eigenvalue.Factory<java.lang.Double> R064
-
R128
static final Eigenvalue.Factory<Quadruple> R128
-
-
Method Detail
-
equals
static <N extends java.lang.Comparable<N>> boolean equals(MatrixStore<N> matrix, Eigenvalue<N> decomposition, NumberContext context)
-
reconstruct
static <N extends java.lang.Comparable<N>> MatrixStore<N> reconstruct(Eigenvalue<N> decomposition)
-
sort
static void sort(double[] values, ExchangeColumns vectorExchange)Sort eigenvalues and corresponding vectors.- Parameters:
values- The eigenvalues to sortvectorExchange- A function that can exchange the eigenvectors to follow the new order.
-
copyEigenvector
private void copyEigenvector(int index, Array1D<ComplexNumber> destination)
-
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)
-
getEigenpairs
default java.util.List<Eigenvalue.Eigenpair> getEigenpairs()
This list is always ordered in descending eigenvalue order – that's regardless of ifisOrdered()returns true or false.- Specified by:
getEigenpairsin interfaceProvider2D.Eigenpairs- See Also:
Provider2D.Eigenpairs.getEigenpairs()
-
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 are ordered or not is indicated by the
isOrdered()method.- Returns:
- The eigenvalues.
-
getEigenvalues
default void getEigenvalues(double[] realParts, java.util.Optional<double[]> imaginaryParts)- Parameters:
realParts- An array that will receive the real parts of the eigenvaluesimaginaryParts- 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:
isOrderedin interfaceMatrixDecomposition.Ordered<N extends java.lang.Comparable<N>>- Returns:
- true if they are ordered
-
reconstruct
default MatrixStore<N> reconstruct()
- Specified by:
reconstructin interfaceMatrixDecomposition<N extends java.lang.Comparable<N>>
-
-