setxor.cpp 1.7 KB

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