protected < E extends SpatialComparable , A > double computeOverlap ( A entries , ArrayAdapter < E , A > getter , long [ ] assign ) { ModifiableHyperBoundingBox mbr1 = null , mbr2 = null ; for ( int i = 0 ; i < getter . size ( entries ) ; i ++ ) { E e = getter . get ( entries , i ) ; if ( BitsUtil . get ( assign , i ) ) { if ( mbr1 == null ) { mbr1 = new ModifiableHyperBoundingBox ( e ) ; } else { mbr1 . extend ( e ) ; } } else { if ( mbr2 == null ) { mbr2 = new ModifiableHyperBoundingBox ( e ) ; } else { mbr2 . extend ( e ) ; } } } if ( mbr1 == null || mbr2 == null ) { throw new AbortException ( "Invalid state in split: one of the sets is empty." ) ; } return SpatialUtil . overlap ( mbr1 , mbr2 ) ; }
Compute overlap of assignment