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