LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
computeT_NARE.m
1function T2 = computeT_NARE(D0, D1, S, A_jump)
2tic
3m = size(S,1);
4ma = size(D0,1);
5ms = m/ma;
6
7H = [kron(eye(ms),D0) kron(eye(ms), D1);
8 -kron(A_jump,eye(ma)) -S];
9
10% H = [kron(eye(ms),D0) kron(eye(ms), D1);
11% -kron(A_jump,eye(ma)) -S];
12
13%n = size(A,1);
14%m = size(D,1);
15%H = [A,-B;-C,-D];
16% H = full(H);
17
18[U,Q] = schur(H,'real');
19time_Schur = toc;
20e = ordeig(Q); % Eigenvalues of quasitriangular matrices
21%[es,is] = sort(real(e), 'descend');
22[es,is] = sort(real(e), 'ascend');
23sel = zeros(2*m,1);
24sel(is(1:m)) = 1;
25Q1 = ordschur(U,Q,sel); % Sorting the Schur form of H
26timeOrdSchur = toc;
27timeOrdSchur = timeOrdSchur-time_Schur;
28X = Q1(m+1:2*m,1:m)/Q1(1:m,1:m); % \bar{L}
29
30T2 = S + X*kron(eye(ms), D1);
31e2 = toc;
32
33
34res_norm=norm(T2*X+X*kron(eye(ms),D0)+kron(A_jump,eye(ma)),inf)
35fprintf('Final Residual Error for T matrix: %d\n',res_norm);