Module ojalgo
Package org.ojalgo.matrix.decomposition
Class DenseEigenvalue<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.matrix.decomposition.AbstractDecomposition<N,DecompositionStore<N>>
-
- org.ojalgo.matrix.decomposition.DenseEigenvalue<N>
-
- All Implemented Interfaces:
Eigenvalue<N>,MatrixDecomposition<N>,MatrixDecomposition.Determinant<N>,MatrixDecomposition.Hermitian<N>,MatrixDecomposition.Ordered<N>,MatrixDecomposition.Values<N>,Provider2D,Provider2D.Determinant<N>,Provider2D.Eigenpairs,DeterminantTask<N>,MatrixTask<N>,Structure1D,Structure2D
- Direct Known Subclasses:
DynamicEvD,GeneralEvD,GeneralisedEvD,HermitianEvD
abstract class DenseEigenvalue<N extends java.lang.Comparable<N>> extends AbstractDecomposition<N,DecompositionStore<N>> implements Eigenvalue<N>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.Eigenvalue
Eigenvalue.Eigenpair, Eigenvalue.Factory<N extends java.lang.Comparable<N>>, Eigenvalue.Generalisation, Eigenvalue.Generalised<N extends java.lang.Comparable<N>>, Eigenvalue.Spectral<N extends java.lang.Comparable<N>>
-
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.Factory<D extends MatrixDecomposition<?>>, 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 private MatrixStore<N>myDprivate Array1D<ComplexNumber>myEigenvaluesprivate intmySquareDimprivate MatrixStore<N>myVprivate booleanmyValuesOnly-
Fields inherited from interface org.ojalgo.matrix.decomposition.Eigenvalue
C128, DESCENDING_NORM, H256, Q128, R064, R128
-
Fields inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
TYPICAL
-
-
Constructor Summary
Constructors Constructor Description DenseEigenvalue(PhysicalStore.Factory<N,? extends DecompositionStore<N>> aFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NcalculateDeterminant(Access2D<?> matrix)booleancomputeValuesOnly(Access2D.Collectable<N,? super TransformableRegion<N>> matrix)booleandecompose(Access2D.Collectable<N,? super TransformableRegion<N>> matrix)private booleandecompose(Access2D.Collectable<N,? super TransformableRegion<N>> matrix, boolean valuesOnly)protected abstract booleandoDecompose(Access2D.Collectable<N,? super TransformableRegion<N>> matrix, boolean valuesOnly)intgetColDim()MatrixStore<N>getD()The only requirements on [D] are that it should contain the eigenvalues and that [A][V] = [V][D].Array1D<ComplexNumber>getEigenvalues()Even for real matrices the eigenvalues (and eigenvectors) are potentially complex numbers.intgetMaxDim()intgetMinDim()intgetRowDim()MatrixStore<N>getV()The columns of [V] represent the eigenvectors of [A] in the sense that [A][V] = [V][D].(package private) booleanisValuesOnly()protected abstract MatrixStore<N>makeD()protected abstract Array1D<ComplexNumber>makeEigenvalues()protected abstract MatrixStore<N>makeV()voidreset()Delete computed results, and resets attributes to default values(package private) voidsetD(MatrixStore<N> newD)(package private) voidsetEigenvalues(Array1D<ComplexNumber> eigenvalues)(package private) voidsetV(MatrixStore<N> newV)-
Methods inherited from class org.ojalgo.matrix.decomposition.AbstractDecomposition
aggregator, applyPivotOrder, applyReverseOrder, checkSolvability, collect, computed, function, getDimensionalEpsilon, isAspectRatioNormal, isComputed, isSolvable, makeArray, makeDiagonal, makeEye, makeHouseholder, makeIdentity, makeRotation, makeRotation, makeZero, makeZero, scalar, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.matrix.decomposition.Eigenvalue
getEigenpair, getEigenpairs, getEigenvalues, getEigenvectors, getTrace, isHermitian, isOrdered, reconstruct
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
isComputed
-
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.structure.Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
-
-
-
Field Detail
-
myD
private MatrixStore<N extends java.lang.Comparable<N>> myD
-
myEigenvalues
private Array1D<ComplexNumber> myEigenvalues
-
mySquareDim
private int mySquareDim
-
myV
private MatrixStore<N extends java.lang.Comparable<N>> myV
-
myValuesOnly
private boolean myValuesOnly
-
-
Constructor Detail
-
DenseEigenvalue
DenseEigenvalue(PhysicalStore.Factory<N,? extends DecompositionStore<N>> aFactory)
-
-
Method Detail
-
calculateDeterminant
public N calculateDeterminant(Access2D<?> matrix)
- Specified by:
calculateDeterminantin interfaceDeterminantTask<N extends java.lang.Comparable<N>>
-
computeValuesOnly
public boolean computeValuesOnly(Access2D.Collectable<N,? super TransformableRegion<N>> matrix)
- Specified by:
computeValuesOnlyin interfaceMatrixDecomposition.Values<N extends java.lang.Comparable<N>>- Parameters:
matrix- The matrix to decompose- Returns:
- The same as
MatrixDecomposition.Solver.compute(Collectable)orMatrixDecomposition.decompose(Collectable)if the instance does not implementMatrixDecomposition.Solver.
-
decompose
public final boolean decompose(Access2D.Collectable<N,? super TransformableRegion<N>> matrix)
- Specified by:
decomposein interfaceMatrixDecomposition<N extends java.lang.Comparable<N>>- Parameters:
matrix- A matrix to decompose- Returns:
- true if decomposition suceeded; false if not
-
getColDim
public int getColDim()
- Specified by:
getColDimin interfaceStructure2D- Returns:
- The number of columns
-
getD
public final MatrixStore<N> getD()
Description copied from interface:EigenvalueThe 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.
- Specified by:
getDin interfaceEigenvalue<N extends java.lang.Comparable<N>>- Returns:
- The (block) diagonal eigenvalue matrix.
-
getEigenvalues
public final Array1D<ComplexNumber> getEigenvalues()
Description copied from interface:EigenvalueEven 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
Eigenvalue.isOrdered()method.- Specified by:
getEigenvaluesin interfaceEigenvalue<N extends java.lang.Comparable<N>>- Returns:
- The eigenvalues.
-
getMaxDim
public int getMaxDim()
- Specified by:
getMaxDimin interfaceStructure2D
-
getMinDim
public int getMinDim()
- Specified by:
getMinDimin interfaceStructure2D
-
getRowDim
public int getRowDim()
- Specified by:
getRowDimin interfaceStructure2D- Returns:
- The number of rows
-
getV
public final MatrixStore<N> getV()
Description copied from interface:EigenvalueThe columns of [V] represent the eigenvectors of [A] in the sense that [A][V] = [V][D].- Specified by:
getVin interfaceEigenvalue<N extends java.lang.Comparable<N>>- Returns:
- The eigenvector matrix.
-
reset
public void reset()
Description copied from interface:MatrixDecompositionDelete computed results, and resets attributes to default values- Specified by:
resetin interfaceMatrixDecomposition<N extends java.lang.Comparable<N>>- Overrides:
resetin classAbstractDecomposition<N extends java.lang.Comparable<N>,DecompositionStore<N extends java.lang.Comparable<N>>>
-
decompose
private final boolean decompose(Access2D.Collectable<N,? super TransformableRegion<N>> matrix, boolean valuesOnly)
-
doDecompose
protected abstract boolean doDecompose(Access2D.Collectable<N,? super TransformableRegion<N>> matrix, boolean valuesOnly)
-
makeD
protected abstract MatrixStore<N> makeD()
-
makeEigenvalues
protected abstract Array1D<ComplexNumber> makeEigenvalues()
-
makeV
protected abstract MatrixStore<N> makeV()
-
isValuesOnly
boolean isValuesOnly()
-
setD
final void setD(MatrixStore<N> newD)
-
setEigenvalues
final void setEigenvalues(Array1D<ComplexNumber> eigenvalues)
-
setV
final void setV(MatrixStore<N> newV)
-
-