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)'
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);
11 temp1((lus1-1)*m+1:lus1*m,1:hd)=temp1b(:,1:(N-lus1)*m)*temp(lus1*m+1:end,1:hd);
13% we now obtain L(c1)*(L(Zr1)
'*temp)
15 temp1b(1:m,(lus1-1)*m+1:lus1*m)=c1((N-lus1)*m+1:(N-lus1+1)*m,:);
18 temp2((lus1-1)*m+1:lus1*m,1:hd)=temp1b(:,(N-lus1)*m+1:end)*...
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);
27 temp1((lus1-1)*m+1:lus1*m,1:hd)=temp1b(:,1:(N-lus1)*m)*temp(lus1*m+1:end,1:hd);
29% next we store (L(c1)*L(Zr1)'+L(c2)*L(Zr2)
')*temp in temp2.
31 temp1b(1:m,(lus1-1)*m+1:lus1*m)=c2((N-lus1)*m+1:(N-lus1+1)*m,:);
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,:);
37% finally we add L(b)*temp to temp2
39 temp1b(1:m,(lus1-1)*m+1:lus1*m)=b((N-lus1)*m+1:(N-lus1+1)*m,:);
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,:);