plot_vector.h 522 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_PLOT_VECTOR_H
  2. #define IGL_PLOT_VECTOR_H
  3. #include <iostream>
  4. namespace igl
  5. {
  6. template <typename T>
  7. inline void plot_vector( std::vector<T>& v)
  8. {
  9. for (int i=0; i<v.size(); ++i)
  10. std::cerr << v[i] << " ";
  11. std::cerr << std::endl;
  12. }
  13. template <typename T>
  14. inline void plot_vector( std::vector< std::vector<T> >& v)
  15. {
  16. for (int i=0; i<v.size(); ++i)
  17. {
  18. for (int j=0; j<v[i].size(); ++j)
  19. std::cerr << v[i][j] << " ";
  20. std::cerr << std::endl;
  21. }
  22. }
  23. }
  24. #endif