Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/pd_gmres.m
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@

tic(); % start measuring CPU time

while flag == 0
%while flag == 0
while restart <= maxit

% Control block
if iter(size(iter, 1), :) ~= 1
Expand Down Expand Up @@ -345,18 +346,21 @@
relresvec(size(relresvec, 1) + 1, :) = res(restart + 1, :) / res(1, 1);

% Check convergence
if relresvec(end) < tol || size(relresvec, 1) == maxit
%if relresvec(end) < tol || size(relresvec, 1) == maxit
if relresvec(end) < tol
% We reached convergence.
flag = 1;
x = xm;
time = toc();
return
else
% We have not reached convergence. Update and restart.
xInitial = xm;
restart = restart + 1;
end

end

x=xm;
time = toc();

end