private int maxIntersection ( Map < Integer , ModifiableDBIDs > candidates , ModifiableDBIDs set ) { int maxDim = - 1 ; ModifiableDBIDs maxIntersection = null ; for ( Integer nextDim : candidates . keySet ( ) ) { DBIDs nextSet = candidates . get ( nextDim ) ; ModifiableDBIDs nextIntersection = DBIDUtil . intersection ( set , nextSet ) ; if ( maxDim < 0 || maxIntersection . size ( ) < nextIntersection . size ( ) ) { maxIntersection = nextIntersection ; maxDim = nextDim ; } } if ( maxDim >= 0 ) { set . clear ( ) ; set . addDBIDs ( maxIntersection ) ; } return maxDim ; }
Returns the index of the set having the maximum intersection set with the specified set contained in the specified map .