Skip to content
Snippets Groups Projects
Commit f336a68e authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Update tests for values of solve_algo and stack_solve_algo

parent a2367e9e
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,22 @@ function simul ...@@ -31,6 +31,22 @@ function simul
global M_ options_ oo_ global M_ options_ oo_
if options_.stack_solve_algo < 0 || options_.stack_solve_algo > 5
error('SIMUL: stack_solve_algo must be between 0 and 5')
end
if ~options_.block && ~options_.bytecode && options_.stack_solve_algo ~= 0
error('SIMUL: you must use stack_solve_algo=0 when not using block nor bytecode option')
end
if options_.block && ~options_.bytecode && options_.stack_solve_algo == 5
error('SIMUL: you can''t use stack_solve_algo = 5 without bytecode option')
end
if exist('OCTAVE_VERSION') && options_.stack_solve_algo == 2
error('SIMUL: you can''t use stack_solve_algo = 2 under Octave')
end
if size(M_.lead_lag_incidence,2)-nnz(M_.lead_lag_incidence(M_.maximum_endo_lag+1,:)) > 0 if size(M_.lead_lag_incidence,2)-nnz(M_.lead_lag_incidence(M_.maximum_endo_lag+1,:)) > 0
mess = ['SIMUL: error in model specification : variable ' M_.endo_names(find(M_.lead_lag_incidence(M_.maximum_lag+1,:)==0),:)] ; mess = ['SIMUL: error in model specification : variable ' M_.endo_names(find(M_.lead_lag_incidence(M_.maximum_lag+1,:)==0),:)] ;
mess = [mess ' doesn''t appear as current variable.'] ; mess = [mess ' doesn''t appear as current variable.'] ;
...@@ -57,20 +73,6 @@ end ...@@ -57,20 +73,6 @@ end
options_.scalv= 1 ; options_.scalv= 1 ;
if ~options_.block && ~options_.bytecode && options_.stack_solve_algo ~= 0
error('SIMUL: for the moment, you must use stack_solve_algo=0 when not using block nor bytecode option')
end
if options_.block && ~options_.bytecode && (options_.stack_solve_algo == 5)
error('SIMUL: for the moment, you must use stack_solve_algo={1,2,3,4} when using block without bytecode option')
end
if options_.bytecode && (options_.stack_solve_algo ~= 0 && options_.stack_solve_algo ~= 1 && options_.stack_solve_algo ~= 2 && options_.stack_solve_algo ~= 3 && options_.stack_solve_algo ~= 4 && options_.stack_solve_algo ~= 5)
error('SIMUL: for the moment, you must use stack_solve_algo= 1, 2, 3, 4 or 5 with bytecode option')
end
if exist('OCTAVE_VERSION') && options_.stack_solve_algo == 2
error('SIMUL: stack_solve_algo=2 is not available for Octave. Choose another value.')
end
if(options_.block) if(options_.block)
if(options_.bytecode) if(options_.bytecode)
[info, oo_.endo_simul] = bytecode('dynamic'); [info, oo_.endo_simul] = bytecode('dynamic');
......
...@@ -11,7 +11,7 @@ function steady_() ...@@ -11,7 +11,7 @@ function steady_()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2001-2009 Dynare Team % Copyright (C) 2001-2010 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -27,14 +27,19 @@ function steady_() ...@@ -27,14 +27,19 @@ function steady_()
% %
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ oo_ it_ options_
if options_.bytecode && ... global M_ oo_ options_
(options_.solve_algo < 0 || options_.solve_algo > 8)
error('STEADY: for the moment, you must use solve_algo=1, 2, 3, 4, 5, 6, 7, 8 with bytecode option') if options_.solve_algo < 0 || options_.solve_algo > 8
error('STEADY: solve_algo must be between 0 and 8')
end
if ~options_.bytecode && ~options_.block && options_.solve_algo > 4
error('STEADY: you can''t use solve_algo > 4 without block nor bytecode options')
end end
if ~options_.bytecode && options_.solve_algo == 8
error('STEADY: you can''t yet use solve_algo=8 without bytecode option') if ~options_.bytecode && options_.block && options_.solve_algo == 5
error('STEADY: you can''t use solve_algo = 5 without bytecode option')
end end
if options_.steadystate_flag if options_.steadystate_flag
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment