ismember_rows.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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_ISMEMBER_ROWS_H
  9. #define IGL_ISMEMBER_ROWS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Determine if row of A exist in rows of B
  15. ///
  16. /// @param[in] A ma by na matrix
  17. /// @param[in] B mb by nb matrix
  18. /// @param[out] IA ma by 1 lest of flags whether corresponding element of A
  19. /// exists in B
  20. /// @param[out] LOCB ma by 1 list matrix of indices in B locating matching
  21. /// element (-1 if not found), indices assume column major ordering
  22. template <
  23. typename DerivedA,
  24. typename DerivedB,
  25. typename DerivedIA,
  26. typename DerivedLOCB>
  27. IGL_INLINE void ismember_rows(
  28. const Eigen::MatrixBase<DerivedA> & A,
  29. const Eigen::MatrixBase<DerivedB> & B,
  30. Eigen::PlainObjectBase<DerivedIA> & IA,
  31. Eigen::PlainObjectBase<DerivedLOCB> & LOCB);
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "ismember_rows.cpp"
  35. #endif
  36. #endif