writeDMAT.h 786 B

123456789101112131415161718192021222324252627282930
  1. #ifndef IGL_WRITEDMAT_H
  2. #define IGL_WRITEDMAT_H
  3. #include "igl_inline.h"
  4. // See writeDMAT.h for a description of the .dmat file type
  5. #include <string>
  6. #include <vector>
  7. namespace igl
  8. {
  9. // Write a matrix using ascii dmat file type
  10. //
  11. // Template:
  12. // Mat matrix type that supports .rows(), .cols(), operator(i,j)
  13. // Inputs:
  14. // file_name path to .dmat file
  15. // W eigen matrix containing to-be-written coefficients
  16. // Returns true on success, false on error
  17. //
  18. template <class Mat>
  19. IGL_INLINE bool writeDMAT(const std::string file_name, const Mat & W);
  20. template <typename Scalar>
  21. IGL_INLINE bool writeDMAT(
  22. const std::string file_name,
  23. const std::vector<std::vector<Scalar> > W);
  24. }
  25. #ifdef IGL_HEADER_ONLY
  26. # include "writeDMAT.cpp"
  27. #endif
  28. #endif