trunk: fixed bug with USE_DLL and second order (Hessian matrix was not sparse)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2572 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
695a638f09
commit
c00e5ac992
|
@ -543,7 +543,6 @@ function [dr,info,M_,options_,oo_] = dr1(dr,task,M_,options_,oo_)
|
||||||
zx=[zx; zeros(M_.exo_nbr,np);zeros(M_.exo_det_nbr,np)];
|
zx=[zx; zeros(M_.exo_nbr,np);zeros(M_.exo_det_nbr,np)];
|
||||||
zu=[zu; eye(M_.exo_nbr);zeros(M_.exo_det_nbr,M_.exo_nbr)];
|
zu=[zu; eye(M_.exo_nbr);zeros(M_.exo_det_nbr,M_.exo_nbr)];
|
||||||
[nrzx,nczx] = size(zx);
|
[nrzx,nczx] = size(zx);
|
||||||
hessian = sparse(hessian);
|
|
||||||
rhs = -sparse_hessian_times_B_kronecker_C(hessian,zx);
|
rhs = -sparse_hessian_times_B_kronecker_C(hessian,zx);
|
||||||
|
|
||||||
%lhs
|
%lhs
|
||||||
|
|
|
@ -1657,8 +1657,10 @@ ModelTree::writeDynamicCFile(const string &dynamic_basename) const
|
||||||
<< " g2 = NULL;" << endl
|
<< " g2 = NULL;" << endl
|
||||||
<< " if (nlhs >= 3)" << endl
|
<< " if (nlhs >= 3)" << endl
|
||||||
<< " {" << endl
|
<< " {" << endl
|
||||||
<< " /* Set the output pointer to the output matrix g2. */" << endl
|
<< " /* Set the output pointer to the output matrix g2. */" << endl;
|
||||||
<< " plhs[2] = mxCreateDoubleMatrix(" << equations.size() << ", " << variable_table.getDynJacobianColsNbr(computeJacobianExo)*variable_table.getDynJacobianColsNbr(computeJacobianExo) << ", mxREAL);" << endl
|
int g2_ncols = variable_table.getDynJacobianColsNbr(computeJacobianExo)*variable_table.getDynJacobianColsNbr(computeJacobianExo);
|
||||||
|
mDynamicModelFile << " plhs[2] = mxCreateSparse(" << equations.size() << ", " << g2_ncols << ", "
|
||||||
|
<< 5*g2_ncols << ", mxREAL);" << endl
|
||||||
<< " /* Create a C pointer to a copy of the output matrix g1. */" << endl
|
<< " /* Create a C pointer to a copy of the output matrix g1. */" << endl
|
||||||
<< " g2 = mxGetPr(plhs[2]);" << endl
|
<< " g2 = mxGetPr(plhs[2]);" << endl
|
||||||
<< " }" << endl
|
<< " }" << endl
|
||||||
|
|
Loading…
Reference in New Issue