public HyperBoundingBox determineAlphaMinMax ( HyperBoundingBox interval ) { final int dim = vec . getDimensionality ( ) ; if ( interval . getDimensionality ( ) != dim - 1 ) { throw new IllegalArgumentException ( "Interval needs to have dimensionality d=" + ( dim - 1 ) + ", read: " + interval . getDimensionality ( ) ) ; } if ( extremumType . equals ( ExtremumType . CONSTANT ) ) { double [ ] centroid = SpatialUtil . centroid ( interval ) ; return new HyperBoundingBox ( centroid , centroid ) ; } double [ ] alpha_min = new double [ dim - 1 ] ; double [ ] alpha_max = new double [ dim - 1 ] ; if ( SpatialUtil . contains ( interval , alphaExtremum ) ) { if ( extremumType . equals ( ExtremumType . MINIMUM ) ) { alpha_min = alphaExtremum ; for ( int d = dim - 2 ; d >= 0 ; d -- ) { alpha_max [ d ] = determineAlphaMax ( d , alpha_max , interval ) ; } } else { alpha_max = alphaExtremum ; for ( int d = dim - 2 ; d >= 0 ; d -- ) { alpha_min [ d ] = determineAlphaMin ( d , alpha_min , interval ) ; } } } else { for ( int d = dim - 2 ; d >= 0 ; d -- ) { alpha_min [ d ] = determineAlphaMin ( d , alpha_min , interval ) ; alpha_max [ d ] = determineAlphaMax ( d , alpha_max , interval ) ; } } return new HyperBoundingBox ( alpha_min , alpha_max ) ; }
Determines the alpha values where this function has a minumum and maximum value in the given interval .