|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.SVDecomposition3d
public class SVDecomposition3d
Constructs the singular value decomposition (SVD) of a 3x3 matrix. This takes
the form
M = U S V'
where M is the original matrix, U and V are orthogonal matrices, V' indicates
the transpose of V, and S is a diagonal matrix. Once an SVD has been
constructed, it can be used to perform various computations related to M,
such as solving equations, computing the determinant, or estimating the
condition number.
Providing a separate class for the SVD allows an application to perform such decompositions repeatedly without having to reallocate temporary storage space.
Field Summary | |
---|---|
static int |
DEFAULT_ITERATION_LIMIT
The iteration limit for computing the SVD. |
Constructor Summary | |
---|---|
SVDecomposition3d()
Creates an uninitialized SVDecomposition with U and V internally allocated. |
|
SVDecomposition3d(Matrix3dBase M)
Creates an SVDecomposition with U and V internally allocated and initializes it to the SVD for the matrix M. |
|
SVDecomposition3d(Matrix3d U,
Matrix3d V)
Creates an SVDecomposition with the matrices U and V. |
|
SVDecomposition3d(Matrix3d U,
Matrix3d V,
Matrix3dBase M)
Creates an SVDecomposition with the matrices U and V, and initializes it to the SVD for the matrix M. |
Method Summary | |
---|---|
double |
condition()
Computes the condition number of the original matrix M associated with this SVD. |
double |
determinant()
Computes the determinant of the original matrix M associated with this SVD. |
void |
factor(Matrix3dBase M)
Peforms an SVD on the Matrix3dBase M. |
int |
getIterationLimit()
Gets the iteration limit for SVD computations. |
Vector3d[] |
getNullSpace()
|
Vector3d[] |
getNullSpace(double eps)
|
Vector3d[] |
getRangeSpace()
|
Vector3d[] |
getRangeSpace(double eps)
|
void |
getS(Vector3d svec)
Gets the singular values associated with this SVD. |
Matrix3d |
getU()
Returns the U matrix associated with this SVD, or null if no such matrix has been set. |
Matrix3d |
getV()
Returns the V matrix associated with this SVD, or null if no such matrix has been set. |
boolean |
inverse(Matrix3d R)
Computes the inverse of the original matrix M associated this SVD, and places the result in R. |
boolean |
isCanonical()
|
void |
leftPolarDecomposition(Matrix3d P,
Matrix3dBase R,
Matrix3dBase F)
Factors a 3 x 3 matrix F into a left polar decomposition |
void |
leftPolarDecomposition(SymmetricMatrix3d P,
Matrix3dBase R,
Matrix3dBase F)
Factors a 3 x 3 matrix F into a left polar decomposition |
double |
norm()
Computes the 2-norm of the original matrix M associated with this SVD. |
void |
polarDecomposition(Matrix3dBase R,
Matrix3d P,
Matrix3dBase F)
Factors a 3 x 3 matrix F into a right polar decomposition |
void |
polarDecomposition(Matrix3dBase R,
SymmetricMatrix3d P,
Matrix3dBase F)
Factors a 3 x 3 matrix F into a right polar decomposition |
boolean |
pseudoInverse(Matrix3d R)
Computes the pseudo inverse of the original matrix M associated this SVD, and places the result in R. |
void |
setCanonical(boolean enable)
Ensure that singular values are positive and sorted from largest to smallest. |
void |
setIterationLimit(int lim)
Sets the iteration limit for SVD computations. |
void |
setU(Matrix3d U)
Sets the U matrix associated with this SVD. |
void |
setV(Matrix3d V)
Sets the V matrix associated with this SVD. |
boolean |
solve(Vector3d x,
Vector3d b)
Solves the linear equation M x = b where M is the original matrix associated with this SVD, and x and b are vectors. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_ITERATION_LIMIT
Constructor Detail |
---|
public SVDecomposition3d(Matrix3d U, Matrix3d V, Matrix3dBase M)
U
- optional U matrix for this SVDV
- optional V matrix for this SVDM
- matrix to perform the SVD onpublic SVDecomposition3d(Matrix3d U, Matrix3d V)
U
- optional U matrix for this SVDV
- optional V matrix for this SVDpublic SVDecomposition3d(Matrix3dBase M)
M
- matrix to perform the SVD onpublic SVDecomposition3d()
Method Detail |
---|
public void setCanonical(boolean enable)
true
. If
false
, then no effort will be made to ensure that the
values are positive or sorted.
public boolean isCanonical()
public int getIterationLimit()
setIterationLimit(int)
public void setIterationLimit(int lim)
lim
- iteration limitgetIterationLimit()
public void factor(Matrix3dBase M)
M
- matrix to perform the SVD onpublic void setU(Matrix3d U)
U
- new U matrix for this SVDpublic Matrix3d getU()
public void setV(Matrix3d V)
V
- new V matrix for this SVDpublic Matrix3d getV()
public void getS(Vector3d svec)
svec
- vector giving the diagonal elements of Spublic double condition()
ImproperStateException
- if this SVDecomposition is uninitializedpublic double norm()
ImproperStateException
- if this SVDecomposition is uninitializedpublic double determinant()
ImproperStateException
- if this SVDecomposition is uninitializedpublic boolean solve(Vector3d x, Vector3d b)
x
- unknown vector to solve forb
- constant vector
ImproperStateException
- if this decomposition is uninitialized, or if U and V are not presentpublic boolean inverse(Matrix3d R)
R
- matrix in which the inverse is stored
ImproperStateException
- if this decomposition is uninitialized, or if U and V are not presentpublic boolean pseudoInverse(Matrix3d R)
R
- matrix in which the inverse is stored
ImproperStateException
- if this decomposition is uninitialized, or if U and V are not presentpublic Vector3d[] getNullSpace(double eps)
public Vector3d[] getRangeSpace(double eps)
public Vector3d[] getNullSpace()
public Vector3d[] getRangeSpace()
public void polarDecomposition(Matrix3dBase R, Matrix3d P, Matrix3dBase F)
F = R Pwhere R is a rotation matrix (with determinant 1) and P is a symmetric matrix.
public void polarDecomposition(Matrix3dBase R, SymmetricMatrix3d P, Matrix3dBase F)
F = R Pwhere R is a rotation matrix (with determinant 1) and P is a symmetric matrix.
public void leftPolarDecomposition(Matrix3d P, Matrix3dBase R, Matrix3dBase F)
F = R Pwhere R is a rotation matrix (with determinant 1) and P is a symmetric matrix.
public void leftPolarDecomposition(SymmetricMatrix3d P, Matrix3dBase R, Matrix3dBase F)
F = R Pwhere R is a rotation matrix (with determinant 1) and P is a symmetric matrix.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |