public class SingularValueDecomposition extends Object
algorithm according to Golub and Reinsch G. Golub and C. Reinsch, "Handbook for Automatic Computation II, Linear Algebra". Springer, NY, 1971. numerically checked but... TODO: code clean up necessary... code as been translated from FORTRAN -> C -> C++ -> Java ;-)
| Constructor and Description |
|---|
SingularValueDecomposition()
default constructor.
|
SingularValueDecomposition(MatrixD inputMatrix)
default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cond()
Two norm condition number
|
boolean |
decompose()
Perform the singular value decomposition.
|
boolean |
decompose(boolean useSquareMatrix)
Perform the singular value decomposition.
|
MatrixD |
getEigenSolution(int eigen) |
MatrixD |
getEigenValues() |
MatrixD |
getEigenVector(int eigen) |
MatrixD |
getEigenVectorMatrixU() |
MatrixD |
getEigenVectorMatrixV() |
MatrixD |
getInverse() |
MatrixD |
getInverse(boolean timer,
int nEigenValues) |
MatrixD |
getMatrix() |
MatrixD |
getPseudoInverseEigenvalues() |
double[] |
getSingularValues() |
double |
getThreshold() |
double |
getTol() |
MatrixD |
getU() |
MatrixD |
getV() |
static void |
main(String[] argc)
some small test routines to check SVD matrix computation.
|
double |
norm2()
Deprecated.
used only in old implementation
|
int |
rank()
Effective numerical matrix rank
|
void |
setMatrix(MatrixD inputMatrix)
Sets the input matrix to be decomposed.
|
void |
setThreshold(double val) |
void |
setTol(double val) |
boolean |
testInvert()
Test of 'inputMatrix'*'pseudo-inverse SVD matrix' == 1.
|
boolean |
testInvert(double threshold)
Test of 'inputMatrix'*'pseudo-inverse SVD matrix' == '1' matrix.
|
boolean |
testSVD()
Tests whether 'inputMatrix' == 'SVD decomposed matrix'.
|
boolean |
testSVD(double threshold)
Tests whether 'inputMatrix' == 'SVD decomposed matrix'.
|
public SingularValueDecomposition()
public SingularValueDecomposition(MatrixD inputMatrix)
inputMatrix - the preset input matrix to be decomposedpublic double cond()
public boolean decompose()
public boolean decompose(boolean useSquareMatrix)
useSquareMatrix - whether to use intermediate step of transforming the input matrix to a square one.public MatrixD getEigenSolution(int eigen)
public MatrixD getEigenValues()
public MatrixD getEigenVector(int eigen)
public MatrixD getEigenVectorMatrixU()
public MatrixD getEigenVectorMatrixV()
public MatrixD getInverse()
public MatrixD getInverse(boolean timer, int nEigenValues)
public MatrixD getMatrix()
public MatrixD getPseudoInverseEigenvalues()
public double[] getSingularValues()
public double getThreshold()
public double getTol()
public MatrixD getU()
public MatrixD getV()
@Deprecated public double norm2()
public int rank()
public void setMatrix(MatrixD inputMatrix)
inputMatrix - the input matrixpublic void setThreshold(double val)
public void setTol(double val)
public boolean testInvert()
for more infopublic boolean testInvert(double threshold)
threshold - the numerical threshold for the testpublic boolean testSVD()
for more infopublic boolean testSVD(double threshold)
threshold - the numerical threshold for the testpublic static void main(String[] argc)
argc - the input parameter (unused)Copyright © 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.