Class SVDTask.SVDMatrix
java.lang.Object
org.ujmp.core.doublematrix.calculation.general.decomposition.SVDTask.SVDMatrix
- Enclosing class:
- SVDTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double
private final int
Row and column dimensions.private final int
Row and column dimensions.private final int
Row and column dimensions.private final double[]
Array for internal storage of singular values.private final boolean
Column specification of matrix Uprivate final double
private final double[][]
Arrays for internal storage of U and V.private final double[][]
Arrays for internal storage of U and V. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal double
cond()
Two norm condition numberfinal DenseDoubleMatrix2D
Return the diagonal matrix of the reciprocals of the singular valuesfinal DenseDoubleMatrix2D
getS()
Return the diagonal matrix of singular valuesfinal double[]
Return the one-dimensional array of singular valuesfinal DenseDoubleMatrix2D
getU()
Return the left singular vectorsfinal DenseDoubleMatrix2D
getV()
Return the right singular vectorsfinal DenseDoubleMatrix2D
inverse
(boolean omit) Return the Moore-Penrose (generalized) inverse Slightly modified version of Kim van der Linde's codefinal double
norm2()
Two normfinal int
rank()
Effective numerical matrix rank
-
Field Details
-
EPSILON
private final double EPSILON -
TINY
private final double TINY -
U
private final double[][] UArrays for internal storage of U and V. -
V
private final double[][] VArrays for internal storage of U and V. -
s
private final double[] sArray for internal storage of singular values. -
m
private final int mRow and column dimensions. -
n
private final int nRow and column dimensions. -
ncu
private final int ncuRow and column dimensions. -
thin
private final boolean thinColumn specification of matrix U
-
-
Constructor Details
-
SVDMatrix
Construct the singular value decomposition- Parameters:
Arg
- Rectangular matrixthin
- If true U is economy sizedwantu
- If true generate the U matrixwantv
- If true generate the V matrix
-
-
Method Details
-
getU
Return the left singular vectors- Returns:
- U
-
getV
Return the right singular vectors- Returns:
- V
-
getSingularValues
public final double[] getSingularValues()Return the one-dimensional array of singular values- Returns:
- diagonal of S.
-
getS
Return the diagonal matrix of singular values- Returns:
- S
-
getreciprocalS
Return the diagonal matrix of the reciprocals of the singular values- Returns:
- S+
-
inverse
Return the Moore-Penrose (generalized) inverse Slightly modified version of Kim van der Linde's code- Parameters:
omit
- if true tolerance based omitting of negligible singular values- Returns:
- A+
-
norm2
public final double norm2()Two norm- Returns:
- max(S)
-
cond
public final double cond()Two norm condition number- Returns:
- max(S)/min(S)
-
rank
public final int rank()Effective numerical matrix rank- Returns:
- Number of nonnegligible singular values.
-