orth.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_ORTH_H
  9. #define IGL_ORTH_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. // ORTH Orthogonalization.
  15. // ORTH(A,Q) produces Q as an orthonormal basis for the range of A.
  16. // That is, Q'*Q = I, the columns of Q span the same space as
  17. // the columns of A, and the number of columns of Q is the
  18. // rank of A.
  19. //
  20. //
  21. // The algorithm uses singular value decomposition, SVD, instead of orthogonal
  22. // factorization, QR. This doubles the computation time, but
  23. // provides more reliable and consistent rank determination.
  24. // Closely follows MATLAB implementation in orth.m
  25. //
  26. // Inputs:
  27. // A m by n matrix
  28. // Outputs:
  29. // Q m by n matrix with orthonormal columns spanning same column space as
  30. // A
  31. //
  32. // Known bugs: Implementation listed as "Broken"
  33. IGL_INLINE void orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "orth.cpp"
  37. #endif
  38. #endif