unique_simplices.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_UNIQUE_SIMPLICES_H
  9. #define IGL_UNIQUE_SIMPLICES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. /// Find *combinatorially* unique simplices in F. **Order independent**
  15. ///
  16. /// @param[in] F #F by simplex-size list of simplices
  17. /// @param[out] FF #FF by simplex-size list of unique simplices in F
  18. /// @param[out] IA #FF index vector so that FF == sort(F(IA,:),2);
  19. /// @param[out] IC #F index vector so that sort(F,2) == FF(IC,:);
  20. template <
  21. typename DerivedF,
  22. typename DerivedFF,
  23. typename DerivedIA,
  24. typename DerivedIC>
  25. IGL_INLINE void unique_simplices(
  26. const Eigen::MatrixBase<DerivedF>& F,
  27. Eigen::PlainObjectBase<DerivedFF>& FF,
  28. Eigen::PlainObjectBase<DerivedIA>& IA,
  29. Eigen::PlainObjectBase<DerivedIC>& IC);
  30. /// \overload
  31. template <
  32. typename DerivedF,
  33. typename DerivedFF>
  34. IGL_INLINE void unique_simplices(
  35. const Eigen::MatrixBase<DerivedF>& F,
  36. Eigen::PlainObjectBase<DerivedFF>& FF);
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "unique_simplices.cpp"
  40. #endif
  41. #endif