19 lines
279 B
Mathematica
19 lines
279 B
Mathematica
function f = kaczmarz(f, p, W)
|
|
|
|
n_mesures = size(p, 1);
|
|
|
|
W = W';
|
|
norm_W = sum(W.^2, 1);
|
|
|
|
for i = 1:n_mesures
|
|
|
|
Wi = W(:,i)';
|
|
norm_Wi = norm_W(i);
|
|
|
|
if norm_Wi > 0
|
|
f = f + (p(i) - Wi * f) / norm_Wi * Wi';
|
|
end
|
|
end
|
|
end
|
|
|