Commit b6636fc7 authored by ferhat's avatar ferhat
Browse files

modifications in sparse options to support the new variable indexation

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2458 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 43d3aebb
......@@ -100,6 +100,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
periods=int(floor(*(mxGetPr(mxGetFieldByNumber(options_, 0, mxGetFieldNumber(options_,"periods"))))));
maxit_=int(floor(*(mxGetPr(mxGetFieldByNumber(options_, 0, mxGetFieldNumber(options_,"maxit_"))))));
slowc=double(*(mxGetPr(mxGetFieldByNumber(options_, 0, mxGetFieldNumber(options_,"slowc")))));
mexPrintf("slowc=%f\n",slowc);
slowc_save=slowc;
markowitz_c=double(*(mxGetPr(mxGetFieldByNumber(options_, 0, mxGetFieldNumber(options_,"markowitz")))));
nb_row_xd=int(floor(*(mxGetPr(mxGetFieldByNumber(M_, 0, mxGetFieldNumber(M_,"exo_det_nbr"))))));
......
......@@ -441,10 +441,11 @@ VariableNode::compile(ofstream &CompileCode, bool lhs_rhs, ExprNodeOutputType ou
CompileCode.write(&FSTPV, sizeof(FSTPV));
char typel=(char)type;
CompileCode.write(&typel, sizeof(typel));
int tsid = datatree.symbol_table.getTypeSpecificID(symb_id);
switch(type)
{
case eParameter:
i = symb_id + OFFSET(output_type);
i = tsid + OFFSET(output_type);
CompileCode.write(reinterpret_cast<char *>(&i), sizeof(i));
#ifdef DEBUGC
cout << "FLD Param[ " << i << ", symb_id=" << symb_id << "]\n";
......@@ -452,18 +453,20 @@ VariableNode::compile(ofstream &CompileCode, bool lhs_rhs, ExprNodeOutputType ou
break;
case eEndogenous :
i = symb_id + OFFSET(output_type);
printf("endogenous i=%d\n",i);
CompileCode.write(reinterpret_cast<char *>(&i), sizeof(i));
lagl=lag;
CompileCode.write(reinterpret_cast<char *>(&lagl), sizeof(lagl));
break;
case eExogenous :
i = symb_id + OFFSET(output_type);
i = tsid + OFFSET(output_type);
printf("exogenous i=%d\n",i);
CompileCode.write(reinterpret_cast<char *>(&i), sizeof(i));
lagl=lag;
CompileCode.write(reinterpret_cast<char *>(&lagl), sizeof(lagl));
break;
case eExogenousDet:
i = symb_id + datatree.symbol_table.exo_nbr() + OFFSET(output_type);
i = tsid + datatree.symbol_table.exo_nbr() + OFFSET(output_type);
CompileCode.write(reinterpret_cast<char *>(&i), sizeof(i));
lagl=lag;
CompileCode.write(reinterpret_cast<char *>(&lagl), sizeof(lagl));
......
This diff is collapsed.
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