Remove svd inverse_square_root

release/4.3a0
cbeall3 2014-05-03 11:54:01 -04:00
parent 312d3fac1e
commit 267b86ec14
2 changed files with 1 additions and 23 deletions

View File

@ -642,29 +642,7 @@ Matrix cholesky_inverse(const Matrix &A)
// return BNU::prod(trans(inv), inv);
}
#if 0
/* ************************************************************************* */
// TODO, would be faster with Cholesky
Matrix inverse_square_root(const Matrix& A) {
size_t m = A.cols(), n = A.rows();
if (m!=n)
throw invalid_argument("inverse_square_root: A must be square");
// Perform SVD, TODO: symmetric SVD?
Matrix U,V;
Vector S;
svd(A,U,S,V);
// invert and sqrt diagonal of S
// We also arbitrarily choose sign to make result have positive signs
for(size_t i = 0; i<m; i++) S(i) = - pow(S(i),-0.5);
return vector_scale(S, V); // V*S;
}
#endif
/* ************************************************************************* */
// New, improved, with 100% more Cholesky goodness!
//
// Semantics:
// if B = inverse_square_root(A), then all of the following are true:
// inv(B) * inv(B)' == A

View File

@ -418,7 +418,7 @@ GTSAM_EXPORT Matrix3 skewSymmetric(double wx, double wy, double wz);
template<class Derived>
inline Matrix3 skewSymmetric(const Eigen::MatrixBase<Derived>& w) { return skewSymmetric(w(0),w(1),w(2));}
/** Use SVD to calculate inverse square root of a matrix */
/** Use Cholesky to calculate inverse square root of a matrix */
GTSAM_EXPORT Matrix inverse_square_root(const Matrix& A);
/** Calculate the LL^t decomposition of a S.P.D matrix */