all_pairs_distances.h 804 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IGL_ALL_PAIRS_DISTANCES_H
  2. #define IGL_ALL_PAIRS_DISTANCES_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // ALL_PAIRS_DISTANCES compute distances between each point i in V and point j
  7. // in U
  8. //
  9. // D = all_pairs_distances(V,U)
  10. //
  11. // Templates:
  12. // Mat matrix class like MatrixXd
  13. // Inputs:
  14. // V #V by dim list of points
  15. // U #U by dim list of points
  16. // squared whether to return squared distances
  17. // Outputs:
  18. // D #V by #U matrix of distances, where D(i,j) gives the distance or
  19. // squareed distance between V(i,:) and U(j,:)
  20. //
  21. template <typename Mat>
  22. IGL_INLINE void all_pairs_distances(
  23. const Mat & V,
  24. const Mat & U,
  25. const bool squared,
  26. Mat & D);
  27. }
  28. #ifdef IGL_HEADER_ONLY
  29. # include "all_pairs_distances.cpp"
  30. #endif
  31. #endif