orth.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  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. /// Orthogonalization of a matrix. ORTH(A,Q) produces Q as an orthonormal
  15. /// basis for the range of A. That is, Q'*Q = I, the columns of Q span the
  16. /// same space as the columns of A, and the number of columns of Q is the rank
  17. /// of A.
  18. ///
  19. ///
  20. /// The algorithm uses singular value decomposition, SVD, instead of
  21. /// orthogonal factorization, QR. This doubles the computation time, but
  22. /// provides more reliable and consistent rank determination. Closely follows
  23. /// MATLAB implementation in orth.m
  24. ///
  25. /// @param[in] A m by n matrix
  26. /// @param[out] Q m by n matrix with orthonormal columns spanning same column
  27. /// space as A
  28. ///
  29. /// \warning Implementation listed as "Broken"
  30. IGL_INLINE void orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q);
  31. }
  32. #ifndef IGL_STATIC_LIBRARY
  33. # include "orth.cpp"
  34. #endif
  35. #endif