Skip to content
Snippets Groups Projects
Commit 80157985 authored by MichelJuillard's avatar MichelJuillard Committed by GitHub
Browse files

Merge pull request #1333 from JohannesPfeifer/octave_unit_test

Two fixes related to Octave unit test
parents 6e93b1ec fdbb44fe
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ end ...@@ -206,7 +206,7 @@ end
%$ %$
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadv(density, .0000000001, 100000); %$ s = quadv(density, .0000000001, 100000,1e-10);
%$ else %$ else
%$ s = integral(density, 0, 100000); %$ s = integral(density, 0, 100000);
%$ end %$ end
...@@ -229,7 +229,7 @@ end ...@@ -229,7 +229,7 @@ end
%$ %$
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadv(density, .0000000001, 100000); %$ s = quadv(density, .0000000001, 100000,1e-10);
%$ else %$ else
%$ s = integral(density, 0, 100000); %$ s = integral(density, 0, 100000);
%$ end %$ end
...@@ -252,7 +252,7 @@ end ...@@ -252,7 +252,7 @@ end
%$ %$
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadv(density, .0000000001, 100000); %$ s = quadv(density, .0000000001, 100000,1e-10)
%$ else %$ else
%$ s = integral(density, 0, 100000); %$ s = integral(density, 0, 100000);
%$ end %$ end
...@@ -275,7 +275,7 @@ end ...@@ -275,7 +275,7 @@ end
%$ %$
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadv(xdens, .0000000001, 100000); %$ s = quadv(xdens, .0000000001, 100000,1e-10)
%$ else %$ else
%$ s = integral(xdens, 0, 100000); %$ s = integral(xdens, 0, 100000);
%$ end %$ end
...@@ -298,7 +298,7 @@ end ...@@ -298,7 +298,7 @@ end
%$ %$
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadv(xdens, .0000000001, 100000); %$ s = quadv(xdens, .0000000001, 100000,1e-10)
%$ else %$ else
%$ s = integral(xdens, 0, 100000); %$ s = integral(xdens, 0, 100000);
%$ end %$ end
...@@ -321,7 +321,7 @@ end ...@@ -321,7 +321,7 @@ end
%$ %$
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadv(xdens, .0000000001, 100000); %$ s = quadv(xdens, .0000000001, 100000,1e-10)
%$ else %$ else
%$ s = integral(xdens, 0, 100000); %$ s = integral(xdens, 0, 100000);
%$ end %$ end
...@@ -347,7 +347,7 @@ end ...@@ -347,7 +347,7 @@ end
%$ s = NaN(n, 1); %$ s = NaN(n, 1);
%$ for i=1:n %$ for i=1:n
%$ if isoctave() %$ if isoctave()
%$ s(i) = quadv(density, .0000000001, .1*i); %$ s(i) = quadv(density, .0000000001, .1*i,1e-10)
%$ else %$ else
%$ s(i) = integral(density, 0, .1*i); %$ s(i) = integral(density, 0, .1*i);
%$ end %$ end
...@@ -378,7 +378,7 @@ end ...@@ -378,7 +378,7 @@ end
%$ s = NaN(n, 1); %$ s = NaN(n, 1);
%$ for i=1:n %$ for i=1:n
%$ if isoctave() %$ if isoctave()
%$ s(i) = quadv(density, .0000000001, .1*i); %$ s(i) = quadv(density, .0000000001, .1*i,1e-10)
%$ else %$ else
%$ s(i) = integral(density, 0, .1*i); %$ s(i) = integral(density, 0, .1*i);
%$ end %$ end
...@@ -409,7 +409,7 @@ end ...@@ -409,7 +409,7 @@ end
%$ s = NaN(n, 1); %$ s = NaN(n, 1);
%$ for i=1:n %$ for i=1:n
%$ if isoctave() %$ if isoctave()
%$ s(i) = quadv(density, .0000000001, .1*i); %$ s(i) = quadv(density, .0000000001, .1*i,1e-10)
%$ else %$ else
%$ s(i) = integral(density, 0, .1*i); %$ s(i) = integral(density, 0, .1*i);
%$ end %$ end
... ...
......
...@@ -40,13 +40,19 @@ jacobian_flag = options.jacobian_flag; ...@@ -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;
... ...
......
...@@ -148,7 +148,7 @@ t = exp(log(scale)+log(-log(1-proba))/shape); ...@@ -148,7 +148,7 @@ t = exp(log(scale)+log(-log(1-proba))/shape);
%$ [shape, scale, x(k-1)] %$ [shape, scale, x(k-1)]
%$ end %$ end
%$ if isoctave %$ if isoctave
%$ s = quadv(density, 0, x(k-1)); %$ s = quadv(density, 0, x(k-1),1e-10);
%$ else %$ else
%$ s = integral(density, 0, x(k-1)); %$ s = integral(density, 0, x(k-1));
%$ end %$ end
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment