setxor.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233
  1. #include "setxor.h"
  2. #include "setdiff.h"
  3. #include "setunion.h"
  4. #include "slice.h"
  5. template <
  6. typename DerivedA,
  7. typename DerivedB,
  8. typename DerivedC,
  9. typename DerivedIA,
  10. typename DerivedIB>
  11. IGL_INLINE void igl::setxor(
  12. const Eigen::DenseBase<DerivedA> & A,
  13. const Eigen::DenseBase<DerivedB> & B,
  14. Eigen::PlainObjectBase<DerivedC> & C,
  15. Eigen::PlainObjectBase<DerivedIA> & IA,
  16. Eigen::PlainObjectBase<DerivedIB> & IB)
  17. {
  18. DerivedC AB,BA;
  19. DerivedIA IAB,IBA;
  20. setdiff(A,B,AB,IAB);
  21. setdiff(B,A,BA,IBA);
  22. setunion(AB,BA,C,IA,IB);
  23. slice(IAB,DerivedIA(IA),IA);
  24. slice(IBA,DerivedIB(IB),IB);
  25. }
  26. #ifdef IGL_STATIC_LIBRARY
  27. // Explicit template instantiation
  28. // generated by autoexplicit.sh
  29. template void igl::setxor<Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  30. template void igl::setxor<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::DenseBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  31. #endif