/** * Iterate until the line search converges or the maximum number of iterations has been exceeded. * * The maximum number of steps is specified. A step is defined as the number of times the * optimization parameters are changed. * * @param search Search algorithm * @param maxSteps Maximum number of steps. * @return Value returned by {@link IterativeOptimization#iterate} */ public static boolean process( IterativeOptimization search , int maxSteps ) { for( int i = 0; i < maxSteps; i++ ) { boolean converged = step(search); if( converged ) { return search.isConverged(); } } return true; }
/** * Iterate until the line search converges or the maximum number of iterations has been exceeded. * * The maximum number of steps is specified. A step is defined as the number of times the * optimization parameters are changed. * * @param search Search algorithm * @param maxSteps Maximum number of steps. * @return Value returned by {@link IterativeOptimization#iterate} */ public static boolean process( IterativeOptimization search , int maxSteps ) { for( int i = 0; i < maxSteps; i++ ) { boolean converged = step(search); if( converged ) { return search.isConverged(); } } return true; }