Class DenseEigenvalue<N extends 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 Comparable<N>>
extends AbstractDecomposition<N, DecompositionStore<N>>
implements Eigenvalue<N>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Eigenvalue
Eigenvalue.Eigenpair, Eigenvalue.Factory<N>, Eigenvalue.Generalisation, Eigenvalue.Generalised<N>, Eigenvalue.Spectral<N>Nested classes/interfaces inherited from interface MatrixDecomposition
MatrixDecomposition.Determinant<N>, MatrixDecomposition.EconomySize<N>, MatrixDecomposition.Factory<D>, MatrixDecomposition.Hermitian<N>, MatrixDecomposition.Ordered<N>, MatrixDecomposition.Pivoting<N>, MatrixDecomposition.RankRevealing<N>, MatrixDecomposition.Solver<N>, MatrixDecomposition.Updatable<N>, MatrixDecomposition.Values<N>Nested classes/interfaces inherited from interface Provider2D
Provider2D.Condition, Provider2D.Determinant<N>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N>Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallbackNested classes/interfaces inherited from interface Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S,B>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MatrixStore<N> private Array1D<ComplexNumber> private intprivate MatrixStore<N> private booleanFields inherited from interface Eigenvalue
C128, DESCENDING_NORM, H256, Q128, R064, R128Fields inherited from interface MatrixDecomposition
TYPICAL -
Constructor Summary
ConstructorsConstructorDescriptionDenseEigenvalue(PhysicalStore.Factory<N, ? extends DecompositionStore<N>> aFactory) -
Method Summary
Modifier and TypeMethodDescriptioncalculateDeterminant(Access2D<?> matrix) booleancomputeValuesOnly(Access2D.Collectable<N, ? super TransformableRegion<N>> matrix) final booleandecompose(Access2D.Collectable<N, ? super TransformableRegion<N>> matrix) private final booleandecompose(Access2D.Collectable<N, ? super TransformableRegion<N>> matrix, boolean valuesOnly) protected abstract booleandoDecompose(Access2D.Collectable<N, ? super TransformableRegion<N>> matrix, boolean valuesOnly) intfinal MatrixStore<N> getD()The only requirements on [D] are that it should contain the eigenvalues and that [A][V] = [V][D].final Array1D<ComplexNumber> Even for real matrices the eigenvalues (and eigenvectors) are potentially complex numbers.intintintfinal MatrixStore<N> getV()The columns of [V] represent the eigenvectors of [A] in the sense that [A][V] = [V][D].(package private) booleanprotected abstract MatrixStore<N> makeD()protected abstract Array1D<ComplexNumber> protected abstract MatrixStore<N> makeV()voidreset()Delete computed results, and resets attributes to default values(package private) final voidsetD(MatrixStore<N> newD) (package private) final voidsetEigenvalues(Array1D<ComplexNumber> eigenvalues) (package private) final voidsetV(MatrixStore<N> newV) Methods inherited from class AbstractDecomposition
aggregator, applyPivotOrder, applyReverseOrder, checkSolvability, collect, computed, copyColumn, copyRow, function, getDimensionalEpsilon, isAspectRatioNormal, isComputed, isSolvable, makeArray, makeDiagonal, makeEye, makeHouseholder, makeIdentity, makeRotation, makeRotation, makeZero, makeZero, scalar, wrapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Eigenvalue
getEigenpair, getEigenpairs, getEigenvalues, getEigenvectors, getTrace, isHermitian, isOrdered, reconstructMethods inherited from interface MatrixDecomposition
isComputedMethods inherited from interface MatrixDecomposition.Determinant
getDeterminant, toDeterminantProviderMethods inherited from interface MatrixDecomposition.Hermitian
checkAndDecomposeMethods inherited from interface Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
Field Details
-
myD
-
myEigenvalues
-
mySquareDim
private int mySquareDim -
myV
-
myValuesOnly
private boolean myValuesOnly
-
-
Constructor Details
-
DenseEigenvalue
DenseEigenvalue(PhysicalStore.Factory<N, ? extends DecompositionStore<N>> aFactory)
-
-
Method Details
-
calculateDeterminant
- Specified by:
calculateDeterminantin interfaceDeterminantTask<N extends Comparable<N>>
-
computeValuesOnly
- Specified by:
computeValuesOnlyin interfaceMatrixDecomposition.Values<N extends 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
- Specified by:
decomposein interfaceMatrixDecomposition<N extends 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
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 Comparable<N>>- Returns:
- The (block) diagonal eigenvalue matrix.
-
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 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
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 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 Comparable<N>>- Overrides:
resetin classAbstractDecomposition<N extends Comparable<N>, DecompositionStore<N extends 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
-
makeEigenvalues
-
makeV
-
isValuesOnly
boolean isValuesOnly() -
setD
-
setEigenvalues
-
setV
-