protected ApproximationLine conservativeKnnDistanceApproximation ( int k_max ) { // determine k_0, y_1, y_kmax int k_0 = k_max ; double y_1 = Double . NEGATIVE_INFINITY ; double y_kmax = Double . NEGATIVE_INFINITY ; for ( int i = 0 ; i < getNumEntries ( ) ; i ++ ) { MkCoPEntry entry = getEntry ( i ) ; ApproximationLine approx = entry . getConservativeKnnDistanceApproximation ( ) ; k_0 = Math . min ( approx . getK_0 ( ) , k_0 ) ; } for ( int i = 0 ; i < getNumEntries ( ) ; i ++ ) { MkCoPEntry entry = getEntry ( i ) ; ApproximationLine approx = entry . getConservativeKnnDistanceApproximation ( ) ; double entry_y_1 = approx . getValueAt ( k_0 ) ; double entry_y_kmax = approx . getValueAt ( k_max ) ; if ( ! Double . isInfinite ( entry_y_1 ) ) { y_1 = Math . max ( entry_y_1 , y_1 ) ; } if ( ! Double . isInfinite ( entry_y_kmax ) ) { y_kmax = Math . max ( entry_y_kmax , y_kmax ) ; } } // determine m and t double m = ( y_kmax - y_1 ) / ( FastMath . log ( k_max ) - FastMath . log ( k_0 ) ) ; double t = y_1 - m * FastMath . log ( k_0 ) ; return new ApproximationLine ( k_0 , m , t ) ; }
Determines and returns the conservative approximation for the knn distances of this node as the maximum of the conservative approximations of all entries .