read_eigen_from_CSV.h 585 B

1234567891011121314151617181920212223242526
  1. #ifndef IGL_READ_EIGEN_FROM_CSV_H
  2. #define IGL_READ_EIGEN_FROM_CSV_H
  3. #include "igl/igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <string>
  6. #include <vector>
  7. namespace igl
  8. {
  9. // read a matrix from a csv file into a Eigen matrix
  10. // Templates:
  11. // Scalar type for the matrix
  12. // Inputs:
  13. // str path to .csv file
  14. // Outputs:
  15. // M eigen matrix
  16. template <typename Scalar>
  17. IGL_INLINE bool read_eigen_from_CSV(const std::string str, Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& M);
  18. }
  19. #ifdef IGL_HEADER_ONLY
  20. # include "read_eigen_from_CSV.cpp"
  21. #endif
  22. #endif