/** * Uses Backtracking Line search to determine a step size. * * @param c the armijoCondition parameter * @param beta the fraction to multiply the step size at each iteration ( less than 1 ) * @param maxtries max number of tries * @param t0 initial step size * @return the step size */ public double backtrackingLineSearch( double c, double beta, int maxtries, double t0 ) { double t = t0; // step size int k = 0; // boolean success = false; while ( k < maxtries ) { if ( armijoCondition( c, t ) ) { // success = true; break; } else t *= beta; k++; } logger.trace( "selected step size after " + k + " tries" ); return t; }