From 61cd43b3beb6078118a41e20174eb8fb98c5051b Mon Sep 17 00:00:00 2001
From: Michel Juillard <michel.juillard@mjui.fr>
Date: Sun, 20 Nov 2011 20:16:02 +0100
Subject: [PATCH] unit_root_vars now sets the options_.diffuse_filter and
 options_.steadystate.nocheck

---
 preprocessor/ComputingTasks.cc | 11 +++++++++++
 preprocessor/ComputingTasks.hh |  7 +++++++
 preprocessor/ParsingDriver.cc  |  3 ++-
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index 5e34a655a..060624505 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -371,6 +371,17 @@ RplotStatement::writeOutput(ostream &output, const string &basename) const
   output << "rplot(var_list_);\n";
 }
 
+UnitRootVarsStatement::UnitRootVarsStatement(void)
+{
+}
+
+void
+UnitRootVarsStatement::writeOutput(ostream &output, const string &basename) const
+{
+  output << "options_.diffuse_filter = 1;" << endl
+	 << "options_.steadystate.nocheck = 1;" << endl;
+}
+
 PeriodsStatement::PeriodsStatement(int periods_arg) : periods(periods_arg)
 {
 }
diff --git a/preprocessor/ComputingTasks.hh b/preprocessor/ComputingTasks.hh
index 3f66bd03b..2c7a0e869 100644
--- a/preprocessor/ComputingTasks.hh
+++ b/preprocessor/ComputingTasks.hh
@@ -126,6 +126,13 @@ public:
   virtual void writeOutput(ostream &output, const string &basename) const;
 };
 
+class UnitRootVarsStatement : public Statement
+{
+public:
+  UnitRootVarsStatement(void);
+  virtual void writeOutput(ostream &output, const string &basename) const;
+};
+
 class PeriodsStatement : public Statement
 {
 private:
diff --git a/preprocessor/ParsingDriver.cc b/preprocessor/ParsingDriver.cc
index eff84af44..73fc785fc 100644
--- a/preprocessor/ParsingDriver.cc
+++ b/preprocessor/ParsingDriver.cc
@@ -1179,7 +1179,8 @@ ParsingDriver::estimated_params_bounds()
 void
 ParsingDriver::set_unit_root_vars()
 {
-  warning("'unit_root_vars' is now obsolete and has no effect; use option 'diffuse_filter' of 'estimation' instead");
+  mod_file->addStatement(new UnitRootVarsStatement());
+  warning("'unit_root_vars' is now obsolete; use option 'diffuse_filter' of 'estimation' instead");
   symbol_list.clear();
 }
 
-- 
GitLab