vf.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233
  1. #include "vf.h"
  2. #include "verbose.h"
  3. template <typename DerivedV, typename DerivedF, typename IndexType>
  4. IGL_INLINE void igl::vf(
  5. const Eigen::PlainObjectBase<DerivedV>& V,
  6. const Eigen::PlainObjectBase<DerivedF>& F,
  7. std::vector<std::vector<IndexType> >& VF,
  8. std::vector<std::vector<IndexType> >& VFi)
  9. {
  10. VF.clear();
  11. VFi.clear();
  12. VF.resize(V.rows());
  13. VFi.resize(V.rows());
  14. for(int fi=0; fi<F.rows(); ++fi)
  15. {
  16. for(int i = 0; i < F.cols(); ++i)
  17. {
  18. VF[F(fi,i)].push_back(fi);
  19. VFi[F(fi,i)].push_back(i);
  20. }
  21. }
  22. }
  23. #ifndef IGL_HEADER_ONLY
  24. // Explicit template specialization
  25. // generated by autoexplicit.sh
  26. template void igl::vf<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&);
  27. template void igl::vf<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, unsigned int>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&, std::vector<std::vector<unsigned int, std::allocator<unsigned int> >, std::allocator<std::vector<unsigned int, std::allocator<unsigned int> > > >&, std::vector<std::vector<unsigned int, std::allocator<unsigned int> >, std::allocator<std::vector<unsigned int, std::allocator<unsigned int> > > >&);
  28. #endif