writeDMAT.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. template <typename Scalar>
  36. IGL_INLINE bool writeDMAT(
  37. const std::string file_name,
  38. const std::vector<Scalar > W);
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "writeDMAT.cpp"
  42. #endif
  43. #endif