Correct evaluation of residuals in dynare_solve.m when exitflag does not clearly indicate solution
Otherwise, it crashes with bytecodetime-shift
parent
c6f705a8b9
commit
465f55bb0e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue