Commit 59fad3df authored by sebastien's avatar sebastien
Browse files

trunk preprocessor: removed unused recursive variable type


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2167 ac1d8469-bf42-47a9-8791-bf33cf982152
parent cc64a40a
......@@ -176,8 +176,7 @@ VariableNode::VariableNode(DataTree &datatree_arg, int symb_id_arg, SymbolType t
// Add myself to the variable table if necessary and initialize var_id
if (type == eEndogenous
|| type == eExogenousDet
|| type == eExogenous
|| type == eRecursiveVariable)
|| type == eExogenous)
var_id = datatree.variable_table.addVariable(type, symb_id, lag);
else
var_id = -1;
......@@ -195,7 +194,6 @@ VariableNode::VariableNode(DataTree &datatree_arg, int symb_id_arg, SymbolType t
case eEndogenous:
case eExogenous:
case eExogenousDet:
case eRecursiveVariable:
// For a variable, the only non-null derivative is with respect to itself
non_null_derivatives.insert(var_id);
break;
......@@ -223,7 +221,6 @@ VariableNode::computeDerivative(int varID)
case eEndogenous:
case eExogenous:
case eExogenousDet:
case eRecursiveVariable:
if (varID == var_id)
return datatree.One;
else
......@@ -391,9 +388,6 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
}
break;
case eRecursiveVariable:
cerr << "Recursive variable not implemented" << endl;
exit(-1);
case eUnknownFunction:
cerr << "Impossible case" << endl;
exit(-1);
......@@ -462,7 +456,6 @@ VariableNode::compile(ofstream &CompileCode, bool lhs_rhs, ExprNodeOutputType ou
lagl=lag;
CompileCode.write(reinterpret_cast<char *>(&lagl), sizeof(lagl));
break;
case eRecursiveVariable:
case eModelLocalVariable:
case eModFileLocalVariable:
cerr << "VariableNode::compile: unhandled variable type" << endl;
......
......@@ -3819,12 +3819,6 @@ ModelTree::writeOutput(ostream &output) const
output << "M_.maximum_exo_det_lead = " << variable_table.max_exo_det_lead << ";\n";
output << "oo_.exo_det_steady_state = zeros(" << symbol_table.exo_det_nbr << ", 1);\n";
}
if (symbol_table.recur_nbr)
{
output << "M_.maximum_recur_lag = " << variable_table.max_recur_lag << ";\n";
output << "M_.maximum_recur_lead = " << variable_table.max_recur_lead << ";\n";
output << "oo_.recur_steady_state = zeros(" << symbol_table.recur_nbr << ", 1);\n";
}
if (symbol_table.parameter_nbr)
output << "M_.params = repmat(NaN," << symbol_table.parameter_nbr << ", 1);\n";
}
......
......@@ -86,9 +86,6 @@ InitValStatement::writeOutput(ostream &output, const string &basename) const
output << "options_.initval_file = 0;" << endl
<< "endval_=0;" << endl;
if (symbol_table.recur_nbr > 0)
output << "recurs_ = zeros(" << symbol_table.recur_nbr << ", 1);\n";
writeInitValues(output);
output << "oo_.endo_simul=[oo_.steady_state*ones(1,M_.maximum_lag)];\n";
......
......@@ -22,7 +22,7 @@
#include "SymbolTable.hh"
SymbolTable::SymbolTable() : endo_nbr(0), exo_nbr(0), exo_det_nbr(0), recur_nbr(0),
SymbolTable::SymbolTable() : endo_nbr(0), exo_nbr(0), exo_det_nbr(0),
parameter_nbr(0), model_local_variable_nbr(0),
modfile_local_variable_nbr(0), unknown_function_nbr(0)
{
......@@ -55,9 +55,6 @@ SymbolTable::addSymbol(const string &name, SymbolType type, const string &tex_na
case eParameter:
id = parameter_nbr++;
break;
case eRecursiveVariable:
id = recur_nbr++;
break;
case eModelLocalVariable:
id = model_local_variable_nbr++;
break;
......@@ -108,16 +105,6 @@ SymbolTable::writeOutput(ostream &output) const
<< "M_.endo_names_tex = strvcat(M_.endo_names_tex, '" << getTeXNameByID(eEndogenous, id) << "');" << endl;
}
}
if (recur_nbr > 0)
{
output << "M_.recur_names = '" << getNameByID(eRecursiveVariable, 0) << "';" << endl;
output << "M_.recur_names_tex = '" << getTeXNameByID(eRecursiveVariable, 0) << "';" << endl;
for (int id = 1; id < recur_nbr; id++)
{
output << "M_.recur_names = strvcat(M_.recur_names, '" << getNameByID(eRecursiveVariable, id) << "');" << endl
<< "M_.recur_names_tex = strvcat(M_.recur_names_tex, '" << getTeXNameByID(eRecursiveVariable, id) << "');" << endl;
}
}
if (parameter_nbr > 0)
{
output << "M_.param_names = '" << getNameByID(eParameter, 0) << "';" << endl;
......@@ -132,7 +119,6 @@ SymbolTable::writeOutput(ostream &output) const
output << "M_.exo_det_nbr = " << exo_det_nbr << ";" << endl
<< "M_.exo_nbr = " << exo_nbr << ";" << endl
<< "M_.endo_nbr = " << endo_nbr << ";" << endl
<< "M_.recur_nbr = " << recur_nbr << ";" << endl
<< "M_.param_nbr = " << parameter_nbr << ";" << endl;
output << "M_.Sigma_e = zeros(" << exo_nbr << ", " << exo_nbr << ");" << endl;
......
......@@ -27,8 +27,7 @@ VariableTable::VariableTable(const SymbolTable &symbol_table_arg) :
max_lag(0), max_lead(0),
max_endo_lag(0), max_endo_lead(0),
max_exo_lag(0), max_exo_lead(0),
max_exo_det_lag(0), max_exo_det_lead(0),
max_recur_lag(0), max_recur_lead(0)
max_exo_det_lag(0), max_exo_det_lead(0)
{
}
......@@ -79,12 +78,6 @@ VariableTable::addVariable(SymbolType type, int symb_id, int lag) throw (DynJaco
else if (-max_exo_det_lag > lag)
max_exo_det_lag = -lag;
break;
case eRecursiveVariable:
if (max_recur_lead < lag)
max_recur_lead = lag;
else if (-max_recur_lag > lag)
max_recur_lag = -lag;
break;
default:
cerr << "VariableTable::addVariable(): forbidden variable type" << endl;
exit(-1);
......
......@@ -71,7 +71,6 @@ enum SymbolType
eEndogenous = 0, //!< Endogenous
eExogenous = 1, //!< Exogenous
eExogenousDet = 2, //!< Exogenous deterministic
eRecursiveVariable = 3, //!< Recursive variable (reserved for future use)
eParameter = 4, //!< Parameter
eModelLocalVariable = 10, //!< Local variable whose scope is model (pound expression)
eModFileLocalVariable = 11, //!< Local variable whose scope is mod file (model excluded)
......
......@@ -88,8 +88,6 @@ public:
int exo_nbr;
//! Number of declared deterministic exogenous variables
int exo_det_nbr;
//! Number of declared recursive variables
int recur_nbr;
//! Number of declared parameters
int parameter_nbr;
//! Number of model local variables
......
......@@ -73,10 +73,6 @@ public:
int max_exo_det_lag;
//! Maximum lead over deterministic exogenous variables
int max_exo_det_lead;
//! Maximum lag over recursive variables (positive value)
int max_recur_lag;
//! Maximum lead over recursive variables
int max_recur_lead;
//! Thrown when trying to access an unknown variable by (type, symb_id, lag)
class UnknownVariableKeyException
{
......
Markdown is supported
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