full.h 934 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IGL_FULL_H
  2. #define IGL_FULL_H
  3. #include "igl_inline.h"
  4. #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
  5. #include <Eigen/Dense>
  6. #include <Eigen/Sparse>
  7. namespace igl
  8. {
  9. // This is totally unnecessary. You can just call MatrixXd B = MatrixXd(A);
  10. //
  11. // Convert a sparsematrix into a full one
  12. //
  13. // Templates:
  14. // T should be a eigen sparse matrix primitive type like int or double
  15. // Input:
  16. // A m by n sparse matrix
  17. // Output:
  18. // B m by n dense/full matrix
  19. template <typename T,typename DerivedB>
  20. IGL_INLINE void full(
  21. const Eigen::SparseMatrix<T> & A,
  22. Eigen::PlainObjectBase<DerivedB> & B);
  23. // If already full then this will just be a copy by assignment
  24. template <typename DerivedA,typename DerivedB>
  25. IGL_INLINE void full(
  26. const Eigen::PlainObjectBase<DerivedA>& A,
  27. Eigen::PlainObjectBase<DerivedB>& B);
  28. }
  29. #ifdef IGL_HEADER_ONLY
  30. # include "full.cpp"
  31. #endif
  32. #endif