returns 1. the mapping: FaceId -> Root ID in [0, 1, 2, ...) 2. the total number of roots
| 18 | /// 1. the mapping: FaceId -> Root ID in [0, 1, 2, ...) |
| 19 | /// 2. the total number of roots |
| 20 | static std::pair<UndirectedEdge2RegionMap, int> getUniqueRootIds( const UndirectedEdgeMap& allRoots, const UndirectedEdgeBitSet& region ) |
| 21 | { |
| 22 | MR_TIMER; |
| 23 | UndirectedEdge2RegionMap uniqueRootsMap( allRoots.size() ); |
| 24 | int k = 0; |
| 25 | for ( auto ue : region ) |
| 26 | { |
| 27 | auto& uniqIndex = uniqueRootsMap[allRoots[ue]]; |
| 28 | if ( uniqIndex < 0 ) |
| 29 | { |
| 30 | uniqIndex = RegionId( k ); |
| 31 | ++k; |
| 32 | } |
| 33 | uniqueRootsMap[ue] = uniqIndex; |
| 34 | } |
| 35 | return { std::move( uniqueRootsMap ), k }; |
| 36 | } |
| 37 | |
| 38 | } |
| 39 |
no test coverage detected