orth.h 987 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef IGL_ORTH_H
  2. #define IGL_ORTH_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. namespace igl
  6. {
  7. // ORTH Orthogonalization.
  8. // ORTH(A,Q) produces Q as an orthonormal basis for the range of A.
  9. // That is, Q'*Q = I, the columns of Q span the same space as
  10. // the columns of A, and the number of columns of Q is the
  11. // rank of A.
  12. //
  13. //
  14. // The algorithm uses singular value decomposition, SVD, instead of orthogonal
  15. // factorization, QR. This doubles the computation time, but
  16. // provides more reliable and consistent rank determination.
  17. // Closely follows MATLAB implementation in orth.m
  18. //
  19. // Inputs:
  20. // A m by n matrix
  21. // Outputs:
  22. // Q m by n matrix with orthonormal columns spanning same column space as
  23. // A
  24. //
  25. // Known bugs: Implementation listed as "Broken"
  26. IGL_INLINE void orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q);
  27. }
  28. #ifdef IGL_HEADER_ONLY
  29. # include "orth.cpp"
  30. #endif
  31. #endif