protected void collectByCover ( DBIDRef cur , ModifiableDoubleDBIDList candidates , double fmax , ModifiableDoubleDBIDList collect ) { assert ( collect . size ( ) == 0 ) : "Not empty" ; DoubleDBIDListIter it = candidates . iter ( ) . advance ( ) ; // Except first = cur! while ( it . valid ( ) ) { assert ( ! DBIDUtil . equal ( cur , it ) ) ; final double dist = distance ( cur , it ) ; if ( dist <= fmax ) { // Collect collect . add ( dist , it ) ; candidates . removeSwap ( it . getOffset ( ) ) ; } else { it . advance ( ) ; // Keep in candidates, outside cover radius. } } }
Collect all elements with respect to a new routing object .