preprocessor: remove unnecessary stuff ("forecast" has not the same rank than "stoch_simul/estimation/osr/ramsey_policy")
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3062 ac1d8469-bf42-47a9-8791-bf33cf982152issue#70
parent
8e8a6d74d7
commit
2761b4c016
|
@ -138,17 +138,6 @@ ForecastStatement::ForecastStatement(const SymbolList &symbol_list_arg,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ForecastStatement::checkPass(ModFileStructure &mod_file_struct)
|
|
||||||
{
|
|
||||||
mod_file_struct.forecast_present = true;
|
|
||||||
|
|
||||||
// Fill in option_order of mod_file_struct
|
|
||||||
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
|
|
||||||
if (it != options_list.num_options.end())
|
|
||||||
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ForecastStatement::writeOutput(ostream &output, const string &basename) const
|
ForecastStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -88,7 +88,6 @@ private:
|
||||||
public:
|
public:
|
||||||
ForecastStatement(const SymbolList &symbol_list_arg,
|
ForecastStatement(const SymbolList &symbol_list_arg,
|
||||||
const OptionsList &options_list_arg);
|
const OptionsList &options_list_arg);
|
||||||
virtual void checkPass(ModFileStructure &mod_file_struct);
|
|
||||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,6 @@ ModFile::checkPass()
|
||||||
|
|
||||||
bool stochastic_statement_present = mod_file_struct.stoch_simul_present
|
bool stochastic_statement_present = mod_file_struct.stoch_simul_present
|
||||||
|| mod_file_struct.estimation_present
|
|| mod_file_struct.estimation_present
|
||||||
|| mod_file_struct.forecast_present
|
|
||||||
|| mod_file_struct.osr_present
|
|| mod_file_struct.osr_present
|
||||||
|| mod_file_struct.ramsey_policy_present;
|
|| mod_file_struct.ramsey_policy_present;
|
||||||
|
|
||||||
|
@ -114,7 +113,7 @@ ModFile::checkPass()
|
||||||
|
|
||||||
if (mod_file_struct.simul_present && stochastic_statement_present)
|
if (mod_file_struct.simul_present && stochastic_statement_present)
|
||||||
{
|
{
|
||||||
cerr << "ERROR: A .mod file cannot contain both a simul command and one of {stoch_simul, estimation, forecast, osr, ramsey_policy}" << endl;
|
cerr << "ERROR: A .mod file cannot contain both a simul command and one of {stoch_simul, estimation, osr, ramsey_policy}" << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +136,6 @@ ModFile::transformPass()
|
||||||
// In stochastic models, create auxiliary vars for leads and lags greater than 2
|
// In stochastic models, create auxiliary vars for leads and lags greater than 2
|
||||||
if (mod_file_struct.stoch_simul_present
|
if (mod_file_struct.stoch_simul_present
|
||||||
|| mod_file_struct.estimation_present
|
|| mod_file_struct.estimation_present
|
||||||
|| mod_file_struct.forecast_present
|
|
||||||
|| mod_file_struct.osr_present
|
|| mod_file_struct.osr_present
|
||||||
|| mod_file_struct.ramsey_policy_present)
|
|| mod_file_struct.ramsey_policy_present)
|
||||||
{
|
{
|
||||||
|
@ -172,7 +170,7 @@ ModFile::computingPass(bool no_tmp_terms)
|
||||||
{
|
{
|
||||||
// Mod file may have no equation (for example in a standalone BVAR estimation)
|
// Mod file may have no equation (for example in a standalone BVAR estimation)
|
||||||
bool dynamic_model_needed = mod_file_struct.simul_present || mod_file_struct.check_present || mod_file_struct.stoch_simul_present
|
bool dynamic_model_needed = mod_file_struct.simul_present || mod_file_struct.check_present || mod_file_struct.stoch_simul_present
|
||||||
|| mod_file_struct.estimation_present|| mod_file_struct.forecast_present || mod_file_struct.osr_present
|
|| mod_file_struct.estimation_present|| mod_file_struct.osr_present
|
||||||
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present;
|
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present;
|
||||||
if (dynamic_model.equation_number() > 0)
|
if (dynamic_model.equation_number() > 0)
|
||||||
{
|
{
|
||||||
|
@ -219,7 +217,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all) const
|
||||||
{
|
{
|
||||||
ofstream mOutputFile;
|
ofstream mOutputFile;
|
||||||
bool dynamic_model_needed = mod_file_struct.simul_present || mod_file_struct.check_present || mod_file_struct.stoch_simul_present
|
bool dynamic_model_needed = mod_file_struct.simul_present || mod_file_struct.check_present || mod_file_struct.stoch_simul_present
|
||||||
|| mod_file_struct.estimation_present|| mod_file_struct.forecast_present || mod_file_struct.osr_present
|
|| mod_file_struct.estimation_present|| mod_file_struct.osr_present
|
||||||
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present;
|
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present;
|
||||||
|
|
||||||
if (basename.size())
|
if (basename.size())
|
||||||
|
|
|
@ -24,7 +24,6 @@ ModFileStructure::ModFileStructure() :
|
||||||
simul_present(false),
|
simul_present(false),
|
||||||
stoch_simul_present(false),
|
stoch_simul_present(false),
|
||||||
estimation_present(false),
|
estimation_present(false),
|
||||||
forecast_present(false),
|
|
||||||
osr_present(false),
|
osr_present(false),
|
||||||
ramsey_policy_present(false),
|
ramsey_policy_present(false),
|
||||||
order_option(0),
|
order_option(0),
|
||||||
|
|
|
@ -40,13 +40,11 @@ public:
|
||||||
bool stoch_simul_present;
|
bool stoch_simul_present;
|
||||||
//! Whether an estimation statement is present
|
//! Whether an estimation statement is present
|
||||||
bool estimation_present;
|
bool estimation_present;
|
||||||
//! Whether a forecast statement is present
|
|
||||||
bool forecast_present;
|
|
||||||
//! Whether an osr statement is present
|
//! Whether an osr statement is present
|
||||||
bool osr_present;
|
bool osr_present;
|
||||||
//! Whether a ramsey_policy statement is present
|
//! Whether a ramsey_policy statement is present
|
||||||
bool ramsey_policy_present;
|
bool ramsey_policy_present;
|
||||||
//! The value of the "order" option of stoch_simul, estimation, forecast, osr, ramsey_policy
|
//! The value of the "order" option of stoch_simul, estimation, osr, ramsey_policy
|
||||||
//! Derivation order
|
//! Derivation order
|
||||||
/*! First initialized to zero. If user sets order option somewhere in the MOD file, it will be equal to the maximum of order options. Otherwise will default to 2 */
|
/*! First initialized to zero. If user sets order option somewhere in the MOD file, it will be equal to the maximum of order options. Otherwise will default to 2 */
|
||||||
int order_option;
|
int order_option;
|
||||||
|
|
Loading…
Reference in New Issue