Package org.robwork.sdurw_math
Class LinearAlgebra
- java.lang.Object
-
- org.robwork.sdurw_math.LinearAlgebra
-
public class LinearAlgebra extends java.lang.Object
Collection of Linear Algebra functions
-
-
Constructor Summary
Constructors Constructor Description LinearAlgebra()
LinearAlgebra(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
checkPenroseConditions(EigenMatrixXd A, EigenMatrixXd X, double prec)
Checks the penrose conditionsvoid
delete()
static pairEigenMatrixXComplex_d_EigenVectorXComplex_d
eigenDecomposition(SWIGTYPE_p_Eigen__MatrixT_double_Eigen__Dynamic_Eigen__Dynamic_t Am1)
Eigen decomposition of a matrix.static pairEigenMatrixX_d_EigenVectorX_d
eigenDecompositionSymmetric(SWIGTYPE_p_Eigen__MatrixT_double_Eigen__Dynamic_Eigen__Dynamic_t Am1)
Decomposition for a symmetric matrix.static long
getCPtr(LinearAlgebra obj)
static boolean
isSO(EigenMatrix3d var)
static EigenMatrixXd
pseudoInverse(EigenMatrixXd am)
Calculates the moore-penrose (pseudo) inverse of a matrix
\mathbf{M}^+
static EigenMatrixXd
pseudoInverse(EigenMatrixXd am, double precision)
Calculates the moore-penrose (pseudo) inverse of a matrix
\mathbf{M}^+
static void
svd(EigenMatrixXd M, EigenMatrixXd U, EigenVectorXd sigma, EigenMatrixXd V)
Performs a singular value decomposition (SVD)
The SVD computes the decomposition
\mathbf{M}=\mathbf{U}*\mathbf{DiagonalMatrix(\sigma)}*\mathbf{V}^T .
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(LinearAlgebra obj)
-
delete
public void delete()
-
svd
public static void svd(EigenMatrixXd M, EigenMatrixXd U, EigenVectorXd sigma, EigenMatrixXd V)
Performs a singular value decomposition (SVD)
The SVD computes the decomposition
\mathbf{M}=\mathbf{U}*\mathbf{DiagonalMatrix(\sigma)}*\mathbf{V}^T .
- Parameters:
M
- [in] the matrix to decompositeU
- [out] Result matrix \mathbf{U}sigma
- [out] The \mathbf{sigma} vector with diagonal elementsV
- [out] Result matrix \mathbf{V}
-
pseudoInverse
public static EigenMatrixXd pseudoInverse(EigenMatrixXd am, double precision)
Calculates the moore-penrose (pseudo) inverse of a matrix
\mathbf{M}^+
- Parameters:
am
- [in] the matrix \mathbf{M} to be inverted
precision
- [in] the precision to use, values below this
treshold are considered singular
- Returns:
- the pseudo-inverse \mathbf{M}^+ of \mathbf{M}
\mathbf{M}^+=\mathbf{V}\mathbf{\Sigma} ^+\mathbf{U}^T where
\mathbf{V} , \mathbf{\Sigma} and \mathbf{U}
are optained using Singular Value Decomposition (SVD)
-
pseudoInverse
public static EigenMatrixXd pseudoInverse(EigenMatrixXd am)
Calculates the moore-penrose (pseudo) inverse of a matrix
\mathbf{M}^+
- Parameters:
am
- [in] the matrix \mathbf{M} to be inverted
- Returns:
- the pseudo-inverse \mathbf{M}^+ of \mathbf{M}
\mathbf{M}^+=\mathbf{V}\mathbf{\Sigma} ^+\mathbf{U}^T where
\mathbf{V} , \mathbf{\Sigma} and \mathbf{U}
are optained using Singular Value Decomposition (SVD)
-
checkPenroseConditions
public static boolean checkPenroseConditions(EigenMatrixXd A, EigenMatrixXd X, double prec)
Checks the penrose conditions- Parameters:
A
- [in] a matrixX
- [in] a pseudoinverse of Aprec
- [in] the tolerance
- Returns:
- true if the pseudoinverse X of A fullfills the penrose
conditions, false otherwise
Checks the penrose conditions:
AXA = A
XAX = X
(AX)^T = AX
(XA)^T = XA
-
eigenDecompositionSymmetric
public static pairEigenMatrixX_d_EigenVectorX_d eigenDecompositionSymmetric(SWIGTYPE_p_Eigen__MatrixT_double_Eigen__Dynamic_Eigen__Dynamic_t Am1)
Decomposition for a symmetric matrix.- Parameters:
Am1
- [in] a symmetric matrix.- Returns:
- the decomposition as a pair with eigenvectors and eigenvalues.
-
eigenDecomposition
public static pairEigenMatrixXComplex_d_EigenVectorXComplex_d eigenDecomposition(SWIGTYPE_p_Eigen__MatrixT_double_Eigen__Dynamic_Eigen__Dynamic_t Am1)
Eigen decomposition of a matrix.- Parameters:
Am1
- [in] the matrix.- Returns:
- the decomposition as a pair with eigenvectors and eigenvalues.
-
isSO
public static boolean isSO(EigenMatrix3d var)
-
-