rows_to_matrix.h 682 B

123456789101112131415161718192021222324252627
  1. #ifndef IGL_ROWS_TO_MATRIX_H
  2. #define IGL_ROWS_TO_MATRIX_H
  3. #include "igl_inline.h"
  4. #include <vector>
  5. namespace igl
  6. {
  7. // Convert a list (std::vector) of row vectors of the same length to a matrix
  8. // Template:
  9. // Row row vector type, must implement:
  10. // .size()
  11. // Mat Matrix type, must implement:
  12. // .resize(m,n)
  13. // .row(i) = Row
  14. // Inputs:
  15. // V a m-long list of vectors of size n
  16. // Outputs:
  17. // M an m by n matrix
  18. // Returns true on success, false on errors
  19. template <class Row, class Mat>
  20. IGL_INLINE bool rows_to_matrix(const std::vector<Row> & V,Mat & M);
  21. }
  22. #ifdef IGL_HEADER_ONLY
  23. # include "rows_to_matrix.cpp"
  24. #endif
  25. #endif