Commit 695a638f authored by sebastien's avatar sebastien
Browse files

trunk: fixed bug with USE_DLL (stoch_simul was calling stoch_simul_sparse,...

trunk: fixed bug with USE_DLL (stoch_simul was calling stoch_simul_sparse, because of wrong handling of options_.model_mode)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2571 ac1d8469-bf42-47a9-8791-bf33cf982152
parent aa843c73
......@@ -30,7 +30,7 @@ function [dr,info,M_,options_,oo_] = dr1_sparse(dr,task,M_,options_,oo_)
% none.
%
% Copyright (C) 1996-2008 Dynare Team
% Copyright (C) 1996-2009 Dynare Team
%
% This file is part of Dynare.
%
......@@ -190,7 +190,7 @@ function [dr,info,M_,options_,oo_] = dr1_sparse(dr,task,M_,options_,oo_)
it_ = M_.maximum_lag + 1;
z = repmat(dr.ys,1,klen);
z = z(iyr0) ;
if options_.model_mode==0
if options_.model_mode==0 || options_.model_mode == 2
if options_.order == 1
[junk,jacobia_] = feval([M_.fname '_dynamic'],z,[oo_.exo_simul ...
oo_.exo_det_simul], M_.params, it_);
......
......@@ -11,7 +11,7 @@ function resid(period)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2001-2008 Dynare Team
% Copyright (C) 2001-2009 Dynare Team
%
% This file is part of Dynare.
%
......@@ -49,18 +49,18 @@ function resid(period)
y =oo_.endo_simul(:);
z = zeros(n,period);
fh = str2func([M_.fname '_dynamic']);
if(options_.model_mode)
if(options_.model_mode == 1 || options_.model_mode == 3)
addpath(M_.fname);
end;
for it_=M_.maximum_lag+1:period+M_.maximum_lag
if(options_.model_mode)
if(options_.model_mode == 1 || options_.model_mode == 3)
z(:,it_-M_.maximum_lag) = feval(fh,oo_.endo_simul',oo_.exo_simul, M_.params, it_);
else
z(:,it_-M_.maximum_lag) = feval(fh,y(iyr0),oo_.exo_simul, M_.params, it_);
iyr0 = iyr0 + n;
end;
end
if(options_.model_mode)
if(options_.model_mode == 1 || options_.model_mode == 3)
rmpath(M_.fname);
end;
% disp([[1:period]' z']);
......
......@@ -169,7 +169,7 @@ StochSimulStatement::writeOutput(ostream &output, const string &basename) const
{
options_list.writeOutput(output);
symbol_list.writeOutput("var_list_", output);
output << "if(options_.model_mode)\n";
output << "if (options_.model_mode == 1 || options_.model_mode == 3)\n";
output << " info = stoch_simul_sparse(var_list_);\n";
output << "else\n";
output << " info = stoch_simul(var_list_);\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment