Functions | |
endif | if (nargin< 5||isempty(m1)) exist_m1=0 |
if (nargout > 5) T | |
if (isnumeric(a)) r | |
endif | resvec (1, 1) |
while (resvec(iter-1, 1) > tol *resvec(1, 1)&&iter< maxit) if(exist_m1) if(isnumeric(m1)) y | |
endif | if (exist_m2) if(isnumeric(m2)) z |
resvec (iter-1, 2) | |
if (alpha<=0.0) matrix_positive_definite | |
id | w () |
if(nargout > 5 &&iter > 2) T(iter-1 | sqrt (beta) beta]./oldalpha |
endif | resvec (iter, 1) |
warning ("pcg: eigenvalue estimate failed: iteration converged too fast.") | |
endif | if (exist_m1) if(isnumeric(m1)) y |
if (iter >=maxit-2) flag | |
Variables | |
function [x, flag, relres, iter, resvec, eigest] | |
else | x = x0 |
else | exist_m1 = 1 |
else | exist_m2 = 1 |
endif | preconditioned_residual_out = false |
endif | matrix_positive_definite = true |
p = zeros (size (b)) | |
oldtau = 1 | |
else | r = b - feval (a, x, varargin{:}) |
alpha = 1 | |
iter = 2 | |
else | y = feval (m1, r, varargin{:}) |
else | z = feval (m2, y, varargin{:}) |
endif | tau = z' * r |
beta = tau / oldtau | |
else | w = feval (a, p, varargin{:}) |
endif | oldalpha = alpha |
l = eig (T) | |
eigest = [min(l), max(l)] | |
else | resvec = resvec(:,1) |
endif | flag = 0 |
relres = resvec (iter-1,1) ./ resvec(1,1) |
if | ( | alpha<=0. | 0 | ) |
if | ( | isnumeric(a) | ) |
if | ( | nargout | , | |
5 | ||||
) |
endif if | ( | ) | [pure virtual] |
resvec | ( | iter- | 1, | |
2 | ||||
) |
endif resvec | ( | 1 | , | |
1 | ||||
) |
id w | ( | ) | [virtual] |
warning | ( | "pcg: eigenvalue estimate failed: iteration converged too fast." | ) |
while | ( | resvec(iter-1, 1) | ) |
alpha = 1 |
iter = 2 |
endif matrix_positive_definite = true |
oldtau = 1 |
p = zeros (size (b)) |
preconditioned_residual_out = false |
else r = b - feval (a, x, varargin{:}) |
endif resvec = resvec(:,1) |
else w = feval (a, p, varargin{:}) |
else x = x0 |