public void split ( ) { if ( hasChildren ( ) ) { return ; } final boolean issplit = ( maxSplitDimension >= ( getDimensionality ( ) - 1 ) ) ; final int childLevel = issplit ? level + 1 : level ; final int splitDim = issplit ? 0 : maxSplitDimension + 1 ; final double splitPoint = getMin ( splitDim ) + ( getMax ( splitDim ) - getMin ( splitDim ) ) * .5 ; // left and right child for ( int i = 0 ; i < 2 ; i ++ ) { double [ ] min = SpatialUtil . getMin ( this ) ; // clone double [ ] max = SpatialUtil . getMax ( this ) ; // clone // right child if ( i == 0 ) { min [ splitDim ] = splitPoint ; } // left child else { max [ splitDim ] = splitPoint ; } ModifiableDBIDs childIDs = split . determineIDs ( getIDs ( ) , new HyperBoundingBox ( min , max ) , d_min , d_max ) ; if ( childIDs != null ) { // right child if ( i == 0 ) { rightChild = new CASHInterval ( min , max , split , childIDs , splitDim , childLevel , d_min , d_max ) ; } // left child else { leftChild = new CASHInterval ( min , max , split , childIDs , splitDim , childLevel , d_min , d_max ) ; } } } if ( LOG . isDebuggingFine ( ) ) { StringBuilder msg = new StringBuilder ( ) ; msg . append ( "Child level " ) . append ( childLevel ) . append ( ", split Dim " ) . append ( splitDim ) ; if ( leftChild != null ) { msg . append ( "\nleft " ) . append ( leftChild ) ; } if ( rightChild != null ) { msg . append ( "\nright " ) . append ( rightChild ) ; } LOG . fine ( msg . toString ( ) ) ; } }
Splits this interval into 2 children .