writeDMAT.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_WRITEDMAT_H
  9. #define IGL_WRITEDMAT_H
  10. #include "igl_inline.h"
  11. // See writeDMAT.h for a description of the .dmat file type
  12. #include <string>
  13. #include <vector>
  14. namespace igl
  15. {
  16. // Write a matrix using ascii dmat file type
  17. //
  18. // Template:
  19. // Mat matrix type that supports .rows(), .cols(), operator(i,j)
  20. // Inputs:
  21. // file_name path to .dmat file
  22. // W eigen matrix containing to-be-written coefficients
  23. // ascii write ascii file {true}
  24. // Returns true on success, false on error
  25. //
  26. template <class Mat>
  27. IGL_INLINE bool writeDMAT(
  28. const std::string file_name,
  29. const Mat & W,
  30. const bool ascii=true);
  31. template <typename Scalar>
  32. IGL_INLINE bool writeDMAT(
  33. const std::string file_name,
  34. const std::vector<std::vector<Scalar> > W);
  35. }
  36. #ifdef IGL_HEADER_ONLY
  37. # include "writeDMAT.cpp"
  38. #endif
  39. #endif