LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MG1_RR_Btemp.m
1% This script multiplies B with temp, i.e., B*temp without
2% storing B (only b, r1, r2, c1 and c2).
3% recall B = L(b) + L(c1)L(Zr1)' + L(c2)L(Zr2)'
4
5hd=size(temp,2);
6
7% we start with L(Zr1)'*temp
8temp1b=r1(1:(N-1)*m,:)';
9temp1((N-1)*m+1:N*m,1:hd)=zeros(m,hd);
10for lus1=1:N-1
11 temp1((lus1-1)*m+1:lus1*m,1:hd)=temp1b(:,1:(N-lus1)*m)*temp(lus1*m+1:end,1:hd);
12end
13% we now obtain L(c1)*(L(Zr1)'*temp)
14for lus1=1:N
15 temp1b(1:m,(lus1-1)*m+1:lus1*m)=c1((N-lus1)*m+1:(N-lus1+1)*m,:);
16end
17for lus1=1:N
18 temp2((lus1-1)*m+1:lus1*m,1:hd)=temp1b(:,(N-lus1)*m+1:end)*...
19 temp1(1:lus1*m,:);
20end
21clear temp1;
22clear temp1b;
23% we continue with L(Zr2)'*temp
24temp1b=r2(1:(N-1)*m,:)';
25temp1((N-1)*m+1:N*m,1:hd)=zeros(m,hd);
26for lus1=1:N-1
27 temp1((lus1-1)*m+1:lus1*m,1:hd)=temp1b(:,1:(N-lus1)*m)*temp(lus1*m+1:end,1:hd);
28end
29% next we store (L(c1)*L(Zr1)'+L(c2)*L(Zr2)')*temp in temp2.
30for lus1=1:N
31 temp1b(1:m,(lus1-1)*m+1:lus1*m)=c2((N-lus1)*m+1:(N-lus1+1)*m,:);
32end
33for lus1=1:N
34 temp2((lus1-1)*m+1:lus1*m,1:hd)=temp2((lus1-1)*m+1:lus1*m,1:hd)+...
35 temp1b(:,(N-lus1)*m+1:end)*temp1(1:lus1*m,:);
36end
37% finally we add L(b)*temp to temp2
38for lus1=1:N
39 temp1b(1:m,(lus1-1)*m+1:lus1*m)=b((N-lus1)*m+1:(N-lus1+1)*m,:);
40end
41for lus1=1:N
42 temp2((lus1-1)*m+1:lus1*m,1:hd)=temp2((lus1-1)*m+1:lus1*m,1:hd)+...
43 temp1b(:,(N-lus1)*m+1:end)*temp(1:lus1*m,:);
44end
45temp=temp2;
46clear temp1;
47clear temp2;
48clear temp1b;