-
Notifications
You must be signed in to change notification settings - Fork 6
/
updateLPSWMmseVariables.m
34 lines (34 loc) · 1.02 KB
/
updateLPSWMmseVariables.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function [U, W, R, obj, Sv, pc] = updateLPSWMmseVariables(K, Q, M, I, N, H, S, V)
U = zeros(K * I * N, 1);
W = zeros(K * I, 1);
R = zeros(K * I, 1);
Sv = zeros(K * I, 1);
pc = 0;
for ik = 1 : K * I
rowOffset = (ik - 1) * N + 1 : ik * N;
hv = H(rowOffset, :) * V;
C = hv * hv' + eye(N);
localHv = H(rowOffset, :) * V(:, ik);
u = C \ localHv;
U((ik - 1) * N + 1 : ik * N, :) = u;
W(ik) = 1 / (1 - real(localHv' * u));
localHvvH = localHv * localHv';
Lc = C - localHvvH;
R(ik) = log2(real(det(eye(N) + localHvvH / Lc)));
end
obj = sum(R);
for ik = find(R ~= 0)'
u = U((ik - 1) * N + 1 : ik * N, 1);
Sik = S(ik, S(ik, :) ~= 0);
for ql = Sik
rowOffset = (ql - 1) * M + 1 : ql * M;
v = V(rowOffset, ik);
if norm(v) > 1e-6
Sv(ik) = Sv(ik) + 1;
end
end
end
for ik = 1 : K * I
pc = pc + norm(V(:, ik), 2)^2;
end
return