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 void setThreshold(double val)
public double getThreshold()
public void setTol(double val)
public double getTol()
public MatrixD getEigenValues()
public double[] getSingularValues()
public MatrixD getPseudoInverseEigenvalues()
public MatrixD getEigenVectorMatrixV()
public MatrixD getV()
public MatrixD getEigenVectorMatrixU()
public MatrixD getU()
public void setMatrix(MatrixD inputMatrix)
inputMatrix - the input matrixpublic boolean decompose()
public boolean decompose(boolean useSquareMatrix)
useSquareMatrix - whether to use intermediate step of transforming the input
matrix to a square one.public MatrixD getMatrix()
public MatrixD getInverse()
public MatrixD getInverse(boolean timer, int nEigenValues)
public MatrixD getEigenVector(int eigen)
public MatrixD getEigenSolution(int eigen)
@Deprecated public double norm2()
public double cond()
public int rank()
public boolean testSVD()
for more infopublic boolean testSVD(double threshold)
threshold - the numerical threshold for the testpublic boolean testInvert()
for more infopublic boolean testInvert(double threshold)
threshold - the numerical threshold for the testpublic static void main(String[] argc)
argc - the input parameter (unused)Copyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.