Commit ae3e741c authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Preprocessor:

- remove useless output type oMatlabDynamicModelSparseLocalTemporaryTerms
(indistinguishable from oMatlabDynamicModelSparseLocal)
- fix bug in output type of sparse static model
parent 75440028
......@@ -233,13 +233,9 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
vector<int> feedback_variables;
ExprNodeOutputType local_output_type;
if (global_temporary_terms)
{
local_output_type = oMatlabDynamicModelSparse;
if (global_temporary_terms)
local_temporary_terms = temporary_terms;
}
else
local_output_type = oMatlabDynamicModelSparseLocalTemporaryTerms;
//----------------------------------------------------------------------
//For each block
......@@ -260,13 +256,9 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
unsigned int block_exo_det_size = exo_det_block[block].size();
unsigned int block_other_endo_size = other_endo_block[block].size();
int block_max_lag = max_leadlag_block[block].first;
if (global_temporary_terms)
{
local_output_type = oMatlabDynamicModelSparse;
if (global_temporary_terms)
local_temporary_terms = temporary_terms;
}
else
local_output_type = oMatlabDynamicModelSparseLocalTemporaryTerms;
tmp1_output.str("");
tmp1_output << dynamic_basename << "_" << block+1 << ".m";
......
......@@ -542,7 +542,7 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
break;
case eModelLocalVariable:
if (output_type == oMatlabDynamicModelSparse || output_type == oMatlabStaticModelSparse || output_type == oMatlabDynamicModelSparseLocalTemporaryTerms)
if (output_type == oMatlabDynamicModelSparse || output_type == oMatlabStaticModelSparse)
{
output << "(";
datatree.local_variables_table[symb_id]->writeOutput(output, output_type, temporary_terms);
......@@ -570,7 +570,6 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
output << "y" << LEFT_ARRAY_SUBSCRIPT(output_type) << i << RIGHT_ARRAY_SUBSCRIPT(output_type);
break;
case oMatlabDynamicModelSparse:
case oMatlabDynamicModelSparseLocalTemporaryTerms:
i = tsid + ARRAY_SUBSCRIPT_OFFSET(output_type);
if (lag > 0)
output << "y" << LEFT_ARRAY_SUBSCRIPT(output_type) << "it_+" << lag << ", " << i << RIGHT_ARRAY_SUBSCRIPT(output_type);
......@@ -599,7 +598,6 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
{
case oMatlabDynamicModel:
case oMatlabDynamicModelSparse:
case oMatlabDynamicModelSparseLocalTemporaryTerms:
if (lag > 0)
output << "x(it_+" << lag << ", " << i << ")";
else if (lag < 0)
......@@ -640,7 +638,6 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
{
case oMatlabDynamicModel:
case oMatlabDynamicModelSparse:
case oMatlabDynamicModelSparseLocalTemporaryTerms:
if (lag > 0)
output << "x(it_+" << lag << ", " << i << ")";
else if (lag < 0)
......@@ -1463,7 +1460,6 @@ UnaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
cerr << "Steady State Operator not implemented for oCDynamicModel." << endl;
exit(EXIT_FAILURE);
case oMatlabDynamicModelSparse:
case oMatlabDynamicModelSparseLocalTemporaryTerms:
cerr << "Steady State Operator not implemented for oMatlabDynamicModelSparse." << endl;
exit(EXIT_FAILURE);
default:
......
......@@ -71,7 +71,6 @@ enum ExprNodeOutputType
oLatexDynamicSteadyStateOperator, //!< LaTeX code, dynamic model steady state declarations
oMatlabDynamicSteadyStateOperator, //!< Matlab code, dynamic model steady state declarations
oMatlabDynamicModelSparseSteadyStateOperator, //!< Matlab code, dynamic block decomposed model steady state declarations
oMatlabDynamicModelSparseLocalTemporaryTerms, //!< Matlab code, dynamic block decomposed model local temporary_terms
oSteadyStateFile //!< Matlab code, in the generated steady state file
};
......@@ -80,7 +79,6 @@ enum ExprNodeOutputType
|| (output_type) == oMatlabOutsideModel \
|| (output_type) == oMatlabStaticModelSparse \
|| (output_type) == oMatlabDynamicModelSparse \
|| (output_type) == oMatlabDynamicModelSparseLocalTemporaryTerms \
|| (output_type) == oMatlabDynamicSteadyStateOperator \
|| (output_type) == oMatlabDynamicModelSparseSteadyStateOperator \
|| (output_type) == oSteadyStateFile)
......
......@@ -212,13 +212,9 @@ StaticModel::writeModelEquationsOrdered_M(const string &static_basename) const
vector<int> feedback_variables;
ExprNodeOutputType local_output_type;
if (global_temporary_terms)
{
local_output_type = oMatlabStaticModelSparse;
if (global_temporary_terms)
local_temporary_terms = temporary_terms;
}
else
local_output_type = oMatlabDynamicModelSparseLocalTemporaryTerms;
//----------------------------------------------------------------------
//For each block
......
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