MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / findComponentBitSet

Function findComponentBitSet

source/MRMesh/MRUnionFindParallel.h:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29/// if region is provided then only its elements will be checked
30template <typename I>
31[[nodiscard]] TypedBitSet<I> findComponentBitSet( BaseUnionFind<I> & uf, I a, const TypedBitSet<I> * region = nullptr )
32{
33 MR_TIMER;
34 TypedBitSet<I> res( uf.size() );
35 a = uf.find( a );
36 BitSetParallelForAllRanged( res, [&]( I i, const auto & range )
37 {
38 if ( region && !region->test( i ) )
39 return;
40 if ( a == uf.findUpdateRange( i, range.beg, range.end ) )
41 res.set( i );
42 } );
43 return res;
44}
45
46/// returns true if there is no set in UnionFind that contains both an element from the given region and another element not from the region;
47/// in other words, UnionFind contains a subdivision of both region and not-region on subsets

Callers 1

getLargestComponentVertsFunction · 0.85

Calls 6

findUpdateRangeMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45
testMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected