Discretion: Added catch for infinities

Comment: A user provided a file in which the Sylvester equation solved using doubling can evaluate to inf. When Doubling fails, one can try the Hessenberg-Schur algorithm.
time-shift
Johannes Pfeifer 2018-01-31 22:23:02 +01:00 committed by Stéphane Adjemian (Charybdis)
parent b91fa10fa1
commit 3679afe849
1 changed files with 2 additions and 2 deletions

View File

@ -112,9 +112,9 @@ F1=F10;
while 1
iter=iter+1;
P=SylvesterDoubling(W+beta*F1'*Q*F1,beta*H1',H1,discretion_tol,solve_maxit);
if any(any(isnan(P)))
if any(any(isnan(P))) || any(any(isinf(P)))
P=SylvesterHessenbergSchur(W+beta*F1'*Q*F1,beta*H1',H1);
if any(any(isnan(P)))
if any(any(isnan(P))) || any(any(isinf(P)))
retcode=2;
return
end