svd.h 642 B

123456789101112131415161718192021222324
  1. #ifndef IGL_SVD_H
  2. #define IGL_SVD_H
  3. namespace igl
  4. {
  5. // Compute 3x3 SVD using lapack's dgesdd_ function
  6. //
  7. // Input:
  8. // a pointer to 3x3 matrix in COLUMN MAJOR order
  9. // Outputs:
  10. // u pointer to 3x3 matrix in COLUMN MAJOR order
  11. // s pointer to 3 vector
  12. // vt pointer to 3x3 matrix in COLUMN MAJOR order, or think of this as v in
  13. // row-major order
  14. // Returns true on success, false on failure
  15. //
  16. // Known bugs: This only compiles on Mac and depends on Lapack rather than eigen
  17. bool svd3x3(double * a, double * u, double * s, double * vt);
  18. };
  19. #ifdef IGL_HEADER_ONLY
  20. #include "svd.cpp"
  21. #endif
  22. #endif