org.ojalgo.matrix.decomposition

Interface SingularValue<N extends Number>

• All Superinterfaces:

```public interface SingularValue<N extends Number>
extends MatrixDecomposition<N>, MatrixDecomposition.Solver<N>, MatrixDecomposition.EconomySize<N>, MatrixDecomposition.RankRevealing<N>, MatrixDecomposition.Values<N>```
Singular Value: [A] = [Q1][D][Q2]T Decomposes [this] into [Q1], [D] and [Q2] where:
• [Q1] 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].
• [D] 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)
• [Q2] 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] = [Q1][D][Q2]T
A singular values decomposition always exists.
Author:
apete
• Nested Class Summary

Nested Classes
Modifier and Type Interface and Description
`static interface ` `SingularValue.Factory<N extends Number>`
• Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition

`MatrixDecomposition.Determinant<N extends Number>, MatrixDecomposition.EconomySize<N extends Number>, MatrixDecomposition.Hermitian<N extends Number>, MatrixDecomposition.Ordered<N extends Number>, MatrixDecomposition.Pivoting<N extends Number>, MatrixDecomposition.RankRevealing<N extends Number>, MatrixDecomposition.Solver<N extends Number>, MatrixDecomposition.Values<N extends Number>`
• Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D

`Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,?>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.RowColumnCallback, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>`
• Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D

`Structure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback`
• Field Summary

Fields
Modifier and Type Field and Description
`static SingularValue.Factory<ComplexNumber>` `COMPLEX`
`static SingularValue.Factory<Double>` `PRIMITIVE`
`static SingularValue.Factory<Quaternion>` `QUATERNION`
`static SingularValue.Factory<RationalNumber>` `RATIONAL`
• Fields inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition

`TYPICAL`
• Method Summary

All Methods
Modifier and Type Method and Description
`static <N extends Number>boolean` ```equals(MatrixStore<N> matrix, SingularValue<N> decomposition, NumberContext context)```
`double` `getCondition()`
The condition number.
`MatrixStore<N>` `getD()`
`double` `getFrobeniusNorm()`
Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.
`double` `getKyFanNorm(int k)`
Ky Fan k-norm.
`double` `getOperatorNorm()`
`MatrixStore<N>` `getQ1()`
If [A] is m-by-n and its rank is r, then: The first r columns of [Q1] span the column space, range or image of [A]. The last m-r columns of [Q1] span the left nullspace or cokernel of [A]. Calculating the QR decomposition of [A] is a faster alternative.
`MatrixStore<N>` `getQ2()`
If [A] is m-by-n and its rank is r, then: The first r columns of [Q2] span the row space or coimage of [A]. The last n-r columns of [Q2] span the nullspace or kernel of [A]. Calculating the QR decomposition of [A]T is a faster alternative.
`Array1D<Double>` `getSingularValues()`
`default void` `getSingularValues(double[] values)`
`double` `getTraceNorm()`
`static <N extends Number>SingularValue<N>` `make(Access2D<N> typical)`
`default MatrixStore<N>` `reconstruct()`
`static <N extends Number>MatrixStore<N>` `reconstruct(SingularValue<N> decomposition)`
Deprecated.
• Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Solver

`compute, getInverse, getInverse, getSolution, getSolution, isSolvable`

`preallocate, preallocate, solve, solve`

`invert, invert, preallocate, preallocate`
• Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.EconomySize

`isFullSize`
• Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.RankRevealing

`countSignificant, getRank, getRankThreshold, isFullRank`
• Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Values

`computeValuesOnly`
• Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Ordered

`isOrdered`
• Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition

`decompose, isComputed, reset`
• Methods inherited from interface org.ojalgo.structure.Structure2D

`column, column, column, column, column, count, count, countColumns, countRows, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, row`
• Methods inherited from interface org.ojalgo.structure.Structure1D

`index, loopAll, loopMatching, loopRange, mapper, size`
• Field Detail

• COMPLEX

`static final SingularValue.Factory<ComplexNumber> COMPLEX`
• PRIMITIVE

`static final SingularValue.Factory<Double> PRIMITIVE`
• QUATERNION

`static final SingularValue.Factory<Quaternion> QUATERNION`
• RATIONAL

`static final SingularValue.Factory<RationalNumber> RATIONAL`
• Method Detail

• equals

```static <N extends Number> boolean equals(MatrixStore<N> matrix,
SingularValue<N> decomposition,
NumberContext context)```
• make

`static <N extends Number> SingularValue<N> make(Access2D<N> typical)`
• reconstruct

```@Deprecated
static <N extends Number> MatrixStore<N> reconstruct(SingularValue<N> decomposition)```
Deprecated. v48 Use `reconstruct()` instead
• getCondition

`double getCondition()`
The condition number.
Returns:
The largest singular value divided by the smallest singular value.
• getD

`MatrixStore<N> getD()`
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
• getQ1

`MatrixStore<N> getQ1()`
If [A] is m-by-n and its rank is r, then:
• The first r columns of [Q1] span the column space, range or image of [A].
• The last m-r columns of [Q1] span the left nullspace or cokernel of [A].
Calculating the QR decomposition of [A] is a faster alternative.
• getQ2

`MatrixStore<N> getQ2()`
If [A] is m-by-n and its rank is r, then:
• The first r columns of [Q2] span the row space or coimage of [A].
• The last n-r columns of [Q2] span the nullspace or kernel of [A].
Calculating the QR decomposition of [A]T is a faster alternative.
• getSingularValues

`Array1D<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()`
• reconstruct

`default MatrixStore<N> reconstruct()`
Specified by:
`reconstruct` in interface `MatrixDecomposition<N extends Number>`