setdiff.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 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_SETDIFF_H
  9. #define IGL_SETDIFF_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Set difference of elements of matrices
  15. ///
  16. /// @param[in] A m-long vector of indices
  17. /// @param[in] B n-long vector of indices
  18. /// @param[out] C (k<=m)-long vector of unique elements appearing in A but not in B
  19. /// @param[out] IA (k<=m)-long list of indices into A so that C = A(IA)
  20. template <
  21. typename DerivedA,
  22. typename DerivedB,
  23. typename DerivedC,
  24. typename DerivedIA>
  25. IGL_INLINE void setdiff(
  26. const Eigen::MatrixBase<DerivedA> & A,
  27. const Eigen::MatrixBase<DerivedB> & B,
  28. Eigen::PlainObjectBase<DerivedC> & C,
  29. Eigen::PlainObjectBase<DerivedIA> & IA);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "setdiff.cpp"
  33. #endif
  34. #endif