pinv.h 913 B

123456789101112131415161718192021222324252627282930
  1. #ifndef IGL_PINV_H
  2. #define IGL_PINV_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. /// Compute the Moore-Penrose pseudoinverse
  8. ///
  9. /// @param[in] A m by n matrix
  10. /// @param[in] tol tolerance (if negative then default is used)
  11. /// @param[out] X n by m matrix so that A*X*A = A and X*A*X = X and A*X =
  12. /// (A*X)' and (X*A) = (X*A)'
  13. ///
  14. /// \deprecated Use `Eigen::CompleteOrthogonalDecomposition<Eigen::MatrixXd>`
  15. /// `.solve()` or `.pseudoinverse()` instead.
  16. template <typename DerivedA, typename DerivedX>
  17. void pinv(
  18. const Eigen::MatrixBase<DerivedA> & A,
  19. typename DerivedA::Scalar tol,
  20. Eigen::PlainObjectBase<DerivedX> & X);
  21. /// \overload
  22. template <typename DerivedA, typename DerivedX>
  23. void pinv(
  24. const Eigen::MatrixBase<DerivedA> & A,
  25. Eigen::PlainObjectBase<DerivedX> & X);
  26. }
  27. #ifndef IGL_STATIC_LIBRARY
  28. # include "pinv.cpp"
  29. #endif
  30. #endif