When order option > 3, compute planner objective derivatives at that order

Ref. dynare!1866
issue#70
Sébastien Villemot 2021-06-04 16:20:29 +02:00
parent 04f242f971
commit 86b2b4c2da
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
5 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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();

View File

@ -30,7 +30,7 @@ Statement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &wa
}
void
Statement::computingPass()
Statement::computingPass(const ModFileStructure &mod_file_struct)
{
}

View File

@ -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