#include "unique_edge_map.h" #include "all_edges.h" #include "unique_simplices.h" #include #include template < typename DerivedF, typename DerivedE, typename DeriveduE, typename DerivedEMAP, typename uE2EType> IGL_INLINE void igl::unique_edge_map( const Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & E, Eigen::PlainObjectBase & uE, Eigen::PlainObjectBase & EMAP, std::vector > & uE2E) { using namespace Eigen; using namespace std; // All occurances of directed edges all_edges(F,E); const size_t ne = E.rows(); // This is 2x faster to create than a map from pairs to lists of edges and 5x // faster to access (actually access is probably assympotically faster O(1) // vs. O(log m) Matrix IA; unique_simplices(E,uE,IA,EMAP); uE2E.resize(uE.rows()); // This does help a little for_each(uE2E.begin(),uE2E.end(),[](vector & v){v.reserve(2);}); assert((size_t)EMAP.size() == ne); for(uE2EType e = 0;e<(uE2EType)ne;e++) { uE2E[EMAP(e)].push_back(e); } } #ifdef IGL_STATIC_LIBRARY // Explicit template specialization template void igl::unique_edge_map, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, long>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, std::vector >, std::allocator > > >&); template void igl::unique_edge_map, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, long>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, std::vector >, std::allocator > > >&); template void igl::unique_edge_map, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, std::vector >, std::allocator > > >&); template void igl::unique_edge_map, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, int>(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, std::vector >, std::allocator > > >&); #endif