matrix_to_list.h 698 B

123456789101112131415161718192021222324252627282930
  1. #ifndef IGL_MATRIX_TO_LIST_H
  2. #define IGL_MATRIX_TO_LIST_H
  3. #include "igl_inline.h"
  4. #include <vector>
  5. namespace igl
  6. {
  7. // Convert a matrix to a list (std::vector) of row vectors of the same size
  8. // Template:
  9. // Mat Matrix type, must implement:
  10. // .resize(m,n)
  11. // .row(i) = Row
  12. // T type that can be safely cast to type in Mat via '='
  13. // Inputs:
  14. // V a m-long list of vectors of size n
  15. // Outputs:
  16. // M an m by n matrix
  17. //
  18. // See also: list_to_matrix
  19. template <typename Mat, typename T>
  20. IGL_INLINE void matrix_to_list(
  21. const Mat & M,
  22. std::vector<std::vector<T > > & V);
  23. }
  24. #ifdef IGL_HEADER_ONLY
  25. # include "matrix_to_list.cpp"
  26. #endif
  27. #endif