diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc index 8f65bc0a..9d87b446 100644 --- a/src/ComputingTasks.cc +++ b/src/ComputingTasks.cc @@ -2202,9 +2202,9 @@ PlannerObjectiveStatement::getPlannerObjective() const } void -PlannerObjectiveStatement::computingPass() +PlannerObjectiveStatement::computingPass(const ModFileStructure &mod_file_struct) { - model_tree.computingPass(3, 0, {}, false, false, false); + model_tree.computingPass(max(3, mod_file_struct.order_option), 0, {}, false, false, false); computing_pass_called = true; } diff --git a/src/ComputingTasks.hh b/src/ComputingTasks.hh index d86cb4bc..96ae1627 100644 --- a/src/ComputingTasks.hh +++ b/src/ComputingTasks.hh @@ -517,7 +517,7 @@ public: (no exogenous, no lead/lag) */ void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override; /*! \todo allow for the possibility of disabling temporary terms */ - void computingPass() override; + void computingPass(const ModFileStructure &mod_file_struct) override; void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override; void writeJsonOutput(ostream &output) const override; //! Return a reference the Planner Objective model tree diff --git a/src/ModFile.cc b/src/ModFile.cc index 0a13ace9..55f59f66 100644 --- a/src/ModFile.cc +++ b/src/ModFile.cc @@ -840,7 +840,7 @@ ModFile::computingPass(bool no_tmp_terms, OutputType output, int params_derivs_o } for (auto &statement : statements) - statement->computingPass(); + statement->computingPass(mod_file_struct); // Compute epilogue derivatives (but silence standard output) streambuf *oldcout = cout.rdbuf(); diff --git a/src/Statement.cc b/src/Statement.cc index 85c6d235..c18b404b 100644 --- a/src/Statement.cc +++ b/src/Statement.cc @@ -30,7 +30,7 @@ Statement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &wa } void -Statement::computingPass() +Statement::computingPass(const ModFileStructure &mod_file_struct) { } diff --git a/src/Statement.hh b/src/Statement.hh index dc4cf190..8988441d 100644 --- a/src/Statement.hh +++ b/src/Statement.hh @@ -164,7 +164,7 @@ public: method. Otherwise the default implementation (i.e. a no-op) will apply and some checks won't be run. */ virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings); - virtual void computingPass(); + virtual void computingPass(const ModFileStructure &mod_file_struct); //! Write Matlab output code /*! \param output is the output stream of the main matlab file