Account for Octave's dbstack providing full path, not just filename
parent
fccd164926
commit
fdbb44fec6
|
@ -40,13 +40,19 @@ jacobian_flag = options.jacobian_flag;
|
||||||
|
|
||||||
% Set tolerance parameter depending the the caller function.
|
% Set tolerance parameter depending the the caller function.
|
||||||
stack = dbstack;
|
stack = dbstack;
|
||||||
if strcmp(stack(2).file,'simulation_core.m') || strcmp(stack(2).file,'solve_stacked_problem.m')
|
if isoctave
|
||||||
|
[pathstr,name,ext]=fileparts(stack(2).file);
|
||||||
|
caller_file_name=[name,ext];
|
||||||
|
else
|
||||||
|
caller_file_name=stack(2).file;
|
||||||
|
end
|
||||||
|
if strcmp(caller_file_name,'simulation_core.m') || strcmp(caller_file_name,'solve_stacked_problem.m')
|
||||||
tolf = options.dynatol.f;
|
tolf = options.dynatol.f;
|
||||||
else
|
else
|
||||||
tolf = options.solve_tolf;
|
tolf = options.solve_tolf;
|
||||||
end
|
end
|
||||||
|
|
||||||
if strcmp(stack(2).file,'dyn_ramsey_static.m')
|
if strcmp(caller_file_name,'dyn_ramsey_static.m')
|
||||||
maxit = options.ramsey.maxit;
|
maxit = options.ramsey.maxit;
|
||||||
else
|
else
|
||||||
maxit = options.steady.maxit;
|
maxit = options.steady.maxit;
|
||||||
|
|
Loading…
Reference in New Issue