invert_diag.h 687 B

1234567891011121314151617181920212223242526272829
  1. #ifndef IGL_INVERT_DIAG_H
  2. #define IGL_INVERT_DIAG_H
  3. #include "igl_inline.h"
  4. #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
  5. #include <Eigen/Sparse>
  6. namespace igl
  7. {
  8. // Invert the diagonal entries of a matrix (if the matrix is a diagonal
  9. // matrix then this amounts to inverting the matrix)
  10. // Templates:
  11. // T should be a eigen sparse matrix primitive type like int or double
  12. // Inputs:
  13. // X an m by n sparse matrix
  14. // Outputs:
  15. // Y an m by n sparse matrix
  16. template <typename T>
  17. IGL_INLINE void invert_diag(
  18. const Eigen::SparseMatrix<T>& X,
  19. Eigen::SparseMatrix<T>& Y);
  20. }
  21. #ifdef IGL_HEADER_ONLY
  22. # include "invert_diag.cpp"
  23. #endif
  24. #endif