public boolean iterate ( ) { boolean converged ; switch ( mode ) { case COMPUTE_DERIVATIVES : totalFullSteps ++ ; converged = updateDerivates ( ) ; if ( ! converged ) { totalSelectSteps ++ ; converged = computeStep ( ) ; } break ; case DETERMINE_STEP : totalSelectSteps ++ ; converged = computeStep ( ) ; break ; case CONVERGED : return true ; default : throw new RuntimeException ( "BUG! mode=" + mode ) ; } if ( converged ) { mode = Mode . CONVERGED ; return true ; } else { return false ; } }
Performs one iteration