LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
Q_Sylvest.m
1function X=Q_Sylvest(U,T,B)
2% X=Q_Sylvest(U,T,B) solves the equation X*kron(A,I)+BX=-I
3% using a Hessenberg decomposition with kron(A,I)=U'*T*U
4
5[V,NBAR]=hess(B);
6%V'*B*V = NBAR
7
8F=-V'*U;
9
10n=size(F,2);
11
12Y=[];
13tempmat=zeros(n,n-1);
14for k=1:n
15 if (k==1)
16 temp=F(:,k);
17 else
18 temp=F(:,k)-Y(:,1:k-1)*T(1:k-1,k);
19 end
20 Y(:,k)=(NBAR+eye(n)*T(k,k))\temp;
21 % MATLAB checks that NBAR+T(k,k)*LBAR is an hessenberg
22 % matrix and quickly reduces it to a triangular one which is
23 % solved by backward substitution (TEST 6)
24end
25X=real(V*Y*U');