Merge branch 'master' into new_ep
commit
7c4562e7e6
|
@ -44,7 +44,7 @@ SteadyStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidati
|
|||
}
|
||||
|
||||
void
|
||||
SteadyStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SteadyStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "steady;" << endl;
|
||||
|
@ -56,7 +56,7 @@ CheckStatement::CheckStatement(const OptionsList &options_list_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
CheckStatement::writeOutput(ostream &output, const string &basename) const
|
||||
CheckStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "oo_.dr.eigval = check(M_,options_,oo_);" << endl;
|
||||
|
@ -80,7 +80,7 @@ ModelInfoStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolid
|
|||
}
|
||||
|
||||
void
|
||||
ModelInfoStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ModelInfoStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "model_info();" << endl;
|
||||
|
@ -98,7 +98,7 @@ SimulStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidatio
|
|||
}
|
||||
|
||||
void
|
||||
SimulStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SimulStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "perfect_foresight_setup;" << endl
|
||||
|
@ -111,7 +111,7 @@ PerfectForesightSetupStatement::PerfectForesightSetupStatement(const OptionsList
|
|||
}
|
||||
|
||||
void
|
||||
PerfectForesightSetupStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PerfectForesightSetupStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "perfect_foresight_setup;" << endl;
|
||||
|
@ -126,10 +126,14 @@ void
|
|||
PerfectForesightSolverStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
{
|
||||
mod_file_struct.perfect_foresight_solver_present = true;
|
||||
// Fill in option_occbin of mod_file_struct
|
||||
OptionsList::string_options_t::const_iterator it = options_list.num_options.find("occbin");
|
||||
if (it != options_list.string_options.end())
|
||||
mod_file_struct.occbin_option = true;
|
||||
}
|
||||
|
||||
void
|
||||
PerfectForesightSolverStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PerfectForesightSolverStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "perfect_foresight_solver;" << endl;
|
||||
|
@ -166,7 +170,7 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
|
|||
}
|
||||
|
||||
void
|
||||
StochSimulStatement::writeOutput(ostream &output, const string &basename) const
|
||||
StochSimulStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
// Ensure that order 3 implies k_order (#844)
|
||||
OptionsList::num_options_t::const_iterator it = options_list.num_options.find("order");
|
||||
|
@ -188,7 +192,7 @@ ForecastStatement::ForecastStatement(const SymbolList &symbol_list_arg,
|
|||
}
|
||||
|
||||
void
|
||||
ForecastStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ForecastStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
|
@ -235,7 +239,7 @@ RamseyModelStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsol
|
|||
}
|
||||
|
||||
void
|
||||
RamseyModelStatement::writeOutput(ostream &output, const string &basename) const
|
||||
RamseyModelStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
// options_.ramsey_policy indicates that a Ramsey model is present in the *.mod file
|
||||
// this affects the computation of the steady state that uses a special algorithm
|
||||
|
@ -252,6 +256,109 @@ RamseyModelStatement::writeOutput(ostream &output, const string &basename) const
|
|||
options_list.writeOutput(output);
|
||||
}
|
||||
|
||||
RamseyConstraintsStatement::RamseyConstraintsStatement(const constraints_t &constraints_arg) :
|
||||
constraints(constraints_arg)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
RamseyConstraintsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
{
|
||||
if ((mod_file_struct.ramsey_model_present != true) || ( mod_file_struct.ramsey_policy_present != true))
|
||||
cerr << "ramsey_constraints: can only be used with ramsey_model or ramsey_policy" << endl;
|
||||
}
|
||||
|
||||
void
|
||||
RamseyConstraintsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "M_.ramsey_model_constraints = {" << endl;
|
||||
for (RamseyConstraintsStatement::constraints_t::const_iterator it = constraints.begin(); it != constraints.end(); ++it)
|
||||
{
|
||||
if (it != constraints.begin())
|
||||
output << ", ";
|
||||
output << "{" << it->endo + 1 << ", '";
|
||||
switch(it->code)
|
||||
{
|
||||
case oLess:
|
||||
output << '<';
|
||||
break;
|
||||
case oGreater:
|
||||
output << '>';
|
||||
break;
|
||||
case oLessEqual:
|
||||
output << "<=";
|
||||
break;
|
||||
case oGreaterEqual:
|
||||
output << ">=";
|
||||
break;
|
||||
default:
|
||||
cerr << "Ramsey constraints: this shouldn't happen." << endl;
|
||||
exit(1);
|
||||
}
|
||||
output << "', '";
|
||||
it->expression->writeOutput(output);
|
||||
output << "'}" << endl;
|
||||
}
|
||||
output << "};" << endl;
|
||||
}
|
||||
|
||||
// Statement *
|
||||
// RamseyConstraintsStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
|
||||
// {
|
||||
// vector<string> errors;
|
||||
// SymbolList new_symbol_list, new_options_symbol_list;
|
||||
// OptionsList new_options_list = options_list;
|
||||
// SymbolTable *new_symbol_table = dynamic_datatree.getSymbolTable();
|
||||
// vector<string> symbols = symbol_list.get_symbols();
|
||||
|
||||
// for (vector<string>::const_iterator it = symbols.begin(); it != symbols.end(); it++)
|
||||
// try
|
||||
// {
|
||||
// new_symbol_table->getID(*it);
|
||||
// new_symbol_list.addSymbol(*it);
|
||||
// }
|
||||
// catch (SymbolTable::UnknownSymbolIDException &e)
|
||||
// {
|
||||
// errors.push_back(orig_symbol_table.getName(e.id));
|
||||
// }
|
||||
// catch (SymbolTable::UnknownSymbolNameException &e)
|
||||
// {
|
||||
// errors.push_back(e.name);
|
||||
// }
|
||||
|
||||
// OptionsList::symbol_list_options_t::const_iterator it = options_list.symbol_list_options.find("instruments");
|
||||
// if (it != options_list.symbol_list_options.end())
|
||||
// {
|
||||
// symbols = it->second.get_symbols();
|
||||
// for (vector<string>::const_iterator it1 = symbols.begin(); it1 != symbols.end(); it1++)
|
||||
// try
|
||||
// {
|
||||
// new_symbol_table->getID(*it1);
|
||||
// new_options_symbol_list.addSymbol(*it1);
|
||||
// }
|
||||
// catch (SymbolTable::UnknownSymbolIDException &e)
|
||||
// {
|
||||
// errors.push_back(orig_symbol_table.getName(e.id));
|
||||
// }
|
||||
// catch (SymbolTable::UnknownSymbolNameException &e)
|
||||
// {
|
||||
// errors.push_back(e.name);
|
||||
// }
|
||||
// new_options_list.symbol_list_options["instruments"] = new_options_symbol_list;
|
||||
// }
|
||||
|
||||
// if (!errors.empty())
|
||||
// {
|
||||
// cerr << endl
|
||||
// << "ERROR: The following vars were used in the ramsey_policy statement(s) but were not declared." << endl
|
||||
// << " This likely means that you declared them as varexo and that they're not in the model" << endl;
|
||||
// for (vector<string>::const_iterator it = errors.begin(); it != errors.end(); it++)
|
||||
// cerr << *it << endl;
|
||||
// exit(EXIT_FAILURE);
|
||||
// }
|
||||
// return new RamseyPolicyStatement(new_symbol_list, options_list);
|
||||
// }
|
||||
|
||||
RamseyPolicyStatement::RamseyPolicyStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg) :
|
||||
symbol_list(symbol_list_arg),
|
||||
|
@ -296,7 +403,7 @@ RamseyPolicyStatement::checkPass(ModFileStructure &mod_file_struct, WarningConso
|
|||
}
|
||||
|
||||
void
|
||||
RamseyPolicyStatement::writeOutput(ostream &output, const string &basename) const
|
||||
RamseyPolicyStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
// Ensure that order 3 implies k_order (#844)
|
||||
OptionsList::num_options_t::const_iterator it = options_list.num_options.find("order");
|
||||
|
@ -356,7 +463,7 @@ DiscretionaryPolicyStatement::checkPass(ModFileStructure &mod_file_struct, Warni
|
|||
}
|
||||
|
||||
void
|
||||
DiscretionaryPolicyStatement::writeOutput(ostream &output, const string &basename) const
|
||||
DiscretionaryPolicyStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
// Ensure that order 3 implies k_order (#844)
|
||||
OptionsList::num_options_t::const_iterator it = options_list.num_options.find("order");
|
||||
|
@ -462,7 +569,7 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
|
|||
}
|
||||
|
||||
void
|
||||
EstimationStatement::writeOutput(ostream &output, const string &basename) const
|
||||
EstimationStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
|
||||
|
@ -497,7 +604,7 @@ DynareSensitivityStatement::checkPass(ModFileStructure &mod_file_struct, Warning
|
|||
}
|
||||
|
||||
void
|
||||
DynareSensitivityStatement::writeOutput(ostream &output, const string &basename) const
|
||||
DynareSensitivityStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output, "options_gsa");
|
||||
|
||||
|
@ -524,7 +631,7 @@ RplotStatement::RplotStatement(const SymbolList &symbol_list_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
RplotStatement::writeOutput(ostream &output, const string &basename) const
|
||||
RplotStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
output << "rplot(var_list_);" << endl;
|
||||
|
@ -535,7 +642,7 @@ UnitRootVarsStatement::UnitRootVarsStatement(void)
|
|||
}
|
||||
|
||||
void
|
||||
UnitRootVarsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
UnitRootVarsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_.diffuse_filter = 1;" << endl
|
||||
<< "options_.steadystate.nocheck = 1;" << endl;
|
||||
|
@ -546,7 +653,7 @@ PeriodsStatement::PeriodsStatement(int periods_arg) : periods(periods_arg)
|
|||
}
|
||||
|
||||
void
|
||||
PeriodsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PeriodsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_.periods = " << periods << ";" << endl;
|
||||
}
|
||||
|
@ -560,7 +667,7 @@ DsampleStatement::DsampleStatement(int val1_arg, int val2_arg) : val1(val1_arg),
|
|||
}
|
||||
|
||||
void
|
||||
DsampleStatement::writeOutput(ostream &output, const string &basename) const
|
||||
DsampleStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
if (val2 < 0)
|
||||
output << "dsample(" << val1 << ");" << endl;
|
||||
|
@ -640,7 +747,7 @@ EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
|
|||
}
|
||||
|
||||
void
|
||||
EstimatedParamsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
EstimatedParamsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "global estim_params_" << endl
|
||||
<< "estim_params_.var_exo = [];" << endl
|
||||
|
@ -715,7 +822,7 @@ EstimatedParamsInitStatement::checkPass(ModFileStructure &mod_file_struct, Warni
|
|||
}
|
||||
|
||||
void
|
||||
EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basename) const
|
||||
EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
if (use_calibration)
|
||||
output << "options_.use_calibration_initialization = 1;" << endl;
|
||||
|
@ -781,7 +888,7 @@ EstimatedParamsBoundsStatement::EstimatedParamsBoundsStatement(const vector<Esti
|
|||
}
|
||||
|
||||
void
|
||||
EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
vector<EstimationParams>::const_iterator it;
|
||||
|
||||
|
@ -869,7 +976,7 @@ ObservationTrendsStatement::ObservationTrendsStatement(const trend_elements_t &t
|
|||
}
|
||||
|
||||
void
|
||||
ObservationTrendsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ObservationTrendsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_.trend_coeff_ = {};" << endl;
|
||||
|
||||
|
@ -902,7 +1009,7 @@ OsrParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolid
|
|||
}
|
||||
|
||||
void
|
||||
OsrParamsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
OsrParamsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
symbol_list.writeOutput("osr_params_", output);
|
||||
}
|
||||
|
@ -937,7 +1044,7 @@ OsrStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation
|
|||
}
|
||||
|
||||
void
|
||||
OsrStatement::writeOutput(ostream &output, const string &basename) const
|
||||
OsrStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
// Ensure that order 3 implies k_order (#844)
|
||||
OptionsList::num_options_t::const_iterator it = options_list.num_options.find("order");
|
||||
|
@ -967,7 +1074,7 @@ OptimWeightsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConso
|
|||
}
|
||||
|
||||
void
|
||||
OptimWeightsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
OptimWeightsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% OPTIM_WEIGHTS" << endl
|
||||
|
@ -1010,7 +1117,7 @@ DynaSaveStatement::DynaSaveStatement(const SymbolList &symbol_list_arg,
|
|||
}
|
||||
|
||||
void
|
||||
DynaSaveStatement::writeOutput(ostream &output, const string &basename) const
|
||||
DynaSaveStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
output << "dynasave('" << filename
|
||||
|
@ -1025,7 +1132,7 @@ DynaTypeStatement::DynaTypeStatement(const SymbolList &symbol_list_arg,
|
|||
}
|
||||
|
||||
void
|
||||
DynaTypeStatement::writeOutput(ostream &output, const string &basename) const
|
||||
DynaTypeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
output << "dynatype('" << filename
|
||||
|
@ -1040,7 +1147,7 @@ ModelComparisonStatement::ModelComparisonStatement(const filename_list_t &filena
|
|||
}
|
||||
|
||||
void
|
||||
ModelComparisonStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ModelComparisonStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
|
||||
|
@ -1086,7 +1193,7 @@ PlannerObjectiveStatement::computingPass()
|
|||
}
|
||||
|
||||
void
|
||||
PlannerObjectiveStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PlannerObjectiveStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
model_tree->writeStaticFile(basename + "_objective", false, false, false);
|
||||
}
|
||||
|
@ -1104,7 +1211,7 @@ BVARDensityStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsol
|
|||
}
|
||||
|
||||
void
|
||||
BVARDensityStatement::writeOutput(ostream &output, const string &basename) const
|
||||
BVARDensityStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "bvar_density(" << maxnlags << ");" << endl;
|
||||
|
@ -1123,7 +1230,7 @@ BVARForecastStatement::checkPass(ModFileStructure &mod_file_struct, WarningConso
|
|||
}
|
||||
|
||||
void
|
||||
BVARForecastStatement::writeOutput(ostream &output, const string &basename) const
|
||||
BVARForecastStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "bvar_forecast(" << nlags << ");" << endl;
|
||||
|
@ -1141,7 +1248,7 @@ SBVARStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidatio
|
|||
}
|
||||
|
||||
void
|
||||
SBVARStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SBVARStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
output << "sbvar(M_,options_);" << endl;
|
||||
|
@ -1168,7 +1275,7 @@ MSSBVAREstimationStatement::checkPass(ModFileStructure &mod_file_struct, Warning
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVAREstimationStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVAREstimationStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl
|
||||
<< "options_.datafile = '';" << endl;
|
||||
|
@ -1188,7 +1295,7 @@ MSSBVARSimulationStatement::checkPass(ModFileStructure &mod_file_struct, Warning
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVARSimulationStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVARSimulationStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
|
||||
options_list.writeOutput(output);
|
||||
|
@ -1216,7 +1323,7 @@ MSSBVARComputeMDDStatement::checkPass(ModFileStructure &mod_file_struct, Warning
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVARComputeMDDStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVARComputeMDDStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
|
||||
options_list.writeOutput(output);
|
||||
|
@ -1243,7 +1350,7 @@ MSSBVARComputeProbabilitiesStatement::checkPass(ModFileStructure &mod_file_struc
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVARComputeProbabilitiesStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVARComputeProbabilitiesStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
|
||||
options_list.writeOutput(output);
|
||||
|
@ -1289,7 +1396,7 @@ MSSBVARIrfStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVARIrfStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVARIrfStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
|
@ -1316,7 +1423,7 @@ MSSBVARForecastStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVARForecastStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVARForecastStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
|
||||
options_list.writeOutput(output);
|
||||
|
@ -1360,7 +1467,7 @@ MSSBVARVarianceDecompositionStatement::checkPass(ModFileStructure &mod_file_stru
|
|||
}
|
||||
|
||||
void
|
||||
MSSBVARVarianceDecompositionStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MSSBVARVarianceDecompositionStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
|
||||
options_list.writeOutput(output);
|
||||
|
@ -1385,7 +1492,7 @@ IdentificationStatement::checkPass(ModFileStructure &mod_file_struct, WarningCon
|
|||
}
|
||||
|
||||
void
|
||||
IdentificationStatement::writeOutput(ostream &output, const string &basename) const
|
||||
IdentificationStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output, "options_ident");
|
||||
|
||||
|
@ -1412,7 +1519,7 @@ WriteLatexDynamicModelStatement::WriteLatexDynamicModelStatement(const DynamicMo
|
|||
}
|
||||
|
||||
void
|
||||
WriteLatexDynamicModelStatement::writeOutput(ostream &output, const string &basename) const
|
||||
WriteLatexDynamicModelStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
dynamic_model.writeLatexFile(basename);
|
||||
}
|
||||
|
@ -1423,7 +1530,7 @@ WriteLatexStaticModelStatement::WriteLatexStaticModelStatement(const StaticModel
|
|||
}
|
||||
|
||||
void
|
||||
WriteLatexStaticModelStatement::writeOutput(ostream &output, const string &basename) const
|
||||
WriteLatexStaticModelStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
static_model.writeLatexFile(basename);
|
||||
}
|
||||
|
@ -1434,7 +1541,7 @@ WriteLatexOriginalModelStatement::WriteLatexOriginalModelStatement(const Dynamic
|
|||
}
|
||||
|
||||
void
|
||||
WriteLatexOriginalModelStatement::writeOutput(ostream &output, const string &basename) const
|
||||
WriteLatexOriginalModelStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
original_model.writeLatexOriginalFile(basename);
|
||||
}
|
||||
|
@ -1447,7 +1554,7 @@ ShockDecompositionStatement::ShockDecompositionStatement(const SymbolList &symbo
|
|||
}
|
||||
|
||||
void
|
||||
ShockDecompositionStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ShockDecompositionStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
|
@ -1460,7 +1567,7 @@ ConditionalForecastStatement::ConditionalForecastStatement(const OptionsList &op
|
|||
}
|
||||
|
||||
void
|
||||
ConditionalForecastStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ConditionalForecastStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output, "options_cond_fcst_");
|
||||
output << "imcforecast(constrained_paths_, constrained_vars_, options_cond_fcst_);" << endl;
|
||||
|
@ -1473,7 +1580,7 @@ PlotConditionalForecastStatement::PlotConditionalForecastStatement(int periods_a
|
|||
}
|
||||
|
||||
void
|
||||
PlotConditionalForecastStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PlotConditionalForecastStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
if (periods == -1)
|
||||
|
@ -1526,7 +1633,7 @@ SvarIdentificationStatement::checkPass(ModFileStructure &mod_file_struct, Warnin
|
|||
}
|
||||
|
||||
void
|
||||
SvarIdentificationStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SvarIdentificationStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
assert(!(upper_cholesky_present && lower_cholesky_present));
|
||||
output << "%" << endl
|
||||
|
@ -1743,7 +1850,7 @@ MarkovSwitchingStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
|
|||
}
|
||||
|
||||
void
|
||||
MarkovSwitchingStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MarkovSwitchingStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
bool isDurationAVec = true;
|
||||
string infStr("Inf");
|
||||
|
@ -1852,7 +1959,7 @@ SvarStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation
|
|||
}
|
||||
|
||||
void
|
||||
SvarStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SvarStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
OptionsList::num_options_t::const_iterator it0, it1, it2;
|
||||
OptionsList::vec_int_options_t::const_iterator itv;
|
||||
|
@ -1898,7 +2005,7 @@ SetTimeStatement::SetTimeStatement(const OptionsList &options_list_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
SetTimeStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SetTimeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
}
|
||||
|
@ -1937,7 +2044,7 @@ EstimationDataStatement::checkPass(ModFileStructure &mod_file_struct, WarningCon
|
|||
}
|
||||
|
||||
void
|
||||
EstimationDataStatement::writeOutput(ostream &output, const string &basename) const
|
||||
EstimationDataStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output, "options_.dataset");
|
||||
}
|
||||
|
@ -1959,7 +2066,7 @@ SubsamplesStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
|
|||
}
|
||||
|
||||
void
|
||||
SubsamplesStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SubsamplesStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "subsamples_indx = get_new_or_existing_ei_index('subsamples_index', '"
|
||||
<< name1 << "','" << name2 << "');" << endl
|
||||
|
@ -2029,7 +2136,7 @@ SubsamplesEqualStatement::SubsamplesEqualStatement(const string &to_name1_arg,
|
|||
}
|
||||
|
||||
void
|
||||
SubsamplesEqualStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SubsamplesEqualStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "subsamples_to_indx = get_new_or_existing_ei_index('subsamples_index', '"
|
||||
<< to_name1 << "','" << to_name2 << "');" << endl
|
||||
|
@ -2123,7 +2230,7 @@ JointPriorStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
|
|||
}
|
||||
|
||||
void
|
||||
JointPriorStatement::writeOutput(ostream &output, const string &basename) const
|
||||
JointPriorStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
for (vector<string>::const_iterator it = joint_parameters.begin() ; it != joint_parameters.end(); it++)
|
||||
output << "eifind = get_new_or_existing_ei_index('joint_parameter_prior_index', '"
|
||||
|
@ -2387,7 +2494,7 @@ PriorStatement::PriorStatement(const string &name_arg,
|
|||
}
|
||||
|
||||
void
|
||||
PriorStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PriorStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field = "estimation_info.parameter(eifind)";
|
||||
output << "eifind = get_new_or_existing_ei_index('parameter_prior_index', '"
|
||||
|
@ -2424,7 +2531,7 @@ StdPriorStatement::StdPriorStatement(const string &name_arg,
|
|||
}
|
||||
|
||||
void
|
||||
StdPriorStatement::writeOutput(ostream &output, const string &basename) const
|
||||
StdPriorStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field;
|
||||
get_base_name(symbol_table.getType(name), lhs_field);
|
||||
|
@ -2487,7 +2594,7 @@ CorrPriorStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolid
|
|||
}
|
||||
|
||||
void
|
||||
CorrPriorStatement::writeOutput(ostream &output, const string &basename) const
|
||||
CorrPriorStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field;
|
||||
get_base_name(symbol_table.getType(name), lhs_field);
|
||||
|
@ -2575,7 +2682,7 @@ PriorEqualStatement::get_base_name(const SymbolType symb_type, string &lhs_field
|
|||
}
|
||||
|
||||
void
|
||||
PriorEqualStatement::writeOutput(ostream &output, const string &basename) const
|
||||
PriorEqualStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field, rhs_field;
|
||||
|
||||
|
@ -2721,7 +2828,7 @@ OptionsStatement::OptionsStatement(const string &name_arg,
|
|||
}
|
||||
|
||||
void
|
||||
OptionsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
OptionsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field = "estimation_info.parameter(eifind)";
|
||||
output << "eifind = get_new_or_existing_ei_index('parameter_options_index', '"
|
||||
|
@ -2749,7 +2856,7 @@ StdOptionsStatement::StdOptionsStatement(const string &name_arg,
|
|||
}
|
||||
|
||||
void
|
||||
StdOptionsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
StdOptionsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field;
|
||||
get_base_name(symbol_table.getType(name), lhs_field);
|
||||
|
@ -2804,7 +2911,7 @@ CorrOptionsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsol
|
|||
}
|
||||
|
||||
void
|
||||
CorrOptionsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
CorrOptionsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field;
|
||||
get_base_name(symbol_table.getType(name), lhs_field);
|
||||
|
@ -2887,7 +2994,7 @@ OptionsEqualStatement::get_base_name(const SymbolType symb_type, string &lhs_fie
|
|||
}
|
||||
|
||||
void
|
||||
OptionsEqualStatement::writeOutput(ostream &output, const string &basename) const
|
||||
OptionsEqualStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
string lhs_field, rhs_field;
|
||||
|
||||
|
@ -2961,7 +3068,7 @@ CalibSmootherStatement::checkPass(ModFileStructure &mod_file_struct, WarningCons
|
|||
}
|
||||
|
||||
void
|
||||
CalibSmootherStatement::writeOutput(ostream &output, const string &basename) const
|
||||
CalibSmootherStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
|
@ -2985,10 +3092,15 @@ ExtendedPathStatement::checkPass(ModFileStructure &mod_file_struct, WarningConso
|
|||
cerr << "ERROR: the 'periods' option of 'extended_path' is mandatory" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Fill in option_occbin of mod_file_struct
|
||||
OptionsList::string_options_t::const_iterator it = options_list.num_options.find("occbin");
|
||||
if (it != options_list.string_options.end())
|
||||
mod_file_struct.occbin_option = true;
|
||||
}
|
||||
|
||||
void
|
||||
ExtendedPathStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ExtendedPathStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
// Beware: options do not have the same name in the interface and in the M code...
|
||||
|
||||
|
@ -3007,7 +3119,7 @@ ModelDiagnosticsStatement::ModelDiagnosticsStatement()
|
|||
}
|
||||
|
||||
void
|
||||
ModelDiagnosticsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ModelDiagnosticsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "model_diagnostics(M_,options_,oo_);" << endl;
|
||||
}
|
||||
|
@ -3018,7 +3130,7 @@ Smoother2histvalStatement::Smoother2histvalStatement(const OptionsList &options_
|
|||
}
|
||||
|
||||
void
|
||||
Smoother2histvalStatement::writeOutput(ostream &output, const string &basename) const
|
||||
Smoother2histvalStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output, "options_smoother2histval");
|
||||
output << "smoother2histval(options_smoother2histval);" << endl;
|
||||
|
|
|
@ -35,7 +35,7 @@ private:
|
|||
public:
|
||||
SteadyStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class CheckStatement : public Statement
|
||||
|
@ -45,7 +45,7 @@ private:
|
|||
public:
|
||||
CheckStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SimulStatement : public Statement
|
||||
|
@ -55,7 +55,7 @@ private:
|
|||
public:
|
||||
SimulStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class PerfectForesightSetupStatement : public Statement
|
||||
|
@ -64,7 +64,7 @@ private:
|
|||
const OptionsList options_list;
|
||||
public:
|
||||
PerfectForesightSetupStatement(const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class PerfectForesightSolverStatement : public Statement
|
||||
|
@ -74,7 +74,7 @@ private:
|
|||
public:
|
||||
PerfectForesightSolverStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ModelInfoStatement : public Statement
|
||||
|
@ -84,7 +84,7 @@ private:
|
|||
public:
|
||||
ModelInfoStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class StochSimulStatement : public Statement
|
||||
|
@ -96,7 +96,7 @@ public:
|
|||
StochSimulStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ForecastStatement : public Statement
|
||||
|
@ -107,7 +107,7 @@ private:
|
|||
public:
|
||||
ForecastStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class RamseyModelStatement : public Statement
|
||||
|
@ -119,7 +119,25 @@ public:
|
|||
RamseyModelStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class RamseyConstraintsStatement : public Statement
|
||||
{
|
||||
public:
|
||||
struct Constraint {
|
||||
int endo;
|
||||
BinaryOpcode code;
|
||||
expr_t expression;
|
||||
};
|
||||
typedef vector<Constraint> constraints_t;
|
||||
private:
|
||||
const constraints_t constraints;
|
||||
public:
|
||||
RamseyConstraintsStatement(const constraints_t &constraints_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
// virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
|
||||
};
|
||||
|
||||
class RamseyPolicyStatement : public Statement
|
||||
|
@ -131,7 +149,7 @@ public:
|
|||
RamseyPolicyStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class DiscretionaryPolicyStatement : public Statement
|
||||
|
@ -143,7 +161,7 @@ public:
|
|||
DiscretionaryPolicyStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class RplotStatement : public Statement
|
||||
|
@ -152,14 +170,14 @@ private:
|
|||
const SymbolList symbol_list;
|
||||
public:
|
||||
RplotStatement(const SymbolList &symbol_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class UnitRootVarsStatement : public Statement
|
||||
{
|
||||
public:
|
||||
UnitRootVarsStatement(void);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class PeriodsStatement : public Statement
|
||||
|
@ -168,7 +186,7 @@ private:
|
|||
const int periods;
|
||||
public:
|
||||
PeriodsStatement(int periods_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class DsampleStatement : public Statement
|
||||
|
@ -178,7 +196,7 @@ private:
|
|||
public:
|
||||
DsampleStatement(int val1_arg);
|
||||
DsampleStatement(int val1_arg, int val2_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class EstimationStatement : public Statement
|
||||
|
@ -190,7 +208,7 @@ public:
|
|||
EstimationStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class DynareSensitivityStatement : public Statement
|
||||
|
@ -200,7 +218,7 @@ private:
|
|||
public:
|
||||
DynareSensitivityStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ObservationTrendsStatement : public Statement
|
||||
|
@ -213,7 +231,7 @@ private:
|
|||
public:
|
||||
ObservationTrendsStatement(const trend_elements_t &trend_elements_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class OsrParamsStatement : public Statement
|
||||
|
@ -223,7 +241,7 @@ private:
|
|||
public:
|
||||
OsrParamsStatement(const SymbolList &symbol_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class OsrStatement : public Statement
|
||||
|
@ -235,7 +253,7 @@ public:
|
|||
OsrStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class DynaTypeStatement : public Statement
|
||||
|
@ -246,7 +264,7 @@ private:
|
|||
public:
|
||||
DynaTypeStatement(const SymbolList &symbol_list_arg,
|
||||
const string &filename_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class DynaSaveStatement : public Statement
|
||||
|
@ -257,7 +275,7 @@ private:
|
|||
public:
|
||||
DynaSaveStatement(const SymbolList &symbol_list_arg,
|
||||
const string &filename_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ModelComparisonStatement : public Statement
|
||||
|
@ -270,7 +288,7 @@ private:
|
|||
public:
|
||||
ModelComparisonStatement(const filename_list_t &filename_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
//! Temporary structure used when parsing estimation_params* statements
|
||||
|
@ -309,7 +327,7 @@ public:
|
|||
EstimatedParamsStatement(const vector<EstimationParams> &estim_params_list_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class EstimatedParamsInitStatement : public Statement
|
||||
|
@ -323,7 +341,7 @@ public:
|
|||
const SymbolTable &symbol_table_arg,
|
||||
const bool use_calibration_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class EstimatedParamsBoundsStatement : public Statement
|
||||
|
@ -334,7 +352,7 @@ private:
|
|||
public:
|
||||
EstimatedParamsBoundsStatement(const vector<EstimationParams> &estim_params_list_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class OptimWeightsStatement : public Statement
|
||||
|
@ -351,7 +369,7 @@ public:
|
|||
const covar_weights_t &covar_weights_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
/*! \todo Make model_tree a member instead of a pointer */
|
||||
|
@ -370,7 +388,7 @@ public:
|
|||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
/*! \todo allow for the possibility of disabling temporary terms */
|
||||
virtual void computingPass();
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
//! Return the Planner Objective
|
||||
StaticModel *getPlannerObjective() const;
|
||||
};
|
||||
|
@ -383,7 +401,7 @@ private:
|
|||
public:
|
||||
BVARDensityStatement(int maxnlags_arg, const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class BVARForecastStatement : public Statement
|
||||
|
@ -394,7 +412,7 @@ private:
|
|||
public:
|
||||
BVARForecastStatement(int nlags_arg, const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SBVARStatement : public Statement
|
||||
|
@ -404,7 +422,7 @@ private:
|
|||
public:
|
||||
SBVARStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVAREstimationStatement : public Statement
|
||||
|
@ -414,7 +432,7 @@ private:
|
|||
public:
|
||||
MSSBVAREstimationStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVARSimulationStatement : public Statement
|
||||
|
@ -424,7 +442,7 @@ private:
|
|||
public:
|
||||
MSSBVARSimulationStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVARComputeMDDStatement : public Statement
|
||||
|
@ -434,7 +452,7 @@ private:
|
|||
public:
|
||||
MSSBVARComputeMDDStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVARComputeProbabilitiesStatement : public Statement
|
||||
|
@ -444,7 +462,7 @@ private:
|
|||
public:
|
||||
MSSBVARComputeProbabilitiesStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVARIrfStatement : public Statement
|
||||
|
@ -456,7 +474,7 @@ public:
|
|||
MSSBVARIrfStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVARForecastStatement : public Statement
|
||||
|
@ -466,7 +484,7 @@ private:
|
|||
public:
|
||||
MSSBVARForecastStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MSSBVARVarianceDecompositionStatement : public Statement
|
||||
|
@ -476,7 +494,7 @@ private:
|
|||
public:
|
||||
MSSBVARVarianceDecompositionStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class IdentificationStatement : public Statement
|
||||
|
@ -486,7 +504,7 @@ private:
|
|||
public:
|
||||
IdentificationStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class WriteLatexDynamicModelStatement : public Statement
|
||||
|
@ -495,7 +513,7 @@ private:
|
|||
const DynamicModel &dynamic_model;
|
||||
public:
|
||||
WriteLatexDynamicModelStatement(const DynamicModel &dynamic_model_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class WriteLatexStaticModelStatement : public Statement
|
||||
|
@ -504,7 +522,7 @@ private:
|
|||
const StaticModel &static_model;
|
||||
public:
|
||||
WriteLatexStaticModelStatement(const StaticModel &static_model_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class WriteLatexOriginalModelStatement : public Statement
|
||||
|
@ -513,7 +531,7 @@ private:
|
|||
const DynamicModel &original_model;
|
||||
public:
|
||||
WriteLatexOriginalModelStatement(const DynamicModel &original_model_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ShockDecompositionStatement : public Statement
|
||||
|
@ -524,7 +542,7 @@ private:
|
|||
public:
|
||||
ShockDecompositionStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ConditionalForecastStatement : public Statement
|
||||
|
@ -533,7 +551,7 @@ private:
|
|||
const OptionsList options_list;
|
||||
public:
|
||||
ConditionalForecastStatement(const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class PlotConditionalForecastStatement : public Statement
|
||||
|
@ -544,7 +562,7 @@ private:
|
|||
const SymbolList symbol_list;
|
||||
public:
|
||||
PlotConditionalForecastStatement(int periods_arg, const SymbolList &symbol_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class CalibSmootherStatement : public Statement
|
||||
|
@ -556,7 +574,7 @@ public:
|
|||
CalibSmootherStatement(const SymbolList &symbol_list_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ExtendedPathStatement : public Statement
|
||||
|
@ -566,7 +584,7 @@ private:
|
|||
public:
|
||||
ExtendedPathStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SvarIdentificationStatement : public Statement
|
||||
|
@ -597,7 +615,7 @@ public:
|
|||
const bool &constants_exclusion_present_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MarkovSwitchingStatement : public Statement
|
||||
|
@ -608,7 +626,7 @@ private:
|
|||
public:
|
||||
MarkovSwitchingStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -619,7 +637,7 @@ private:
|
|||
public:
|
||||
SvarStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SetTimeStatement : public Statement
|
||||
|
@ -628,7 +646,7 @@ private:
|
|||
const OptionsList options_list;
|
||||
public:
|
||||
SetTimeStatement(const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class EstimationDataStatement : public Statement
|
||||
|
@ -638,7 +656,7 @@ private:
|
|||
public:
|
||||
EstimationDataStatement(const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SubsamplesStatement : public Statement
|
||||
|
@ -657,7 +675,7 @@ public:
|
|||
const subsample_declaration_map_t subsample_declaration_map_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SubsamplesEqualStatement : public Statement
|
||||
|
@ -674,7 +692,7 @@ public:
|
|||
const string &from_name1_arg,
|
||||
const string &from_name2_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class JointPriorStatement : public Statement
|
||||
|
@ -688,7 +706,7 @@ public:
|
|||
const PriorDistributions &prior_shape_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
void writeOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
|
||||
};
|
||||
|
||||
|
@ -732,7 +750,7 @@ public:
|
|||
const PriorDistributions &prior_shape_arg,
|
||||
const expr_t &variance_arg,
|
||||
const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -747,7 +765,7 @@ public:
|
|||
const expr_t &variance_arg,
|
||||
const OptionsList &options_list_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -765,7 +783,7 @@ public:
|
|||
const OptionsList &options_list_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -793,7 +811,7 @@ public:
|
|||
const SymbolTable &symbol_table_arg);
|
||||
void get_base_name(const SymbolType symb_type, string &lhs_field) const;
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class BasicOptionsStatement : public Statement
|
||||
|
@ -822,7 +840,7 @@ class OptionsStatement : public BasicOptionsStatement
|
|||
{
|
||||
public:
|
||||
OptionsStatement(const string &name_arg, const string &subsample_name_arg, const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -835,7 +853,7 @@ public:
|
|||
const string &subsample_name_arg,
|
||||
const OptionsList &options_list_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -850,7 +868,7 @@ public:
|
|||
const OptionsList &options_list_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -878,14 +896,14 @@ public:
|
|||
const SymbolTable &symbol_table_arg);
|
||||
void get_base_name(const SymbolType symb_type, string &lhs_field) const;
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ModelDiagnosticsStatement : public Statement
|
||||
{
|
||||
public:
|
||||
ModelDiagnosticsStatement();
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class Smoother2histvalStatement : public Statement
|
||||
|
@ -894,7 +912,7 @@ private:
|
|||
const OptionsList options_list;
|
||||
public:
|
||||
Smoother2histvalStatement(const OptionsList &options_list_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3907,13 +3907,13 @@ DynamicModel::writeChainRuleDerivative(ostream &output, int eqr, int varr, int l
|
|||
void
|
||||
DynamicModel::writeLatexFile(const string &basename) const
|
||||
{
|
||||
writeLatexModelFile(basename + "_dynamic.tex", oLatexDynamicModel);
|
||||
writeLatexModelFile(basename + "_dynamic", oLatexDynamicModel);
|
||||
}
|
||||
|
||||
void
|
||||
DynamicModel::writeLatexOriginalFile(const string &basename) const
|
||||
{
|
||||
writeLatexModelFile(basename + "_original.tex", oLatexDynamicModel);
|
||||
writeLatexModelFile(basename + "_original", oLatexDynamicModel);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -83,7 +83,7 @@ class ParsingDriver;
|
|||
}
|
||||
|
||||
%token AIM_SOLVER ANALYTIC_DERIVATION AR AUTOCORR TARB_MODE_COMPUTE
|
||||
%token BAYESIAN_IRF BETA_PDF BLOCK USE_CALIBRATION USE_TARB TARB_NEW_BLOCK_PROBABILITY
|
||||
%token BAYESIAN_IRF BETA_PDF BLOCK USE_CALIBRATION USE_TARB TARB_NEW_BLOCK_PROBABILITY SILENT_OPTIMIZER
|
||||
%token BVAR_DENSITY BVAR_FORECAST NODECOMPOSITION DR_DISPLAY_TOL HUGE_NUMBER
|
||||
%token BVAR_PRIOR_DECAY BVAR_PRIOR_FLAT BVAR_PRIOR_LAMBDA TARB_OPTIM
|
||||
%token BVAR_PRIOR_MU BVAR_PRIOR_OMEGA BVAR_PRIOR_TAU BVAR_PRIOR_TRAIN
|
||||
|
@ -102,7 +102,7 @@ class ParsingDriver;
|
|||
%token <string_val> INT_NUMBER
|
||||
%token INV_GAMMA_PDF INV_GAMMA1_PDF INV_GAMMA2_PDF IRF IRF_SHOCKS IRF_PLOT_THRESHOLD IRF_CALIBRATION
|
||||
%token KALMAN_ALGO KALMAN_TOL DIFFUSE_KALMAN_TOL SUBSAMPLES OPTIONS TOLF
|
||||
%token LAPLACE LIK_ALGO LIK_INIT LINEAR LOAD_IDENT_FILES LOAD_MH_FILE LOAD_PARAMS_AND_STEADY_STATE LOGLINEAR LOGDATA LYAPUNOV
|
||||
%token LAPLACE LIK_ALGO LIK_INIT LINEAR LOAD_IDENT_FILES LOAD_MH_FILE LOAD_PARAMS_AND_STEADY_STATE LOGLINEAR LOGDATA LYAPUNOV LINEAR_APPROXIMATION
|
||||
%token LYAPUNOV_FIXED_POINT_TOL LYAPUNOV_DOUBLING_TOL LYAPUNOV_SQUARE_ROOT_SOLVER_TOL LOG_DEFLATOR LOG_TREND_VAR LOG_GROWTH_FACTOR MARKOWITZ MARGINAL_DENSITY MAX MAXIT
|
||||
%token MFS MH_CONF_SIG MH_DROP MH_INIT_SCALE MH_JSCALE MH_MODE MH_NBLOCKS MH_REPLIC MH_RECOVER POSTERIOR_MAX_SUBSAMPLE_DRAWS MIN MINIMAL_SOLVING_PERIODS
|
||||
%token MODE_CHECK MODE_CHECK_NEIGHBOURHOOD_SIZE MODE_CHECK_SYMMETRIC_PLOTS MODE_CHECK_NUMBER_OF_POINTS MODE_COMPUTE MODE_FILE MODEL MODEL_COMPARISON MODEL_INFO MSHOCKS ABS SIGN
|
||||
|
@ -122,12 +122,12 @@ class ParsingDriver;
|
|||
%token SHOCKS SHOCK_DECOMPOSITION SIGMA_E SIMUL SIMUL_ALGO SIMUL_SEED ENDOGENOUS_TERMINAL_PERIOD
|
||||
%token SMOOTHER SMOOTHER2HISTVAL SQUARE_ROOT_SOLVER STACK_SOLVE_ALGO STEADY_STATE_MODEL SOLVE_ALGO SOLVER_PERIODS
|
||||
%token STDERR STEADY STOCH_SIMUL SURPRISE SYLVESTER SYLVESTER_FIXED_POINT_TOL REGIMES REGIME
|
||||
%token TEX RAMSEY_MODEL RAMSEY_POLICY PLANNER_DISCOUNT DISCRETIONARY_POLICY DISCRETIONARY_TOL
|
||||
%token TEX RAMSEY_MODEL RAMSEY_POLICY RAMSEY_CONSTRAINTS PLANNER_DISCOUNT DISCRETIONARY_POLICY DISCRETIONARY_TOL
|
||||
%token <string_val> TEX_NAME
|
||||
%token UNIFORM_PDF UNIT_ROOT_VARS USE_DLL USEAUTOCORR GSA_SAMPLE_FILE USE_UNIVARIATE_FILTERS_IF_SINGULARITY_IS_DETECTED
|
||||
%token VALUES VAR VAREXO VAREXO_DET VAROBS PREDETERMINED_VARIABLES
|
||||
%token WRITE_LATEX_DYNAMIC_MODEL WRITE_LATEX_STATIC_MODEL WRITE_LATEX_ORIGINAL_MODEL
|
||||
%token XLS_SHEET XLS_RANGE LONG_NAME
|
||||
%token XLS_SHEET XLS_RANGE LONG_NAME LMMCP OCCBIN
|
||||
%left COMMA
|
||||
%left EQUAL_EQUAL EXCLAMATION_EQUAL
|
||||
%left LESS GREATER LESS_EQUAL GREATER_EQUAL
|
||||
|
@ -239,7 +239,8 @@ statement : parameters
|
|||
| planner_objective
|
||||
| ramsey_model
|
||||
| ramsey_policy
|
||||
| discretionary_policy
|
||||
| ramsey_constraints
|
||||
| discretionary_policy
|
||||
| bvar_density
|
||||
| bvar_forecast
|
||||
| sbvar
|
||||
|
@ -1010,7 +1011,10 @@ perfect_foresight_solver_options : o_stack_solve_algo
|
|||
| o_minimal_solving_periods
|
||||
| o_simul_maxit
|
||||
| o_endogenous_terminal_period
|
||||
| o_linear_approximation
|
||||
| o_no_homotopy
|
||||
| o_lmmcp
|
||||
| o_occbin
|
||||
;
|
||||
|
||||
simul : SIMUL ';'
|
||||
|
@ -1095,6 +1099,7 @@ stoch_simul_primary_options : o_dr_algo
|
|||
| o_dr_logarithmic_reduction_maxiter
|
||||
| o_irf_plot_threshold
|
||||
| o_dr_display_tol
|
||||
| o_tex
|
||||
;
|
||||
|
||||
stoch_simul_options : stoch_simul_primary_options
|
||||
|
@ -1655,6 +1660,7 @@ estimation_options : o_datafile
|
|||
| o_nodecomposition
|
||||
| o_nodiagnostic
|
||||
| o_bayesian_irf
|
||||
| o_relative_irf
|
||||
| o_dsge_var
|
||||
| o_dsge_varlag
|
||||
| o_irf
|
||||
|
@ -1719,6 +1725,7 @@ estimation_options : o_datafile
|
|||
| o_tarb_mode_compute
|
||||
| o_tarb_new_block_probability
|
||||
| o_tarb_optim
|
||||
| o_silent_optimizer
|
||||
| o_proposal_distribution
|
||||
| o_student_degrees_of_freedom
|
||||
;
|
||||
|
@ -1788,6 +1795,7 @@ osr_options : stoch_simul_primary_options
|
|||
| o_opt_algo
|
||||
| o_optim
|
||||
| o_huge_number
|
||||
| o_silent_optimizer
|
||||
;
|
||||
|
||||
osr : OSR ';'
|
||||
|
@ -1903,6 +1911,24 @@ ramsey_policy : RAMSEY_POLICY ';'
|
|||
{ driver.ramsey_policy(); }
|
||||
;
|
||||
|
||||
ramsey_constraints : RAMSEY_CONSTRAINTS ';' ramsey_constraints_list END ';'
|
||||
{ driver.add_ramsey_constraints_statement(); }
|
||||
;
|
||||
|
||||
ramsey_constraints_list : ramsey_constraints_list ramsey_constraint
|
||||
| ramsey_constraint
|
||||
;
|
||||
|
||||
ramsey_constraint : NAME LESS expression ';'
|
||||
{ driver.ramsey_constraint_add_less($1,$3); }
|
||||
| NAME GREATER expression ';'
|
||||
{ driver.ramsey_constraint_add_greater($1,$3); }
|
||||
| NAME LESS_EQUAL expression ';'
|
||||
{ driver.ramsey_constraint_add_less_equal($1,$3); }
|
||||
| NAME GREATER_EQUAL expression ';'
|
||||
{ driver.ramsey_constraint_add_greater_equal($1,$3); }
|
||||
;
|
||||
|
||||
discretionary_policy : DISCRETIONARY_POLICY ';'
|
||||
{ driver.discretionary_policy(); }
|
||||
| DISCRETIONARY_POLICY '(' discretionary_policy_options_list ')' ';'
|
||||
|
@ -2434,6 +2460,8 @@ extended_path_option : o_periods
|
|||
| o_solver_periods
|
||||
| o_extended_path_order
|
||||
| o_hybrid
|
||||
| o_lmmcp
|
||||
| o_occbin
|
||||
;
|
||||
|
||||
model_diagnostics : MODEL_DIAGNOSTICS ';'
|
||||
|
@ -2650,6 +2678,7 @@ o_mh_mode : MH_MODE EQUAL INT_NUMBER { driver.option_num("mh_mode", $3); };
|
|||
o_mh_nblocks : MH_NBLOCKS EQUAL INT_NUMBER { driver.option_num("mh_nblck", $3); };
|
||||
o_load_mh_file : LOAD_MH_FILE { driver.option_num("load_mh_file", "1"); };
|
||||
o_loglinear : LOGLINEAR { driver.option_num("loglinear", "1"); };
|
||||
o_linear_approximation : LINEAR_APPROXIMATION { driver.option_num("linear_approximation", "1"); };
|
||||
o_logdata : LOGDATA { driver.option_num("logdata", "1"); };
|
||||
o_nodiagnostic : NODIAGNOSTIC { driver.option_num("nodiagnostic", "1"); };
|
||||
o_bayesian_irf : BAYESIAN_IRF { driver.option_num("bayesian_irf", "1"); };
|
||||
|
@ -2894,6 +2923,7 @@ o_equations : EQUATIONS EQUAL vec_int
|
|||
o_use_tarb : USE_TARB { driver.option_num("TaRB.use_TaRB", "1"); };
|
||||
o_tarb_mode_compute : TARB_MODE_COMPUTE EQUAL INT_NUMBER { driver.option_num("TaRB.mode_compute", $3); };
|
||||
o_tarb_new_block_probability : TARB_NEW_BLOCK_PROBABILITY EQUAL non_negative_number {driver.option_num("TaRB.new_block_probability",$3); };
|
||||
o_silent_optimizer : SILENT_OPTIMIZER { driver.option_num("silent_optimizer", "1"); };
|
||||
o_instruments : INSTRUMENTS EQUAL '(' symbol_list ')' {driver.option_symbol_list("instruments"); };
|
||||
|
||||
o_ext_func_name : EXT_FUNC_NAME EQUAL filename { driver.external_function_option("name", $3); };
|
||||
|
@ -3001,6 +3031,8 @@ o_invars : INVARS EQUAL '(' symbol_list ')' { driver.option_symbol_list("invars"
|
|||
o_period : PERIOD EQUAL INT_NUMBER { driver.option_num("period", $3); };
|
||||
o_outfile : OUTFILE EQUAL filename { driver.option_str("outfile", $3); };
|
||||
o_outvars : OUTVARS EQUAL '(' symbol_list ')' { driver.option_symbol_list("outvars"); };
|
||||
o_lmmcp : LMMCP {driver.option_num("lmmcp", "1"); };
|
||||
o_occbin : OCCBIN {driver.option_num("occbin", "1"); };
|
||||
|
||||
range : symbol ':' symbol
|
||||
{
|
||||
|
|
|
@ -199,6 +199,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
|
|||
<INITIAL>svar_identification {BEGIN DYNARE_BLOCK; return token::SVAR_IDENTIFICATION;}
|
||||
<INITIAL>moment_calibration {BEGIN DYNARE_BLOCK; return token::MOMENT_CALIBRATION;}
|
||||
<INITIAL>irf_calibration {BEGIN DYNARE_BLOCK; return token::IRF_CALIBRATION;}
|
||||
<INITIAL>ramsey_constraints {BEGIN DYNARE_BLOCK; return token::RAMSEY_CONSTRAINTS;}
|
||||
|
||||
/* For the semicolon after an "end" keyword */
|
||||
<INITIAL>; {return Dynare::parser::token_type (yytext[0]);}
|
||||
|
@ -285,6 +286,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
|
|||
<DYNARE_STATEMENT>mh_nblocks {return token::MH_NBLOCKS;}
|
||||
<DYNARE_STATEMENT>load_mh_file {return token::LOAD_MH_FILE;}
|
||||
<DYNARE_STATEMENT>loglinear {return token::LOGLINEAR;}
|
||||
<DYNARE_STATEMENT>linear_approximation {return token::LINEAR_APPROXIMATION;}
|
||||
<DYNARE_STATEMENT>logdata {return token::LOGDATA;}
|
||||
<DYNARE_STATEMENT>nodiagnostic {return token::NODIAGNOSTIC;}
|
||||
<DYNARE_STATEMENT>kalman_algo {return token::KALMAN_ALGO;}
|
||||
|
@ -575,6 +577,9 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
|
|||
<DYNARE_STATEMENT>tarb_mode_compute {return token::TARB_MODE_COMPUTE;}
|
||||
<DYNARE_STATEMENT>tarb_new_block_probability {return token::TARB_NEW_BLOCK_PROBABILITY;}
|
||||
<DYNARE_STATEMENT>tarb_optim {return token::TARB_OPTIM;}
|
||||
<DYNARE_STATEMENT>silent_optimizer {return token::SILENT_OPTIMIZER;}
|
||||
<DYNARE_STATEMENT>lmmcp {return token::LMMCP;}
|
||||
<DYNARE_STATEMENT>occbin {return token::OCCBIN;}
|
||||
|
||||
<DYNARE_STATEMENT>[\$][^$]*[\$] {
|
||||
strtok(yytext+1, "$");
|
||||
|
@ -816,11 +821,11 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
|
|||
}
|
||||
<VERBATIM_BLOCK>\n {
|
||||
if (strlen(yytext) > 1)
|
||||
driver.add_native_remove_charset(yytext, "\n");
|
||||
driver.add_verbatim_remove_charset(yytext, "\n");
|
||||
}
|
||||
<VERBATIM_BLOCK>. { yymore(); }
|
||||
<VERBATIM_BLOCK><<EOF>> {
|
||||
driver.add_native(eofbuff);
|
||||
driver.add_verbatim(eofbuff);
|
||||
yyterminate();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -38,7 +38,7 @@
|
|||
void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool clear_global, bool no_tmp_terms, bool no_log, bool no_warn,
|
||||
bool warn_uninit, bool console, bool nograph, bool nointeractive,
|
||||
bool parallel, const string ¶llel_config_file, const string &cluster_name, bool parallel_slave_open_mode,
|
||||
bool parallel_test, bool nostrict, bool check_model_changes, FileOutputType output_mode, LanguageOutputType lang
|
||||
bool parallel_test, bool nostrict, bool check_model_changes, bool minimal_workspace, FileOutputType output_mode, LanguageOutputType lang
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
, bool cygwin, bool msvc
|
||||
#endif
|
||||
|
@ -48,8 +48,8 @@ void
|
|||
usage()
|
||||
{
|
||||
cerr << "Dynare usage: dynare mod_file [debug] [noclearall] [onlyclearglobals] [savemacro[=macro_file]] [onlymacro] [nolinemacro] [notmpterms] [nolog] [warn_uninit]"
|
||||
<< " [console] [nograph] [nointeractive] [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test] "
|
||||
<< " [-D<variable>[=<value>]] [nostrict] [fast] [output=dynamic|first|second|third] [language=C|C++]"
|
||||
<< " [console] [nograph] [nointeractive] [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test]"
|
||||
<< " [-D<variable>[=<value>]] [nostrict] [fast] [minimal_workspace] [output=dynamic|first|second|third] [language=C|C++]"
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
<< " [cygwin] [msvc]"
|
||||
#endif
|
||||
|
@ -98,6 +98,7 @@ main(int argc, char **argv)
|
|||
bool parallel_test = false;
|
||||
bool nostrict = false;
|
||||
bool check_model_changes = false;
|
||||
bool minimal_workspace = false;
|
||||
map<string, string> defines;
|
||||
FileOutputType output_mode = none;
|
||||
LanguageOutputType language = matlab;
|
||||
|
@ -168,6 +169,8 @@ main(int argc, char **argv)
|
|||
nostrict = true;
|
||||
else if (!strcmp(argv[arg], "fast"))
|
||||
check_model_changes = true;
|
||||
else if (!strcmp(argv[arg], "minimal_workspace"))
|
||||
minimal_workspace = true;
|
||||
else if (strlen(argv[arg]) >= 8 && !strncmp(argv[arg], "parallel", 8))
|
||||
{
|
||||
parallel = true;
|
||||
|
@ -288,7 +291,8 @@ main(int argc, char **argv)
|
|||
|
||||
// Do the rest
|
||||
main2(macro_output, basename, debug, clear_all, clear_global, no_tmp_terms, no_log, no_warn, warn_uninit, console, nograph, nointeractive,
|
||||
parallel, parallel_config_file, cluster_name, parallel_slave_open_mode, parallel_test, nostrict, check_model_changes, output_mode, language
|
||||
parallel, parallel_config_file, cluster_name, parallel_slave_open_mode, parallel_test, nostrict, check_model_changes, minimal_workspace,
|
||||
output_mode, language
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
, cygwin, msvc
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2008-2014 Dynare Team
|
||||
* Copyright (C) 2008-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -27,7 +27,7 @@
|
|||
void
|
||||
main2(stringstream &in, string &basename, bool debug, bool clear_all, bool clear_global, bool no_tmp_terms, bool no_log, bool no_warn, bool warn_uninit, bool console, bool nograph, bool nointeractive,
|
||||
bool parallel, const string ¶llel_config_file, const string &cluster_name, bool parallel_slave_open_mode,
|
||||
bool parallel_test, bool nostrict, bool check_model_changes, FileOutputType output_mode, LanguageOutputType language
|
||||
bool parallel_test, bool nostrict, bool check_model_changes, bool minimal_workspace, FileOutputType output_mode, LanguageOutputType language
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
, bool cygwin, bool msvc
|
||||
#endif
|
||||
|
@ -61,7 +61,7 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool clear
|
|||
mod_file->writeExternalFiles(basename, output_mode, language);
|
||||
else
|
||||
mod_file->writeOutputFiles(basename, clear_all, clear_global, no_log, no_warn, console, nograph,
|
||||
nointeractive, config_file, check_model_changes
|
||||
nointeractive, config_file, check_model_changes, minimal_workspace
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
, cygwin, msvc
|
||||
#endif
|
||||
|
|
|
@ -2356,7 +2356,7 @@ UnaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpNo
|
|||
//Arriving here, we need to create an auxiliary variable for this Expectation Operator:
|
||||
//AUX_EXPECT_(LEAD/LAG)_(period)_(arg.idx) OR
|
||||
//AUX_EXPECT_(info_set_name)_(arg.idx)
|
||||
int symb_id = datatree.symbol_table.addExpectationAuxiliaryVar(expectation_information_set, arg->idx);
|
||||
int symb_id = datatree.symbol_table.addExpectationAuxiliaryVar(expectation_information_set, arg->idx, arg);
|
||||
expr_t newAuxE = datatree.AddVariable(symb_id, 0);
|
||||
|
||||
if (partial_information_model && expectation_information_set == 0)
|
||||
|
|
16
ModFile.cc
16
ModFile.cc
|
@ -406,6 +406,7 @@ ModFile::transformPass(bool nostrict)
|
|||
*/
|
||||
if (!(mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present)
|
||||
&& !(mod_file_struct.bvar_present && dynamic_model.equation_number() == 0)
|
||||
&& !(mod_file_struct.occbin_option)
|
||||
&& (dynamic_model.equation_number() != symbol_table.endo_nbr()))
|
||||
{
|
||||
cerr << "ERROR: There are " << dynamic_model.equation_number() << " equations but " << symbol_table.endo_nbr() << " endogenous variables!" << endl;
|
||||
|
@ -526,8 +527,9 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output)
|
|||
}
|
||||
|
||||
void
|
||||
ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_log, bool no_warn, bool console, bool nograph,
|
||||
bool nointeractive, const ConfigFile &config_file, bool check_model_changes
|
||||
ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_log, bool no_warn,
|
||||
bool console, bool nograph, bool nointeractive, const ConfigFile &config_file,
|
||||
bool check_model_changes, bool minimal_workspace
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
, bool cygwin, bool msvc
|
||||
#endif
|
||||
|
@ -542,8 +544,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
|
|||
mOutputFile.open(fname.c_str(), ios::out | ios::binary);
|
||||
if (!mOutputFile.is_open())
|
||||
{
|
||||
cerr << "ERROR: Can't open file " << fname
|
||||
<< " for writing" << endl;
|
||||
cerr << "ERROR: Can't open file " << fname << " for writing" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
@ -554,7 +555,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
|
|||
}
|
||||
|
||||
mOutputFile << "%" << endl
|
||||
<< "% Status : main Dynare file " << endl
|
||||
<< "% Status : main Dynare file" << endl
|
||||
<< "%" << endl
|
||||
<< "% Warning : this file is generated automatically by Dynare" << endl
|
||||
<< "% from model file (.mod)" << endl << endl;
|
||||
|
@ -587,6 +588,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
|
|||
if (!no_log)
|
||||
mOutputFile << "diary('" << basename << ".log');" << endl;
|
||||
|
||||
if (minimal_workspace)
|
||||
mOutputFile << "options_.minimal_workspace = 1;" << endl;
|
||||
|
||||
if (console)
|
||||
mOutputFile << "options_.console_mode = 1;" << endl
|
||||
<< "options_.nodisplay = 1;" << endl;
|
||||
|
@ -740,7 +744,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
|
|||
for (vector<Statement *>::const_iterator it = statements.begin();
|
||||
it != statements.end(); it++)
|
||||
{
|
||||
(*it)->writeOutput(mOutputFile, basename);
|
||||
(*it)->writeOutput(mOutputFile, basename, minimal_workspace);
|
||||
|
||||
/* Special treatment for initval block: insert initial values for the
|
||||
auxiliary variables and initialize exo det */
|
||||
|
|
|
@ -146,7 +146,8 @@ public:
|
|||
\param msvc Should the MEX command of use_dll be adapted for MSVC?
|
||||
*/
|
||||
void writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_log, bool no_warn,
|
||||
bool console, bool nograph, bool nointeractive, const ConfigFile &config_file, bool check_model_changes
|
||||
bool console, bool nograph, bool nointeractive, const ConfigFile &config_file,
|
||||
bool check_model_changes, bool minimal_workspace
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
, bool cygwin, bool msvc
|
||||
#endif
|
||||
|
|
34
ModelTree.cc
34
ModelTree.cc
|
@ -1339,9 +1339,12 @@ ModelTree::Write_Inf_To_Bin_File(const string &basename,
|
|||
}
|
||||
|
||||
void
|
||||
ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output_type) const
|
||||
ModelTree::writeLatexModelFile(const string &basename, ExprNodeOutputType output_type) const
|
||||
{
|
||||
ofstream output;
|
||||
ofstream output, content_output;
|
||||
string filename = basename + ".tex";
|
||||
string content_basename = basename + "_content";
|
||||
string content_filename = content_basename + ".tex";
|
||||
output.open(filename.c_str(), ios::out | ios::binary);
|
||||
if (!output.is_open())
|
||||
{
|
||||
|
@ -1349,6 +1352,13 @@ ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
content_output.open(content_filename.c_str(), ios::out | ios::binary);
|
||||
if (!content_output.is_open())
|
||||
{
|
||||
cerr << "ERROR: Can't open file " << content_filename << " for writing" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
output << "\\documentclass[10pt,a4paper]{article}" << endl
|
||||
<< "\\usepackage[landscape]{geometry}" << endl
|
||||
<< "\\usepackage{fullpage}" << endl
|
||||
|
@ -1364,25 +1374,27 @@ ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output
|
|||
int id = it->first;
|
||||
expr_t value = it->second;
|
||||
|
||||
output << "\\begin{dmath*}" << endl
|
||||
<< symbol_table.getName(id) << " = ";
|
||||
content_output << "\\begin{dmath*}" << endl
|
||||
<< symbol_table.getName(id) << " = ";
|
||||
// Use an empty set for the temporary terms
|
||||
value->writeOutput(output, output_type);
|
||||
output << endl << "\\end{dmath*}" << endl;
|
||||
value->writeOutput(content_output, output_type);
|
||||
content_output << endl << "\\end{dmath*}" << endl;
|
||||
}
|
||||
|
||||
for (int eq = 0; eq < (int) equations.size(); eq++)
|
||||
{
|
||||
output << "\\begin{dmath}" << endl
|
||||
<< "% Equation " << eq+1 << endl;
|
||||
content_output << "\\begin{dmath}" << endl
|
||||
<< "% Equation " << eq+1 << endl;
|
||||
// Here it is necessary to cast to superclass ExprNode, otherwise the overloaded writeOutput() method is not found
|
||||
dynamic_cast<ExprNode *>(equations[eq])->writeOutput(output, output_type);
|
||||
output << endl << "\\end{dmath}" << endl;
|
||||
dynamic_cast<ExprNode *>(equations[eq])->writeOutput(content_output, output_type);
|
||||
content_output << endl << "\\end{dmath}" << endl;
|
||||
}
|
||||
|
||||
output << "\\end{document}" << endl;
|
||||
output << "\\include{" << content_basename << "}" << endl
|
||||
<< "\\end{document}" << endl;
|
||||
|
||||
output.close();
|
||||
content_output.close();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -183,7 +183,7 @@ protected:
|
|||
void compileModelEquations(ostream &code_file, unsigned int &instruction_number, const temporary_terms_t &tt, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic) const;
|
||||
|
||||
//! Writes LaTeX model file
|
||||
void writeLatexModelFile(const string &filename, ExprNodeOutputType output_type) const;
|
||||
void writeLatexModelFile(const string &basename, ExprNodeOutputType output_type) const;
|
||||
|
||||
//! Sparse matrix of double to store the values of the Jacobian
|
||||
/*! First index is equation number, second index is endogenous type specific ID */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -41,13 +41,14 @@ InitParamStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolid
|
|||
}
|
||||
|
||||
void
|
||||
InitParamStatement::writeOutput(ostream &output, const string &basename) const
|
||||
InitParamStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
int id = symbol_table.getTypeSpecificID(symb_id) + 1;
|
||||
output << "M_.params( " << id << " ) = ";
|
||||
param_value->writeOutput(output);
|
||||
output << ";" << endl;
|
||||
output << symbol_table.getName(symb_id) << " = M_.params( " << id << " );\n";
|
||||
if (!minimal_workspace)
|
||||
output << symbol_table.getName(symb_id) << " = M_.params( " << id << " );" << endl;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -186,7 +187,7 @@ InitValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
|
|||
}
|
||||
|
||||
void
|
||||
InitValStatement::writeOutput(ostream &output, const string &basename) const
|
||||
InitValStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% INITVAL instructions" << endl
|
||||
|
@ -242,7 +243,7 @@ EndValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidati
|
|||
}
|
||||
|
||||
void
|
||||
EndValStatement::writeOutput(ostream &output, const string &basename) const
|
||||
EndValStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% ENDVAL instructions" << endl
|
||||
|
@ -268,7 +269,7 @@ HistValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
|
|||
}
|
||||
|
||||
void
|
||||
HistValStatement::writeOutput(ostream &output, const string &basename) const
|
||||
HistValStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% HISTVAL instructions" << endl
|
||||
|
@ -326,7 +327,7 @@ InitvalFileStatement::InitvalFileStatement(const string &filename_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
InitvalFileStatement::writeOutput(ostream &output, const string &basename) const
|
||||
InitvalFileStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% INITVAL_FILE statement" << endl
|
||||
|
@ -341,7 +342,7 @@ HistvalFileStatement::HistvalFileStatement(const string &filename_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
HistvalFileStatement::writeOutput(ostream &output, const string &basename) const
|
||||
HistvalFileStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "histvalf('" << filename << "');" << endl;
|
||||
}
|
||||
|
@ -354,7 +355,7 @@ HomotopyStatement::HomotopyStatement(const homotopy_values_t &homotopy_values_ar
|
|||
}
|
||||
|
||||
void
|
||||
HomotopyStatement::writeOutput(ostream &output, const string &basename) const
|
||||
HomotopyStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% HOMOTOPY_SETUP instructions" << endl
|
||||
|
@ -388,7 +389,7 @@ SaveParamsAndSteadyStateStatement::SaveParamsAndSteadyStateStatement(const strin
|
|||
}
|
||||
|
||||
void
|
||||
SaveParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SaveParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "save_params_and_steady_state('" << filename << "');" << endl;
|
||||
}
|
||||
|
@ -429,7 +430,7 @@ LoadParamsAndSteadyStateStatement::LoadParamsAndSteadyStateStatement(const strin
|
|||
}
|
||||
|
||||
void
|
||||
LoadParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename) const
|
||||
LoadParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
for (map<int, string>::const_iterator it = content.begin();
|
||||
it != content.end(); it++)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
InitParamStatement(int symb_id_arg, const expr_t param_value_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
//! Fill eval context with parameter value
|
||||
void fillEvalContext(eval_context_t &eval_context) const;
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
const SymbolTable &symbol_table_arg,
|
||||
const bool &all_values_required_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
//! Writes initializations for oo_.exo_simul and oo_.exo_det_simul
|
||||
void writeOutputPostInit(ostream &output) const;
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
const bool &all_values_required_arg);
|
||||
//! Workaround for trac ticket #35
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class HistValStatement : public Statement
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
const SymbolTable &symbol_table_arg);
|
||||
//! Workaround for trac ticket #157
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class InitvalFileStatement : public Statement
|
||||
|
@ -119,7 +119,7 @@ private:
|
|||
const string filename;
|
||||
public:
|
||||
InitvalFileStatement(const string &filename_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class HistvalFileStatement : public Statement
|
||||
|
@ -128,7 +128,7 @@ private:
|
|||
const string filename;
|
||||
public:
|
||||
HistvalFileStatement(const string &filename_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class HomotopyStatement : public Statement
|
||||
|
@ -143,7 +143,7 @@ private:
|
|||
public:
|
||||
HomotopyStatement(const homotopy_values_t &homotopy_values_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class SaveParamsAndSteadyStateStatement : public Statement
|
||||
|
@ -152,7 +152,7 @@ private:
|
|||
const string filename;
|
||||
public:
|
||||
SaveParamsAndSteadyStateStatement(const string &filename_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class LoadParamsAndSteadyStateStatement : public Statement
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
LoadParamsAndSteadyStateStatement(const string &filename,
|
||||
const SymbolTable &symbol_table_arg,
|
||||
WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
//! Fill eval context with parameters/variables values
|
||||
void fillEvalContext(eval_context_t &eval_context) const;
|
||||
};
|
||||
|
|
|
@ -2586,6 +2586,23 @@ ParsingDriver::add_native_remove_charset(const char *s, const string &token)
|
|||
add_native(str);
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::add_verbatim(const string &s)
|
||||
{
|
||||
mod_file->addStatement(new VerbatimStatement(s));
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::add_verbatim_remove_charset(const char *s, const string &token)
|
||||
{
|
||||
string str = string(s);
|
||||
size_t found = str.find(token);
|
||||
|
||||
assert(found != string::npos);
|
||||
str.resize(found);
|
||||
add_verbatim(str);
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::begin_steady_state_model()
|
||||
{
|
||||
|
@ -2772,3 +2789,54 @@ ParsingDriver::perfect_foresight_solver()
|
|||
mod_file->addStatement(new PerfectForesightSolverStatement(options_list));
|
||||
options_list.clear();
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::add_ramsey_constraints_statement()
|
||||
{
|
||||
mod_file->addStatement(new RamseyConstraintsStatement(ramsey_constraints));
|
||||
ramsey_constraints.clear();
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::ramsey_constraint_add_less(const string *name, const expr_t rhs)
|
||||
{
|
||||
add_ramsey_constraint(name,oLess,rhs);
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::ramsey_constraint_add_greater(const string *name, const expr_t rhs)
|
||||
{
|
||||
add_ramsey_constraint(name,oGreater,rhs);
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::ramsey_constraint_add_less_equal(const string *name, const expr_t rhs)
|
||||
{
|
||||
add_ramsey_constraint(name,oLessEqual,rhs);
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::ramsey_constraint_add_greater_equal(const string *name, const expr_t rhs)
|
||||
{
|
||||
add_ramsey_constraint(name,oGreaterEqual,rhs);
|
||||
}
|
||||
|
||||
void
|
||||
ParsingDriver::add_ramsey_constraint(const string *name, BinaryOpcode op_code, const expr_t rhs)
|
||||
{
|
||||
check_symbol_existence(*name);
|
||||
int symb_id = mod_file->symbol_table.getID(*name);
|
||||
SymbolType type = mod_file->symbol_table.getType(symb_id);
|
||||
|
||||
if (type != eEndogenous)
|
||||
error("ramsey_constraints: " + *name + " should be an endogenous variable");
|
||||
|
||||
RamseyConstraintsStatement::Constraint C;
|
||||
C.endo = symb_id;
|
||||
C.code = op_code;
|
||||
C.expression = rhs;
|
||||
ramsey_constraints.push_back(C);
|
||||
|
||||
delete name;
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,8 @@ private:
|
|||
MomentCalibration::constraints_t moment_calibration_constraints;
|
||||
//! Temporary storage for irf_calibration
|
||||
IrfCalibration::constraints_t irf_calibration_constraints;
|
||||
//! Temporary storage for ramsey_constraints
|
||||
RamseyConstraintsStatement::constraints_t ramsey_constraints;
|
||||
//! Temporary storage for svar_identification blocks
|
||||
SvarIdentificationStatement::svar_identification_restrictions_t svar_ident_restrictions;
|
||||
//! Temporary storage for mapping the equation number to the restrictions within an svar_identification block
|
||||
|
@ -506,6 +508,18 @@ public:
|
|||
void end_planner_objective(expr_t expr);
|
||||
//! Ramsey model statement
|
||||
void ramsey_model();
|
||||
//! Ramsey constraints statement
|
||||
void add_ramsey_constraints_statement();
|
||||
//! Ramsey less constraint
|
||||
void ramsey_constraint_add_less(const string *name, const expr_t rhs);
|
||||
//! Ramsey greater constraint
|
||||
void ramsey_constraint_add_greater(const string *name, const expr_t rhs);
|
||||
//! Ramsey less or equal constraint
|
||||
void ramsey_constraint_add_less_equal(const string *name, const expr_t rhs);
|
||||
//! Ramsey greater or equal constraint
|
||||
void ramsey_constraint_add_greater_equal(const string *name, const expr_t rhs);
|
||||
//! Ramsey constraint helper function
|
||||
void add_ramsey_constraint(const string *name, BinaryOpcode op_code, const expr_t rhs);
|
||||
//! Ramsey policy statement
|
||||
void ramsey_policy();
|
||||
//! Discretionary policy statement
|
||||
|
@ -644,6 +658,10 @@ public:
|
|||
void add_native(const string &s);
|
||||
//! Adds a native statement, first removing the set of characters passed in token (and everything after)
|
||||
void add_native_remove_charset(const char *s, const string &token);
|
||||
//! Adds a verbatim statement
|
||||
void add_verbatim(const string &s);
|
||||
//! Adds a verbatim statement, first removing the set of characters passed in token (and everything after)
|
||||
void add_verbatim_remove_charset(const char *s, const string &token);
|
||||
//! Resets data_tree and model_tree pointers to default (i.e. mod_file->expressions_tree)
|
||||
void reset_data_tree();
|
||||
//! Begin a steady_state_model block
|
||||
|
|
12
Shocks.cc
12
Shocks.cc
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ ShocksStatement::ShocksStatement(bool overwrite_arg,
|
|||
}
|
||||
|
||||
void
|
||||
ShocksStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ShocksStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% SHOCKS instructions" << endl
|
||||
|
@ -340,7 +340,7 @@ MShocksStatement::MShocksStatement(bool overwrite_arg,
|
|||
}
|
||||
|
||||
void
|
||||
MShocksStatement::writeOutput(ostream &output, const string &basename) const
|
||||
MShocksStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% MSHOCKS instructions" << endl
|
||||
|
@ -380,7 +380,7 @@ ConditionalForecastPathsStatement::checkPass(ModFileStructure &mod_file_struct,
|
|||
}
|
||||
|
||||
void
|
||||
ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &basename) const
|
||||
ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
assert(path_length > 0);
|
||||
output << "constrained_vars_ = [];" << endl
|
||||
|
@ -420,7 +420,7 @@ MomentCalibration::MomentCalibration(const constraints_t &constraints_arg,
|
|||
}
|
||||
|
||||
void
|
||||
MomentCalibration::writeOutput(ostream &output, const string &basename) const
|
||||
MomentCalibration::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_.endogenous_prior_restrictions.moment = {" << endl;
|
||||
for (size_t i = 0; i < constraints.size(); i++)
|
||||
|
@ -442,7 +442,7 @@ IrfCalibration::IrfCalibration(const constraints_t &constraints_arg,
|
|||
}
|
||||
|
||||
void
|
||||
IrfCalibration::writeOutput(ostream &output, const string &basename) const
|
||||
IrfCalibration::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << "options_.endogenous_prior_restrictions.irf = {" << endl;
|
||||
for (size_t i = 0; i < constraints.size(); i++)
|
||||
|
|
12
Shocks.hh
12
Shocks.hh
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
const covar_and_corr_shocks_t &covar_shocks_arg,
|
||||
const covar_and_corr_shocks_t &corr_shocks_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
};
|
||||
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
MShocksStatement(bool overwrite_arg,
|
||||
const det_shocks_t &det_shocks_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class ConditionalForecastPathsStatement : public Statement
|
||||
|
@ -98,7 +98,7 @@ private:
|
|||
public:
|
||||
ConditionalForecastPathsStatement(const AbstractShocksStatement::det_shocks_t &paths_arg);
|
||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class MomentCalibration : public Statement
|
||||
|
@ -117,7 +117,7 @@ private:
|
|||
public:
|
||||
MomentCalibration(const constraints_t &constraints_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class IrfCalibration : public Statement
|
||||
|
@ -136,7 +136,7 @@ private:
|
|||
public:
|
||||
IrfCalibration(const constraints_t &constraints_arg,
|
||||
const SymbolTable &symbol_table_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2010 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -59,7 +59,7 @@ SigmaeStatement::determineMatrixForm(const matrix_t &matrix) throw (MatrixFormEx
|
|||
}
|
||||
|
||||
void
|
||||
SigmaeStatement::writeOutput(ostream &output, const string &basename) const
|
||||
SigmaeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
size_t ic, ic1, ir, ir1;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2010 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -57,7 +57,7 @@ private:
|
|||
|
||||
public:
|
||||
SigmaeStatement(const matrix_t &matrix_arg) throw (MatrixFormException);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
18
Statement.cc
18
Statement.cc
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2014 Dynare Team
|
||||
* Copyright (C) 2006-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -50,7 +50,8 @@ ModFileStructure::ModFileStructure() :
|
|||
estimation_data_statement_present(false),
|
||||
last_markov_switching_chain(0),
|
||||
calib_smoother_present(false),
|
||||
estim_params_use_calib(false)
|
||||
estim_params_use_calib(false),
|
||||
occbin_option(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -79,7 +80,7 @@ NativeStatement::NativeStatement(const string &native_statement_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
NativeStatement::writeOutput(ostream &output, const string &basename) const
|
||||
NativeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
using namespace boost::xpressive;
|
||||
string date_regex = "(-?\\d+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4]\\d|5[0-2])))";
|
||||
|
@ -91,6 +92,17 @@ NativeStatement::writeOutput(ostream &output, const string &basename) const
|
|||
output << ns << endl;
|
||||
}
|
||||
|
||||
VerbatimStatement::VerbatimStatement(const string &verbatim_statement_arg) :
|
||||
verbatim_statement(verbatim_statement_arg)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VerbatimStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
output << verbatim_statement << endl;
|
||||
}
|
||||
|
||||
void
|
||||
OptionsList::writeOutput(ostream &output) const
|
||||
{
|
||||
|
|
17
Statement.hh
17
Statement.hh
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2014 Dynare Team
|
||||
* Copyright (C) 2006-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -116,6 +116,8 @@ public:
|
|||
bool corr_options_statement_present;
|
||||
//! Whether a Markov Switching DSGE is present
|
||||
bool ms_dsge_present;
|
||||
//! Whether occbin is present
|
||||
bool occbin_option;
|
||||
};
|
||||
|
||||
class Statement
|
||||
|
@ -134,7 +136,7 @@ public:
|
|||
\param output is the output stream of the main matlab file
|
||||
\param basename is the name of the modfile (without extension) which can be used to build auxiliary files
|
||||
*/
|
||||
virtual void writeOutput(ostream &output, const string &basename) const = 0;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const = 0;
|
||||
virtual void writeCOutput(ostream &output, const string &basename);
|
||||
};
|
||||
|
||||
|
@ -144,7 +146,16 @@ private:
|
|||
const string native_statement;
|
||||
public:
|
||||
NativeStatement(const string &native_statement_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class VerbatimStatement : public Statement
|
||||
{
|
||||
private:
|
||||
const string verbatim_statement;
|
||||
public:
|
||||
VerbatimStatement(const string &verbatim_statement_arg);
|
||||
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
||||
};
|
||||
|
||||
class OptionsList
|
||||
|
|
|
@ -1893,7 +1893,7 @@ StaticModel::writeChainRuleDerivative(ostream &output, int eqr, int varr, int la
|
|||
void
|
||||
StaticModel::writeLatexFile(const string &basename) const
|
||||
{
|
||||
writeLatexModelFile(basename + "_static.tex", oLatexStaticModel);
|
||||
writeLatexModelFile(basename + "_static", oLatexStaticModel);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -25,12 +25,15 @@
|
|||
#include "SymbolTable.hh"
|
||||
|
||||
AuxVarInfo::AuxVarInfo(int symb_id_arg, aux_var_t type_arg, int orig_symb_id_arg, int orig_lead_lag_arg,
|
||||
int equation_number_for_multiplier_arg) :
|
||||
int equation_number_for_multiplier_arg, int information_set_arg,
|
||||
expr_t expectation_expr_node_arg) :
|
||||
symb_id(symb_id_arg),
|
||||
type(type_arg),
|
||||
orig_symb_id(orig_symb_id_arg),
|
||||
orig_lead_lag(orig_lead_lag_arg),
|
||||
equation_number_for_multiplier(equation_number_for_multiplier_arg)
|
||||
equation_number_for_multiplier(equation_number_for_multiplier_arg),
|
||||
information_set(information_set_arg),
|
||||
expectation_expr_node(expectation_expr_node_arg)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -243,7 +246,6 @@ SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException)
|
|||
{
|
||||
case avEndoLead:
|
||||
case avExoLead:
|
||||
case avExpectation:
|
||||
break;
|
||||
case avEndoLag:
|
||||
case avExoLag:
|
||||
|
@ -256,6 +258,13 @@ SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException)
|
|||
case avDiffForward:
|
||||
output << "M_.aux_vars(" << i+1 << ").orig_index = " << getTypeSpecificID(aux_vars[i].get_orig_symb_id())+1 << ";" << endl;
|
||||
break;
|
||||
case avExpectation:
|
||||
output << "M_.aux_vars(" << i+1 << ").orig_expr = '\\mathbb{E}_{t"
|
||||
<< (aux_vars[i].get_information_set() < 0 ? "" : "+")
|
||||
<< aux_vars[i].get_information_set() << "}(";
|
||||
aux_vars[i].get_expectation_expr_node()->writeOutput(output, oLatexDynamicModel);
|
||||
output << ")';" << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -468,7 +477,7 @@ SymbolTable::addLeadAuxiliaryVarInternal(bool endo, int index) throw (FrozenExce
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, (endo ? avEndoLead : avExoLead), 0, 0, 0));
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, (endo ? avEndoLead : avExoLead), 0, 0, 0, 0, NULL));
|
||||
|
||||
return symb_id;
|
||||
}
|
||||
|
@ -494,7 +503,7 @@ SymbolTable::addLagAuxiliaryVarInternal(bool endo, int orig_symb_id, int orig_le
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, (endo ? avEndoLag : avExoLag), orig_symb_id, orig_lead_lag, 0));
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, (endo ? avEndoLag : avExoLag), orig_symb_id, orig_lead_lag, 0, 0, NULL));
|
||||
|
||||
return symb_id;
|
||||
}
|
||||
|
@ -524,7 +533,7 @@ SymbolTable::addExoLagAuxiliaryVar(int orig_symb_id, int orig_lead_lag) throw (F
|
|||
}
|
||||
|
||||
int
|
||||
SymbolTable::addExpectationAuxiliaryVar(int information_set, int index) throw (FrozenException)
|
||||
SymbolTable::addExpectationAuxiliaryVar(int information_set, int index, expr_t exp_arg) throw (FrozenException)
|
||||
{
|
||||
ostringstream varname;
|
||||
int symb_id;
|
||||
|
@ -542,7 +551,7 @@ SymbolTable::addExpectationAuxiliaryVar(int information_set, int index) throw (F
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, avExpectation, 0, 0, 0));
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, avExpectation, 0, 0, 0, information_set, exp_arg));
|
||||
|
||||
return symb_id;
|
||||
}
|
||||
|
@ -564,7 +573,7 @@ SymbolTable::addMultiplierAuxiliaryVar(int index) throw (FrozenException)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, avMultiplier, 0, 0, index));
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, avMultiplier, 0, 0, index, 0, NULL));
|
||||
return symb_id;
|
||||
}
|
||||
|
||||
|
@ -585,7 +594,7 @@ SymbolTable::addDiffForwardAuxiliaryVar(int orig_symb_id) throw (FrozenException
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, avDiffForward, orig_symb_id, 0, 0));
|
||||
aux_vars.push_back(AuxVarInfo(symb_id, avDiffForward, orig_symb_id, 0, 0, 0, NULL));
|
||||
return symb_id;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Dynare Team
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -29,6 +29,9 @@ using namespace std;
|
|||
#include <ostream>
|
||||
|
||||
#include "CodeInterpreter.hh"
|
||||
#include "ExprNode.hh"
|
||||
|
||||
typedef class ExprNode *expr_t;
|
||||
|
||||
//! Types of auxiliary variables
|
||||
enum aux_var_t
|
||||
|
@ -51,13 +54,17 @@ private:
|
|||
int orig_symb_id; //!< Symbol ID of the endo of the original model represented by this aux var. Only used for avEndoLag and avExoLag.
|
||||
int orig_lead_lag; //!< Lead/lag of the endo of the original model represented by this aux var. Only used for avEndoLag and avExoLag.
|
||||
int equation_number_for_multiplier; //!< Stores the original constraint equation number associated with this aux var. Only used for avMultiplier.
|
||||
int information_set; //! Argument of expectation operator. Only used for avExpectation.
|
||||
expr_t expectation_expr_node; //! Argument of expectation operator. Only used for avExpectation.
|
||||
public:
|
||||
AuxVarInfo(int symb_id_arg, aux_var_t type_arg, int orig_symb_id, int orig_lead_lag, int equation_number_for_multiplier_arg);
|
||||
AuxVarInfo(int symb_id_arg, aux_var_t type_arg, int orig_symb_id, int orig_lead_lag, int equation_number_for_multiplier_arg, int information_set_arg, expr_t expectation_expr_node_arg);
|
||||
int get_symb_id() const { return symb_id; };
|
||||
aux_var_t get_type() const { return type; };
|
||||
int get_orig_symb_id() const { return orig_symb_id; };
|
||||
int get_orig_lead_lag() const { return orig_lead_lag; };
|
||||
int get_equation_number_for_multiplier() const { return equation_number_for_multiplier; };
|
||||
int get_information_set() const { return information_set; };
|
||||
expr_t get_expectation_expr_node() const { return expectation_expr_node; } ;
|
||||
};
|
||||
|
||||
//! Stores the symbol table
|
||||
|
@ -216,7 +223,7 @@ public:
|
|||
\param[in] index Used to construct the variable name
|
||||
\return the symbol ID of the new symbol
|
||||
*/
|
||||
int addExpectationAuxiliaryVar(int information_set, int index) throw (FrozenException);
|
||||
int addExpectationAuxiliaryVar(int information_set, int index, expr_t arg) throw (FrozenException);
|
||||
//! Adds an auxiliary variable for the multiplier for the FOCs of the Ramsey Problem
|
||||
/*!
|
||||
\param[in] index Used to construct the variable name
|
||||
|
|
Loading…
Reference in New Issue