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.
|
||||
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;
|
||||
else
|
||||
tolf = options.solve_tolf;
|
||||
end
|
||||
|
||||
if strcmp(stack(2).file,'dyn_ramsey_static.m')
|
||||
if strcmp(caller_file_name,'dyn_ramsey_static.m')
|
||||
maxit = options.ramsey.maxit;
|
||||
else
|
||||
maxit = options.steady.maxit;
|
||||
|
|
Loading…
Reference in New Issue