- java.lang.Object
-
- org.ojalgo.matrix.decomposition.AbstractDecomposition<java.lang.Double,R064Store>
-
- org.ojalgo.matrix.decomposition.RawDecomposition
-
- org.ojalgo.matrix.decomposition.RawEigenvalue
-
- org.ojalgo.matrix.decomposition.RawEigenvalue.Symmetric
-
- All Implemented Interfaces:
Eigenvalue<java.lang.Double>,Eigenvalue.Spectral<java.lang.Double>,MatrixDecomposition<java.lang.Double>,MatrixDecomposition.Determinant<java.lang.Double>,MatrixDecomposition.EconomySize<java.lang.Double>,MatrixDecomposition.Hermitian<java.lang.Double>,MatrixDecomposition.Ordered<java.lang.Double>,MatrixDecomposition.RankRevealing<java.lang.Double>,MatrixDecomposition.Solver<java.lang.Double>,MatrixDecomposition.Values<java.lang.Double>,SingularValue<java.lang.Double>,Provider2D,Provider2D.Condition,Provider2D.Determinant<java.lang.Double>,Provider2D.Eigenpairs,Provider2D.Inverse<java.util.Optional<MatrixStore<java.lang.Double>>>,Provider2D.Rank,Provider2D.Solution<java.util.Optional<MatrixStore<java.lang.Double>>>,DeterminantTask<java.lang.Double>,InverterTask<java.lang.Double>,MatrixTask<java.lang.Double>,SolverTask<java.lang.Double>,InvertibleFactor<java.lang.Double>,Structure1D,Structure2D
- Enclosing class:
- RawEigenvalue
static final class RawEigenvalue.Symmetric extends RawEigenvalue implements Eigenvalue.Spectral<java.lang.Double>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.matrix.decomposition.RawEigenvalue
RawEigenvalue.Dynamic, RawEigenvalue.General, RawEigenvalue.Symmetric
-
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.transformation.InvertibleFactor
InvertibleFactor.IdentityFactor<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.matrix.decomposition.SingularValue
SingularValue.Factory<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<java.lang.Double>myInverseprivate MatrixStore<java.lang.Double>mySprivate MatrixStore<java.lang.Double>myU-
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 Symmetric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbtran(PhysicalStore<java.lang.Double> arg)Backwards-transformationintcountSignificant(double threshold)protected booleandoDecompose(double[][] data, boolean valuesOnly)voidftran(PhysicalStore<java.lang.Double> arg)Forward-transformationdoublegetCondition()The condition number.MatrixStore<java.lang.Double>getCovariance()doublegetFrobeniusNorm()Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.MatrixStore<java.lang.Double>getInverse()The output must be a "right inverse" and a "generalised inverse".MatrixStore<java.lang.Double>getInverse(PhysicalStore<java.lang.Double> preallocated)Implementing this method is optional.doublegetKyFanNorm(int k)Ky Fan k-norm.doublegetOperatorNorm()doublegetRankThreshold()MatrixStore<java.lang.Double>getS()Array1D<java.lang.Double>getSingularValues()MatrixStore<java.lang.Double>getSolution(Access2D.Collectable<java.lang.Double,? super PhysicalStore<java.lang.Double>> rhs, PhysicalStore<java.lang.Double> preallocated)Implementing this method is optional.doublegetTraceNorm()MatrixStore<java.lang.Double>getU()If [A] is m-by-n and its rank is r, then: The first r columns of [U] span the column space, range or image of [A]. The last m-r columns of [U] span the left nullspace or cokernel of [A]. Calculating the QR decomposition of [A] is a faster alternative.MatrixStore<java.lang.Double>invert(Access2D<?> original, PhysicalStore<java.lang.Double> preallocated)Exactly how (if at all) a specific implementation makes use ofpreallocatedis not specified by this interface.booleanisFullSize()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.booleanisSolvable()Please note that producing a pseudoinverse and/or a least squares solution is ok! The return value, of this method, is not an indication of if the decomposed matrix is square, has full rank, is postive definite or whatever.booleanisSPD()A symmetric (Hermitian) matrix is positive definite if all its eigenvalues are positive.protected MatrixStore<java.lang.Double>makeD(double[] d, double[] e)PhysicalStore<java.lang.Double>preallocate(int nbEquations, int nbVariables, int nbSolutions)MatrixStore<java.lang.Double>reconstruct()voidreset()Delete computed results, and resets attributes to default valuesMatrixStore<java.lang.Double>solve(Access2D<?> body, Access2D<?> rhs, PhysicalStore<java.lang.Double> preallocated)Exactly how (if at all) a specific implementation makes use ofpreallocatedis not specified by this interface.-
Methods inherited from class org.ojalgo.matrix.decomposition.RawEigenvalue
calculateDeterminant, checkSolvability, computeValuesOnly, decompose, doGeneral, doSymmetric, getD, getDeterminant, getEigenvalues, getEigenvalues, getImaginaryParts, getRealParts, getTrace, getV, isValuesOnly
-
Methods inherited from class org.ojalgo.matrix.decomposition.RawDecomposition
checkSymmetry, getColDim, getInternalData, getInternalStore, getRowDim, make, newRawStore, reset, wrap
-
Methods inherited from class org.ojalgo.matrix.decomposition.AbstractDecomposition
aggregator, applyPivotOrder, applyReverseOrder, collect, computed, function, getDimensionalEpsilon, isAspectRatioNormal, isComputed, 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.task.DeterminantTask
calculateDeterminant
-
Methods inherited from interface org.ojalgo.matrix.decomposition.Eigenvalue
getD, getEigenpair, getEigenpairs, getEigenvalues, getEigenvalues, getEigenvectors, getTrace, getV
-
Methods inherited from interface org.ojalgo.matrix.task.InverterTask
invert, preallocate
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
decompose, 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.matrix.decomposition.MatrixDecomposition.RankRevealing
getRank, isFullRank
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Solver
compute, getSolution, invert, preallocate, solve, toInverseProvider, toSolutionProvider
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Values
computeValuesOnly
-
Methods inherited from interface org.ojalgo.matrix.decomposition.SingularValue
getD, getSingularValues, getV, reconstruct
-
Methods inherited from interface org.ojalgo.matrix.task.SolverTask
preallocate, solve
-
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
-
myInverse
private transient MatrixStore<java.lang.Double> myInverse
-
myS
private transient MatrixStore<java.lang.Double> myS
-
myU
private transient MatrixStore<java.lang.Double> myU
-
-
Method Detail
-
btran
public void btran(PhysicalStore<java.lang.Double> arg)
Description copied from interface:InvertibleFactorBackwards-transformationSolve [x]T[A] = [b]T (equivalent to [A]T[x] = [b]) by transforming [b] into [x] in-place.
- Specified by:
btranin interfaceInvertibleFactor<java.lang.Double>- Parameters:
arg- [b] transformed into [x]
-
countSignificant
public int countSignificant(double threshold)
- Specified by:
countSignificantin interfaceMatrixDecomposition.RankRevealing<java.lang.Double>- Parameters:
threshold- Significance limit- Returns:
- The number of elements in the diagonal matrix that are greater than the threshold
-
ftran
public void ftran(PhysicalStore<java.lang.Double> arg)
Description copied from interface:InvertibleFactorForward-transformationSolve [A][x] = [b] by transforming [b] into [x] in-place.
- Specified by:
ftranin interfaceInvertibleFactor<java.lang.Double>- Specified by:
ftranin interfaceSingularValue<java.lang.Double>- Parameters:
arg- [b] transformed into [x]
-
getCondition
public double getCondition()
Description copied from interface:SingularValueThe condition number.- Specified by:
getConditionin interfaceProvider2D.Condition- Specified by:
getConditionin interfaceSingularValue<java.lang.Double>- Returns:
- The largest singular value divided by the smallest singular value.
-
getCovariance
public MatrixStore<java.lang.Double> getCovariance()
- Specified by:
getCovariancein interfaceSingularValue<java.lang.Double>- Returns:
- [[A]T[A]]-1 Where [A] is the original matrix.
-
getFrobeniusNorm
public double getFrobeniusNorm()
Description copied from interface:SingularValueSometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.- Specified by:
getFrobeniusNormin interfaceSingularValue<java.lang.Double>- Returns:
- The square root of the sum of squares of the singular values.
-
getInverse
public MatrixStore<java.lang.Double> getInverse()
Description copied from interface:MatrixDecomposition.SolverThe output must be a "right inverse" and a "generalised inverse".- Specified by:
getInversein interfaceMatrixDecomposition.Solver<java.lang.Double>
-
getInverse
public MatrixStore<java.lang.Double> getInverse(PhysicalStore<java.lang.Double> preallocated)
Description copied from interface:MatrixDecomposition.SolverImplementing this method is optional.
Exactly how a specific implementation makes use of
preallocatedis not specified by this interface. It must be documented for each implementation.Should produce the same results as calling
MatrixDecomposition.Solver.getInverse().- Specified by:
getInversein interfaceMatrixDecomposition.Solver<java.lang.Double>- Parameters:
preallocated- Preallocated memory for the results, possibly some intermediate results. You must assume this is modified, but you cannot assume it will contain the full/final/correct solution. UseMatrixDecomposition.Solver.preallocate(int, int)orInverterTask.preallocate(Structure2D)to get a suitable instance.- Returns:
- The inverse, this is where you get the solution
-
getKyFanNorm
public double getKyFanNorm(int k)
Description copied from interface:SingularValueKy Fan k-norm.
The first Ky Fan k-norm is the operator norm (the largest singular value), and the last is called the trace norm (the sum of all singular values).
- Specified by:
getKyFanNormin interfaceSingularValue<java.lang.Double>- Parameters:
k- The number of singular values to add up.- Returns:
- The sum of the k largest singular values.
-
getOperatorNorm
public double getOperatorNorm()
- Specified by:
getOperatorNormin interfaceSingularValue<java.lang.Double>- Returns:
- 2-norm
-
getRankThreshold
public double getRankThreshold()
- Specified by:
getRankThresholdin interfaceMatrixDecomposition.RankRevealing<java.lang.Double>
-
getS
public MatrixStore<java.lang.Double> getS()
- Specified by:
getSin interfaceSingularValue<java.lang.Double>- Returns:
- The diagonal matrix of singular values.
-
getSingularValues
public Array1D<java.lang.Double> getSingularValues()
- Specified by:
getSingularValuesin interfaceSingularValue<java.lang.Double>- Returns:
- The singular values ordered in descending order.
-
getSolution
public MatrixStore<java.lang.Double> getSolution(Access2D.Collectable<java.lang.Double,? super PhysicalStore<java.lang.Double>> rhs, PhysicalStore<java.lang.Double> preallocated)
Description copied from interface:MatrixDecomposition.SolverImplementing this method is optional.
Exactly how a specific implementation makes use of
preallocatedis not specified by this interface. It must be documented for each implementation.Should produce the same results as calling
MatrixDecomposition.Solver.getSolution(Collectable).- Specified by:
getSolutionin interfaceMatrixDecomposition.Solver<java.lang.Double>- Parameters:
rhs- The Right Hand Side, wont be modfiedpreallocated- Preallocated memory for the results, possibly some intermediate results. You must assume this is modified, but you cannot assume it will contain the full/final/correct solution. UseSolverTask.preallocate(int, int, int)orSolverTask.preallocate(Structure2D, Structure2D)to get a suitable instance.- Returns:
- The solution
-
getTraceNorm
public double getTraceNorm()
- Specified by:
getTraceNormin interfaceSingularValue<java.lang.Double>
-
getU
public MatrixStore<java.lang.Double> getU()
Description copied from interface:SingularValueIf [A] is m-by-n and its rank is r, then:- The first r columns of [U] span the column space, range or image of [A].
- The last m-r columns of [U] span the left nullspace or cokernel of [A].
- Specified by:
getUin interfaceSingularValue<java.lang.Double>
-
invert
public MatrixStore<java.lang.Double> invert(Access2D<?> original, PhysicalStore<java.lang.Double> preallocated) throws RecoverableCondition
Description copied from interface:InverterTaskExactly how (if at all) a specific implementation makes use of
preallocatedis not specified by this interface. It must be documented for each implementation.Should produce the same results as calling
InverterTask.invert(Access2D).Use
InverterTask.preallocate(Structure2D)to obtain a suitbalepreallocated.- Specified by:
invertin interfaceInverterTask<java.lang.Double>preallocated- Preallocated memory for the results, possibly some intermediate results. You must assume this is modified, but you cannot assume it will contain the full/final/correct solution.- Returns:
- The inverse
- Throws:
RecoverableCondition- TODO
-
isFullSize
public boolean isFullSize()
- Specified by:
isFullSizein interfaceMatrixDecomposition.EconomySize<java.lang.Double>- Returns:
- True if it will generate a full sized decomposition.
-
isHermitian
public boolean isHermitian()
Description copied from interface:EigenvalueIf [A] is hermitian then [V][D][V]-1 becomes [Q][D][Q]H...- Specified by:
isHermitianin interfaceEigenvalue<java.lang.Double>
-
isOrdered
public boolean isOrdered()
Description copied from interface:EigenvalueThe 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 interfaceEigenvalue<java.lang.Double>- Specified by:
isOrderedin interfaceMatrixDecomposition.Ordered<java.lang.Double>- Returns:
- true if they are ordered
-
isSolvable
public boolean isSolvable()
Description copied from interface:MatrixDecomposition.SolverPlease note that producing a pseudoinverse and/or a least squares solution is ok! The return value, of this method, is not an indication of if the decomposed matrix is square, has full rank, is postive definite or whatever. It's that in combination with the specific decomposition algorithm's capabilities.- Specified by:
isSolvablein interfaceMatrixDecomposition.Solver<java.lang.Double>- Overrides:
isSolvablein classAbstractDecomposition<java.lang.Double,R064Store>- Returns:
- true if this matrix decomposition is in a state to be able to deliver an inverse or an equation system solution (with some degree of numerical stability).
-
isSPD
public boolean isSPD()
Description copied from interface:Eigenvalue.SpectralA symmetric (Hermitian) matrix is positive definite if all its eigenvalues are positive.- Specified by:
isSPDin interfaceEigenvalue.Spectral<java.lang.Double>
-
preallocate
public PhysicalStore<java.lang.Double> preallocate(int nbEquations, int nbVariables, int nbSolutions)
- Specified by:
preallocatein interfaceSolverTask<java.lang.Double>
-
reconstruct
public MatrixStore<java.lang.Double> reconstruct()
- Specified by:
reconstructin interfaceEigenvalue<java.lang.Double>- Specified by:
reconstructin interfaceEigenvalue.Spectral<java.lang.Double>- Specified by:
reconstructin interfaceMatrixDecomposition<java.lang.Double>- Specified by:
reconstructin interfaceSingularValue<java.lang.Double>
-
reset
public void reset()
Description copied from interface:MatrixDecompositionDelete computed results, and resets attributes to default values- Specified by:
resetin interfaceMatrixDecomposition<java.lang.Double>- Overrides:
resetin classRawEigenvalue
-
solve
public MatrixStore<java.lang.Double> solve(Access2D<?> body, Access2D<?> rhs, PhysicalStore<java.lang.Double> preallocated) throws RecoverableCondition
Description copied from interface:SolverTaskExactly how (if at all) a specific implementation makes use of
preallocatedis not specified by this interface. It must be documented for each implementation.Should produce the same results as calling
SolverTask.solve(Access2D, Access2D).Use
SolverTask.preallocate(Structure2D, Structure2D)to obtain a suitbalepreallocated.- Specified by:
solvein interfaceSolverTask<java.lang.Double>rhs- The Right Hand Side, wont be modfiedpreallocated- Preallocated memory for the results, possibly some intermediate results. You must assume this is modified, but you cannot assume it will contain the full/ /correct solution.- Returns:
- The solution
- Throws:
RecoverableCondition
-
doDecompose
protected boolean doDecompose(double[][] data, boolean valuesOnly)- Specified by:
doDecomposein classRawEigenvalue
-
makeD
protected MatrixStore<java.lang.Double> makeD(double[] d, double[] e)
- Overrides:
makeDin classRawEigenvalue
-
-