From c8ac7007f00d5dce45b8155e12504c922e10dd24 Mon Sep 17 00:00:00 2001 From: Michel Juillard Date: Tue, 14 Oct 2014 10:25:07 +0200 Subject: [PATCH] fixing bug in test case of standalone c++ --- others/cpp/tests/test1.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/others/cpp/tests/test1.cc b/others/cpp/tests/test1.cc index 0e72ee74d..9e2c1304d 100644 --- a/others/cpp/tests/test1.cc +++ b/others/cpp/tests/test1.cc @@ -32,20 +32,29 @@ main(int argc, char **argv) int nback = zeta_back.size(); int nmixed = zeta_mixed.size(); int nstatic = zeta_static.size(); + int sdyn = nfwrd + nback + 2*nmixed; - int jacob_cols = zeta_back.size()+zeta_fwrd.size()+zeta_mixed.size()+exo_nbr; + int jacob_cols = sdyn + endo_nbr + exo_nbr; double *exo_steady_state = new double[exo_nbr]; double *jacob_data = new double[endo_nbr*jacob_cols]; + std::cout << endo_nbr << " " << jacob_cols << endl; + FirstDerivatives(steady_state, exo_steady_state, 0, params, steady_state, 1, NULL, jacob_data, NULL, NULL); + std::cout << "g1[44] = " << jacob_data[44] << endl; + DecisionRules dr(endo_nbr, exo_nbr, zeta_fwrd, zeta_back, zeta_mixed, zeta_static, qz_criterium); - int sdyn = nfwrd + nback + 2*nmixed; + std::cout << "g1[44] = " << jacob_data[44] << endl; + int jacobian_col_nbr = sdyn + endo_nbr + exo_nbr; + std::cout << "g1[44] = " << jacob_data[44] << endl; MatrixView jacob_tmp(jacob_data, endo_nbr, jacobian_col_nbr, endo_nbr); + std::cout << "g1[44] = " << jacob_data[44] << endl; + std::cout << "jacob_tmp(2,7) = "<< jacob_tmp(2,7) << endl; Matrix jacobian(endo_nbr, jacobian_col_nbr), g_y(endo_nbr, nback+nmixed), g_u(endo_nbr, exo_nbr); jacobian = jacob_tmp;