Module ojalgo
Package org.ojalgo.matrix.decomposition
Interface SingularValue<N extends java.lang.Comparable<N>>
-
- All Superinterfaces:
InverterTask<N>,InvertibleFactor<N>,MatrixDecomposition<N>,MatrixDecomposition.EconomySize<N>,MatrixDecomposition.Ordered<N>,MatrixDecomposition.RankRevealing<N>,MatrixDecomposition.Solver<N>,MatrixDecomposition.Values<N>,MatrixTask<N>,Provider2D,Provider2D.Condition,Provider2D.Inverse<java.util.Optional<MatrixStore<N>>>,Provider2D.Rank,Provider2D.Solution<java.util.Optional<MatrixStore<N>>>,SolverTask<N>,Structure1D,Structure2D
- All Known Subinterfaces:
Eigenvalue.Spectral<N>
- All Known Implementing Classes:
DenseSingularValue,DenseSingularValue.C128,DenseSingularValue.H256,DenseSingularValue.Q128,DenseSingularValue.R064,DenseSingularValue.R128,HermitianEvD,HermitianEvD.C128,HermitianEvD.H256,HermitianEvD.Q128,HermitianEvD.R064,HermitianEvD.R128,RawEigenvalue.Symmetric,RawSingularValue
public interface SingularValue<N extends java.lang.Comparable<N>> extends MatrixDecomposition.Solver<N>, MatrixDecomposition.EconomySize<N>, MatrixDecomposition.RankRevealing<N>, MatrixDecomposition.Values<N>, Provider2D.Condition
Singular Value: [A] = [U][S][V]T Decomposes [this] into [U], [S] and [V] where:- [U] is an orthogonal matrix. The columns are the left, orthonormal, singular vectors of [this]. Its columns are the eigenvectors of [A][A]T, and therefore has the same number of rows as [this].
- [S] is a diagonal matrix. The elements on the diagonal are the singular values of [this]. It is either square or has the same dimensions as [this]. The singular values of [this] are the square roots of the nonzero eigenvalues of [A][A]T and [A]T[A] (they are the same)
- [V] is an orthogonal matrix. The columns are the right, orthonormal, singular vectors of [this]. Its columns are the eigenvectors of [A][A]T, and therefore has the same number of rows as [this] has columns.
- [this] = [U][S][V]T
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSingularValue.Factory<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.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 SingularValue.Factory<ComplexNumber>C128static SingularValue.Factory<Quaternion>H256static SingularValue.Factory<RationalNumber>Q128static SingularValue.Factory<java.lang.Double>R064static SingularValue.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 Deprecated Methods Modifier and Type Method Description static <N extends java.lang.Comparable<N>>
booleanequals(MatrixStore<N> matrix, SingularValue<N> decomposition, NumberContext context)default voidftran(PhysicalStore<N> arg)Forward-transformationdoublegetCondition()The condition number.MatrixStore<N>getCovariance()MatrixStore<N>getD()Deprecated.UsegetS()insteaddoublegetFrobeniusNorm()Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.doublegetKyFanNorm(int k)Ky Fan k-norm.doublegetOperatorNorm()MatrixStore<N>getS()Array1D<java.lang.Double>getSingularValues()default voidgetSingularValues(double[] values)doublegetTraceNorm()MatrixStore<N>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<N>getV()If [A] is m-by-n and its rank is r, then: The first r columns of [V] span the row space or coimage of [A]. The last n-r columns of [V] span the nullspace or kernel of [A]. Calculating the QR decomposition of [A]T is a faster alternative.static <N extends java.lang.Comparable<N>>
MatrixStore<N>invert(SingularValue<N> decomposition, PhysicalStore<N> preallocated)default MatrixStore<N>reconstruct()default MatrixStore<N>reconstruct(int k)static <N extends java.lang.Comparable<N>>
MatrixStore<N>reconstruct(SingularValue<N> decomposition)static <N extends java.lang.Comparable<N>>
MatrixStore<N>solve(SingularValue<N> decomposition, MatrixStore<N> rhs, PhysicalStore<N> preallocated)-
Methods inherited from interface org.ojalgo.matrix.task.InverterTask
invert, invert, preallocate
-
Methods inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
btran, btran, ftran
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
decompose, isComputed, reset
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.EconomySize
isFullSize
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Ordered
isOrdered
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.RankRevealing
countSignificant, getRank, getRankThreshold, isFullRank
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Solver
compute, getInverse, getInverse, getSolution, getSolution, invert, isSolvable, preallocate, solve, toInverseProvider, toSolutionProvider
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Values
computeValuesOnly
-
Methods inherited from interface org.ojalgo.matrix.task.SolverTask
preallocate, preallocate, solve, 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
-
C128
static final SingularValue.Factory<ComplexNumber> C128
-
H256
static final SingularValue.Factory<Quaternion> H256
-
Q128
static final SingularValue.Factory<RationalNumber> Q128
-
R064
static final SingularValue.Factory<java.lang.Double> R064
-
R128
static final SingularValue.Factory<Quadruple> R128
-
-
Method Detail
-
equals
static <N extends java.lang.Comparable<N>> boolean equals(MatrixStore<N> matrix, SingularValue<N> decomposition, NumberContext context)
-
invert
static <N extends java.lang.Comparable<N>> MatrixStore<N> invert(SingularValue<N> decomposition, PhysicalStore<N> preallocated)
-
reconstruct
static <N extends java.lang.Comparable<N>> MatrixStore<N> reconstruct(SingularValue<N> decomposition)
-
solve
static <N extends java.lang.Comparable<N>> MatrixStore<N> solve(SingularValue<N> decomposition, MatrixStore<N> rhs, PhysicalStore<N> preallocated)
-
ftran
default void ftran(PhysicalStore<N> arg)
Description copied from interface:InvertibleFactorForward-transformationSolve [A][x] = [b] by transforming [b] into [x] in-place.
- Specified by:
ftranin interfaceInvertibleFactor<N extends java.lang.Comparable<N>>- Parameters:
arg- [b] transformed into [x]
-
getCondition
double getCondition()
The condition number.- Specified by:
getConditionin interfaceProvider2D.Condition- Returns:
- The largest singular value divided by the smallest singular value.
-
getCovariance
MatrixStore<N> getCovariance()
- Returns:
- [[A]T[A]]-1 Where [A] is the original matrix.
-
getD
@Deprecated MatrixStore<N> getD()
Deprecated.UsegetS()instead- Returns:
- The diagonal matrix of singular values.
-
getFrobeniusNorm
double getFrobeniusNorm()
Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.- Returns:
- The square root of the sum of squares of the singular values.
-
getKyFanNorm
double getKyFanNorm(int k)
Ky 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).
- Parameters:
k- The number of singular values to add up.- Returns:
- The sum of the k largest singular values.
-
getOperatorNorm
double getOperatorNorm()
- Returns:
- 2-norm
-
getS
MatrixStore<N> getS()
- Returns:
- The diagonal matrix of singular values.
-
getSingularValues
Array1D<java.lang.Double> getSingularValues()
- Returns:
- The singular values ordered in descending order.
-
getSingularValues
default void getSingularValues(double[] values)
- Parameters:
values- An array that will receive the singular values
-
getTraceNorm
double getTraceNorm()
-
getU
MatrixStore<N> 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].
-
getV
MatrixStore<N> getV()
If [A] is m-by-n and its rank is r, then:- The first r columns of [V] span the row space or coimage of [A].
- The last n-r columns of [V] span the nullspace or kernel of [A].
-
reconstruct
default MatrixStore<N> reconstruct()
- Specified by:
reconstructin interfaceMatrixDecomposition<N extends java.lang.Comparable<N>>
-
reconstruct
default MatrixStore<N> reconstruct(int k)
-
-