| 796 | } |
| 797 | |
| 798 | void MultiwayICP::deactivateFarDistPairs_( ICPLayer l ) |
| 799 | { |
| 800 | MR_TIMER; |
| 801 | auto& pairs = pairsGridPerLayer_[l]; |
| 802 | Vector<float, ICPElementId> maxDistSq( pairs.size() ); |
| 803 | for ( int it = 0; it < 3; ++it ) |
| 804 | { |
| 805 | ParallelFor( maxDistSq, [&] ( auto id ) |
| 806 | { |
| 807 | maxDistSq[id] = sqr( prop_.farDistFactor * MR::calcMeanSqDistToPointEx( pairs, id ) ); |
| 808 | } ); |
| 809 | |
| 810 | tbb::enumerable_thread_specific<size_t> counters( 0 ); |
| 811 | ParallelFor( size_t( 0 ), pairs.size() * pairs.size(), [&] ( size_t r ) |
| 812 | { |
| 813 | auto i = ICPElementId( r % pairs.size() ); |
| 814 | auto j = ICPElementId( r / pairs.size() ); |
| 815 | if ( i == j ) |
| 816 | return; |
| 817 | if ( maxDistSq[i] >= prop_.distThresholdSq ) |
| 818 | return; |
| 819 | counters.local() += MR::deactivateFarPairs( pairs[i][j], maxDistSq[i] ); |
| 820 | } ); |
| 821 | |
| 822 | size_t numDeactivated = 0; |
| 823 | for ( auto counter : counters ) |
| 824 | numDeactivated += counter; |
| 825 | if ( numDeactivated == 0 ) |
| 826 | break; |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | bool MultiwayICP::doIteration_( bool p2pl ) |
| 831 | { |
nothing calls this directly
no test coverage detected