Preprocessor:
- remove useless output type oMatlabDynamicModelSparseLocalTemporaryTerms (indistinguishable from oMatlabDynamicModelSparseLocal) - fix bug in output type of sparse static modelissue#70
parent
75440028eb
commit
ae3e741cb8
|
@ -233,13 +233,9 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
|
|||
vector<int> feedback_variables;
|
||||
ExprNodeOutputType local_output_type;
|
||||
|
||||
local_output_type = oMatlabDynamicModelSparse;
|
||||
if (global_temporary_terms)
|
||||
{
|
||||
local_output_type = oMatlabDynamicModelSparse;
|
||||
local_temporary_terms = temporary_terms;
|
||||
}
|
||||
else
|
||||
local_output_type = oMatlabDynamicModelSparseLocalTemporaryTerms;
|
||||
local_temporary_terms = temporary_terms;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//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;
|
||||
local_output_type = oMatlabDynamicModelSparse;
|
||||
if (global_temporary_terms)
|
||||
{
|
||||
local_output_type = oMatlabDynamicModelSparse;
|
||||
local_temporary_terms = temporary_terms;
|
||||
}
|
||||
else
|
||||
local_output_type = oMatlabDynamicModelSparseLocalTemporaryTerms;
|
||||
local_temporary_terms = temporary_terms;
|
||||
|
||||
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;
|
||||
|
||||
local_output_type = oMatlabStaticModelSparse;
|
||||
if (global_temporary_terms)
|
||||
{
|
||||
local_output_type = oMatlabStaticModelSparse;
|
||||
local_temporary_terms = temporary_terms;
|
||||
}
|
||||
else
|
||||
local_output_type = oMatlabDynamicModelSparseLocalTemporaryTerms;
|
||||
local_temporary_terms = temporary_terms;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//For each block
|
||||
|
|
Loading…
Reference in New Issue