writeDMAT.h 861 B

12345678910111213141516171819202122232425262728293031323334
  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. // ascii write ascii file {true}
  17. // Returns true on success, false on error
  18. //
  19. template <class Mat>
  20. IGL_INLINE bool writeDMAT(
  21. const std::string file_name,
  22. const Mat & W,
  23. const bool ascii=true);
  24. template <typename Scalar>
  25. IGL_INLINE bool writeDMAT(
  26. const std::string file_name,
  27. const std::vector<std::vector<Scalar> > W);
  28. }
  29. #ifdef IGL_HEADER_ONLY
  30. # include "writeDMAT.cpp"
  31. #endif
  32. #endif