Correct evaluation of residuals in dynare_solve.m when exitflag does not clearly indicate solution

Otherwise, it crashes with bytecode
time-shift
Johannes Pfeifer 2016-05-05 10:46:39 +02:00
parent c6f705a8b9
commit 465f55bb0e
1 changed files with 4 additions and 3 deletions

View File

@ -116,9 +116,10 @@ if options.solve_algo == 0
if exitval == 1
info = 0;
elseif exitval > 1
M=evalin('base','M_'); %get variable names from workspace
resid = evaluate_static_model(x,varargin{:},M,options);
if max(abs(resid)) > 1e-6
func2 = str2func(func);
func = @(x) func2(x, varargin{:});
fvec = feval(func,x);
if max(abs(fvec)) >= tolf
info = 1;
else
info = 0;