Functions | |
if (nargin< 6||isempty(x0)) x | |
endif | if (isnumeric(a)) r |
endif | if (isnumeric(m)) if(isempty(m)) p |
endif | resvec (1) |
while (resvec(iter-1) > tol *resvec(1)&&iter< maxit) if(isnumeric(m)) if(isempty(m)) s | |
if (b_bot==0.0) breakdown | |
id | q () |
resvec (iter) | |
if (iter >=maxit-2) flag | |
Variables | |
function [x, flag, relres, iter, resvec] | |
else | x = x0 |
else | r = b - feval (a, x, varargin{:}) |
else | p = m \ r |
endif | iter = 2 |
b_bot_old = 1 | |
q_old = p_old = s_old = zeros (size (x)) | |
else | q = feval (a, p, varargin{:}) |
else | s = m \ q |
endif | b_top = r' * s |
b_bot = q' * s | |
break | |
endif | lambda = b_top / b_bot |
else | t = feval (a, s, varargin{:}) |
endif | alpha0 = (t'*s) / b_bot |
alpha1 = (t'*s_old) / b_bot_old | |
p_temp = p | |
q_temp = q | |
s_old = s | |
p_old = p_temp | |
endwhile | flag = 0 |
relres = resvec(iter-1) ./ resvec(1) |
if | ( | b_bot | = =0.0 |
) |
endif if | ( | isnumeric(m) | ) |
endif if | ( | isnumeric(a) | ) |
if | ( | ) |
id q | ( | ) | [virtual] |
resvec | ( | iter | ) |
endif resvec | ( | 1 | ) |
while | ( | resvec(iter-1) | ) |
b_bot = q' * s |
b_bot_old = 1 |
break |
p = m \ r |
p_temp = p |
q = feval (a, p, varargin{:}) |
q_temp = q |
else r = b - feval (a, x, varargin{:}) |
s_old = s |
else t = feval (a, s, varargin{:}) |
else x = x0 |