From e44d90adc1708d53c926a24363d3d03234acffb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Hermes=29?= <stephane.adjemian@univ-lemans.fr> Date: Thu, 19 May 2016 19:57:53 +0200 Subject: [PATCH] Fixed type issues. params, exo_steady_state and steady_state are vectors not matrices! --- julia/DynareModel.jl | 4 ++-- julia/DynareOutput.jl | 8 ++++---- preprocessor/DynamicModel.cc | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/julia/DynareModel.jl b/julia/DynareModel.jl index cba72b0362..a85442c9d2 100644 --- a/julia/DynareModel.jl +++ b/julia/DynareModel.jl @@ -119,7 +119,7 @@ type Model h::Matrix{Float64} correlation_matrix_me::Matrix{Float64} sigma_e_is_diagonal::Bool - params::Matrix{Float64} + params::Vector{Float64} static::Function static_params_derivs::Function dynamic::Function @@ -168,7 +168,7 @@ function dynare_model() Array(Float64, 0, 0), # h (Cov matrix of the measurement errors) Array(Float64, 0, 0), # correlation_matrix_me (Cov matrix of the measurement errors) true, # sigma_e_is_diagonal - Array(Float64, 0, 0), # params + Array(Float64, 0), # params function()end, # static function()end, # static_params_derivs function()end, # dynamic diff --git a/julia/DynareOutput.jl b/julia/DynareOutput.jl index f8aea529d7..81a4132f75 100644 --- a/julia/DynareOutput.jl +++ b/julia/DynareOutput.jl @@ -23,14 +23,14 @@ export dynare_output type Output dynare_version::ASCIIString - steady_state::Matrix{Float64} - exo_steady_state::Matrix{Float64} + steady_state::Vector{Float64} + exo_steady_state::Vector{Float64} end function dynare_output() return Output("", # dynare_version - Array(Float64, 0, 0), # steady_state - Array(Float64, 0, 0) # exo_steady_state + Array(Float64, 0), # steady_state + Array(Float64, 0) # exo_steady_state ) end diff --git a/preprocessor/DynamicModel.cc b/preprocessor/DynamicModel.cc index ba3140adff..ccebb9ec97 100644 --- a/preprocessor/DynamicModel.cc +++ b/preprocessor/DynamicModel.cc @@ -3052,21 +3052,21 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de output << modstruct << "maximum_endo_lag = " << max_endo_lag << ";" << endl << modstruct << "maximum_endo_lead = " << max_endo_lead << ";" << endl - << outstruct << "steady_state = zeros(" << symbol_table.endo_nbr() << ", 1);" << endl; + << outstruct << "steady_state = zeros(" << symbol_table.endo_nbr() << (julia ? ")" : ", 1);" ) << endl; output << modstruct << "maximum_exo_lag = " << max_exo_lag << ";" << endl << modstruct << "maximum_exo_lead = " << max_exo_lead << ";" << endl - << outstruct << "exo_steady_state = zeros(" << symbol_table.exo_nbr() << ", 1);" << endl; + << outstruct << "exo_steady_state = zeros(" << symbol_table.exo_nbr() << (julia ? ")" : ", 1);" ) << endl; if (symbol_table.exo_det_nbr()) { output << modstruct << "maximum_exo_det_lag = " << max_exo_det_lag << ";" << endl << modstruct << "maximum_exo_det_lead = " << max_exo_det_lead << ";" << endl - << outstruct << "exo_det_steady_state = zeros(" << symbol_table.exo_det_nbr() << ", 1);" << endl; + << outstruct << "exo_det_steady_state = zeros(" << symbol_table.exo_det_nbr() << (julia ? ")" : ", 1);" ) << endl; } output << modstruct << "params = " << (julia ? "fill(NaN, " : "NaN(") - << symbol_table.param_nbr() << ", 1);" << endl; + << symbol_table.param_nbr() << (julia ? ")" : ", 1);" ) << endl; if (compute_xrefs) writeXrefs(output); -- GitLab