- for k = [1 : max_iterations]
- % Loop until either of our stopping conditions are met. If the
- % loop finishes, we have implicitly met the second stopping
- % condition (number of iterations).
- d_k = -g_k;
- alpha_k = step_size(x);
- x = x + (alpha_k * d_k);
- g_k = g(x);