private void initHeap ( ObjectHeap < CASHInterval > heap , Relation < ParameterizationFunction > relation , int dim , DBIDs ids ) { CASHIntervalSplit split = new CASHIntervalSplit ( relation , minPts ) ; // determine minimum and maximum function value of all functions double [ ] minMax = determineMinMaxDistance ( relation , dim ) ; double d_min = minMax [ 0 ] , d_max = minMax [ 1 ] ; double dIntervalLength = d_max - d_min ; int numDIntervals = ( int ) FastMath . ceil ( dIntervalLength / jitter ) ; double dIntervalSize = dIntervalLength / numDIntervals ; double [ ] d_mins = new double [ numDIntervals ] , d_maxs = new double [ numDIntervals ] ; if ( LOG . isVerbose ( ) ) { LOG . verbose ( new StringBuilder ( ) . append ( "d_min " ) . append ( d_min ) // . append ( "\nd_max " ) . append ( d_max ) // . append ( "\nnumDIntervals " ) . append ( numDIntervals ) // . append ( "\ndIntervalSize " ) . append ( dIntervalSize ) . toString ( ) ) ; } // alpha intervals double [ ] alphaMin = new double [ dim - 1 ] , alphaMax = new double [ dim - 1 ] ; Arrays . fill ( alphaMax , Math . PI ) ; for ( int i = 0 ; i < numDIntervals ; i ++ ) { d_mins [ i ] = ( i == 0 ) ? d_min : d_maxs [ i - 1 ] ; d_maxs [ i ] = ( i < numDIntervals - 1 ) ? d_mins [ i ] + dIntervalSize : d_max - d_mins [ i ] ; HyperBoundingBox alphaInterval = new HyperBoundingBox ( alphaMin , alphaMax ) ; ModifiableDBIDs intervalIDs = split . determineIDs ( ids , alphaInterval , d_mins [ i ] , d_maxs [ i ] ) ; if ( intervalIDs != null && intervalIDs . size ( ) >= minPts ) { heap . add ( new CASHInterval ( alphaMin , alphaMax , split , intervalIDs , - 1 , 0 , d_mins [ i ] , d_maxs [ i ] ) ) ; } } if ( LOG . isDebuggingFiner ( ) ) { LOG . debugFiner ( new StringBuilder ( ) . append ( "heap.size: " ) . append ( heap . size ( ) ) . toString ( ) ) ; } }
Initializes the heap with the root intervals .