Commit bca53aa6 authored by p.jhagema's avatar p.jhagema
Browse files

iterativel phase retrieval: changed default error value to inf

parent 845fbaaa
Pipeline #265403 passed with stage
in 51 seconds
......@@ -75,7 +75,7 @@ methods
function [x, residual] = eval(obj, x, ~)
% This projector does not compute any residuals
residual = 0;
residual = Inf;
% Special case 1: no minimum- or maximum-constraints are imposed, evaluation is trivial
if obj.settings.maxAmplitude == inf && obj.settings.minAmplitude <= 0
......
......@@ -80,7 +80,7 @@ methods
function [x, residual] = eval(obj, x, ~)
% This projector does not compute any residuals
residual = 0;
residual = Inf;
% If no minimum- or maximum-constraints are imposed, evaluation is trivial
if obj.settings.maxPhase == inf && obj.settings.minPhase == -inf
......
......@@ -55,7 +55,7 @@ classdef PSupport < Projector
function [x, error] = eval(obj, x, ~)
x = x .* obj.supp + obj.valueOutsideSupp .* (1 - obj.supp);
error = 0;
error = Inf;
end
end % methods
end
......
......@@ -17,8 +17,11 @@ classdef ProjectorComposition < Projector
end %end constructor
function [result, error] = eval(obj, x, itNum)
result = obj.proj2.eval(obj.proj1.eval(x, itNum), itNum);
error = 0;
[result, err1] = obj.proj1.eval(x, itNum);
[result, err2] = obj.proj2.eval(result, itNum);
% The default value for errors should be Inf, so we avoid
% accidential triggering of the abortion automatic.
error = min(err1, err2);
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment