* Fix the STEADY_STATE operator for LaTeX output
* Allow the STEADY_STATE operator to work with exogenous/exogenous_det with non zero lead/lag * Other cosmetic changes git-svn-id: https://www.dynare.org/svn/dynare/trunk@2917 ac1d8469-bf42-47a9-8791-bf33cf982152issue#70
parent
5591a412a8
commit
b3b67b0db5
29
ExprNode.cc
29
ExprNode.cc
|
@ -311,6 +311,8 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
|
|
||||||
if (IS_LATEX(output_type))
|
if (IS_LATEX(output_type))
|
||||||
{
|
{
|
||||||
|
if (output_type == oLatexDynamicSteadyStateOperator)
|
||||||
|
output << "\\bar{";
|
||||||
output << datatree.symbol_table.getTeXName(symb_id);
|
output << datatree.symbol_table.getTeXName(symb_id);
|
||||||
if (output_type == oLatexDynamicModel
|
if (output_type == oLatexDynamicModel
|
||||||
&& (type == eEndogenous || type == eExogenous || type == eExogenousDet || type == eModelLocalVariable))
|
&& (type == eEndogenous || type == eExogenous || type == eExogenousDet || type == eModelLocalVariable))
|
||||||
|
@ -324,6 +326,8 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
}
|
}
|
||||||
output << "}";
|
output << "}";
|
||||||
}
|
}
|
||||||
|
else if (output_type == oLatexDynamicSteadyStateOperator)
|
||||||
|
output << "}";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,11 +377,10 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
output << "y" << LEFT_ARRAY_SUBSCRIPT(output_type) << "it_, " << i << RIGHT_ARRAY_SUBSCRIPT(output_type);
|
output << "y" << LEFT_ARRAY_SUBSCRIPT(output_type) << "it_, " << i << RIGHT_ARRAY_SUBSCRIPT(output_type);
|
||||||
break;
|
break;
|
||||||
case oMatlabOutsideModel:
|
case oMatlabOutsideModel:
|
||||||
output << "oo_.steady_state" << "(" << tsid + 1 << ")";
|
output << "oo_.steady_state(" << tsid + 1 << ")";
|
||||||
break;
|
break;
|
||||||
case oLatexDynamicSteadyStateOperator:
|
|
||||||
case oMatlabDynamicSteadyStateOperator:
|
case oMatlabDynamicSteadyStateOperator:
|
||||||
output << "oo_.steady_state" << "(" << tsid + 1 << ")";
|
output << "oo_.steady_state(" << tsid + 1 << ")";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -411,12 +414,10 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
break;
|
break;
|
||||||
case oMatlabOutsideModel:
|
case oMatlabOutsideModel:
|
||||||
assert(lag == 0);
|
assert(lag == 0);
|
||||||
output << "oo_.exo_steady_state" << "(" << i << ")";
|
output << "oo_.exo_steady_state(" << i << ")";
|
||||||
break;
|
break;
|
||||||
case oLatexDynamicSteadyStateOperator:
|
|
||||||
case oMatlabDynamicSteadyStateOperator:
|
case oMatlabDynamicSteadyStateOperator:
|
||||||
assert(lag == 0);
|
output << "oo_.exo_steady_state(" << i << ")";
|
||||||
output << "oo_.exo_steady_state" << "(" << i << ")";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -450,12 +451,10 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
break;
|
break;
|
||||||
case oMatlabOutsideModel:
|
case oMatlabOutsideModel:
|
||||||
assert(lag == 0);
|
assert(lag == 0);
|
||||||
output << "oo_.exo_det_steady_state" << "(" << tsid + 1 << ")";
|
output << "oo_.exo_det_steady_state(" << tsid + 1 << ")";
|
||||||
break;
|
break;
|
||||||
case oLatexDynamicSteadyStateOperator:
|
|
||||||
case oMatlabDynamicSteadyStateOperator:
|
case oMatlabDynamicSteadyStateOperator:
|
||||||
assert(lag == 0);
|
output << "oo_.exo_det_steady_state(" << tsid + 1 << ")";
|
||||||
output << "oo_.exo_det_steady_state" << "(" << tsid + 1 << ")";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -783,7 +782,7 @@ UnaryOpNode::cost(const temporary_terms_type &temporary_terms, bool is_matlab) c
|
||||||
case oSqrt:
|
case oSqrt:
|
||||||
return cost + 570;
|
return cost + 570;
|
||||||
case oSteadyState:
|
case oSteadyState:
|
||||||
return cost + 0;
|
return cost;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// Cost for C files
|
// Cost for C files
|
||||||
|
@ -819,7 +818,7 @@ UnaryOpNode::cost(const temporary_terms_type &temporary_terms, bool is_matlab) c
|
||||||
case oSqrt:
|
case oSqrt:
|
||||||
return cost + 90;
|
return cost + 90;
|
||||||
case oSteadyState:
|
case oSteadyState:
|
||||||
return cost + 0;
|
return cost;
|
||||||
}
|
}
|
||||||
// Suppress GCC warning
|
// Suppress GCC warning
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -970,10 +969,10 @@ UnaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
new_output_type = oLatexDynamicSteadyStateOperator;
|
new_output_type = oLatexDynamicSteadyStateOperator;
|
||||||
break;
|
break;
|
||||||
case oCDynamicModel:
|
case oCDynamicModel:
|
||||||
cerr << "Steady State Operator not imlpemented for oCDynamicModel.\n";
|
cerr << "Steady State Operator not implemented for oCDynamicModel." << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
case oMatlabDynamicModelSparse:
|
case oMatlabDynamicModelSparse:
|
||||||
cerr << "Steady State Operator not imlpemented for oMatlabDynamicModelSparse.\n";
|
cerr << "Steady State Operator not implemented for oMatlabDynamicModelSparse." << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
default:
|
default:
|
||||||
new_output_type = output_type;
|
new_output_type = output_type;
|
||||||
|
|
Loading…
Reference in New Issue