private double determineAlphaMax(int n,double[] alpha_max,HyperBoundingBox interval){
  double alpha_n=extremum_alpha_n(n,alpha_max);
  double lower=interval.getMin(n);
  double upper=interval.getMax(n);
  double[] alpha_extreme=new double[alpha_max.length];
  System.arraycopy(alpha_max,n,alpha_extreme,n,alpha_extreme.length - n);
  alpha_extreme[n]=alpha_n;
  ExtremumType type=extremumType(n,alpha_extreme,interval);
  if (type.equals(ExtremumType.MINIMUM) || type.equals(ExtremumType.CONSTANT)) {
    if (lower <= alpha_n && alpha_n <= upper) {
      if (alpha_n - lower <= upper - alpha_n) {
        return upper;
      }
 else {
        return lower;
      }
    }
 else     if (alpha_n < lower) {
      return upper;
    }
 else {
      if (alpha_n <= upper) {
        throw new IllegalStateException("Should never happen!");
      }
      return lower;
    }
  }
 else {
    if (lower <= alpha_n && alpha_n <= upper) {
      return alpha_n;
    }
 else     if (alpha_n < lower) {
      return lower;
    }
 else {
      if (alpha_n <= upper) {
        throw new IllegalStateException("Should never happen!");
      }
      return upper;
    }
  }
}

private double determineAlphaMax ( int n , double [ ] alpha_max , HyperBoundingBox interval ) { double alpha_n = extremum_alpha_n ( n , alpha_max ) ; double lower = interval . getMin ( n ) ; double upper = interval . getMax ( n ) ; double [ ] alpha_extreme = new double [ alpha_max . length ] ; System . arraycopy ( alpha_max , n , alpha_extreme , n , alpha_extreme . length - n ) ; alpha_extreme [ n ] = alpha_n ; ExtremumType type = extremumType ( n , alpha_extreme , interval ) ; if ( type . equals ( ExtremumType . MINIMUM ) || type . equals ( ExtremumType . CONSTANT ) ) { if ( lower <= alpha_n && alpha_n <= upper ) { if ( alpha_n - lower <= upper - alpha_n ) { return upper ; } else { return lower ; } } else if ( alpha_n < lower ) { return upper ; } else { if ( alpha_n <= upper ) { throw new IllegalStateException ( "Should never happen!" ) ; } return lower ; } } else { if ( lower <= alpha_n && alpha_n <= upper ) { return alpha_n ; } else if ( alpha_n < lower ) { return lower ; } else { if ( alpha_n <= upper ) { throw new IllegalStateException ( "Should never happen!" ) ; } return upper ; } } }
determines the n - th alpha value where this function has a maximum in the specified interval .
