12 lines
308 B
Matlab
12 lines
308 B
Matlab
function [x, lambda] = uzawa(G, c, A, b, x, lambda, tol, max_itr)
|
|
w = 1;
|
|
old_x = ones(size(G, 1)) * 124000000;
|
|
i = 0;
|
|
|
|
while i < max_itr && norm(x - old_x) > tol
|
|
old_x = x;
|
|
x = G \ (c - (A' * lambda));
|
|
lambda = lambda + w * (A * x - b);
|
|
i = i + 1;
|
|
end
|
|
end
|