🐛 Incorrect cost table used when computing temporary terms in static model with “use_dll”

It was erroneously using MATLAB costs, leading to possible
inefficiencies (though those cost tables are probably not very accurate and
should be revised).
master
Sébastien Villemot 2023-03-27 17:20:34 +02:00
parent 42ea2aac34
commit a8fc8e7afc
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
4 changed files with 5 additions and 5 deletions

View File

@ -2442,7 +2442,7 @@ PlannerObjectiveStatement::getPlannerObjective() const
void
PlannerObjectiveStatement::computingPass(const ModFileStructure &mod_file_struct)
{
model_tree.computingPass(max(3, mod_file_struct.order_option), 0, {}, false, false);
model_tree.computingPass(max(3, mod_file_struct.order_option), 0, {}, false, false, false);
computing_pass_called = true;
}

View File

@ -672,7 +672,7 @@ ModFile::computingPass(bool no_tmp_terms, OutputType output, int params_derivs_o
|| (mod_file_struct.GMM_present && (mod_file_struct.analytic_standard_errors_present || mod_file_struct.analytic_jacobian_present)))
paramsDerivsOrder = params_derivs_order;
static_model.computingPass(derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block);
static_model.computingPass(derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, use_dll);
}
// Set things to compute for dynamic model
if (mod_file_struct.perfect_foresight_solver_present

View File

@ -170,7 +170,7 @@ StaticModel::writeStaticBlockBytecode(const string &basename) const
}
void
StaticModel::computingPass(int derivsOrder, int paramsDerivsOrder, const eval_context_t &eval_context, bool no_tmp_terms, bool block)
StaticModel::computingPass(int derivsOrder, int paramsDerivsOrder, const eval_context_t &eval_context, bool no_tmp_terms, bool block, bool use_dll)
{
initializeVariablesAndEquations();
@ -222,7 +222,7 @@ StaticModel::computingPass(int derivsOrder, int paramsDerivsOrder, const eval_co
computeParamsDerivatives(paramsDerivsOrder);
}
computeTemporaryTerms(true, no_tmp_terms);
computeTemporaryTerms(!use_dll, no_tmp_terms);
if (paramsDerivsOrder > 0 && !no_tmp_terms)
computeParamsDerivativesTemporaryTerms();

View File

@ -122,7 +122,7 @@ public:
\param derivsOrder order of derivation with respect to endogenous
\param paramsDerivsOrder order of derivatives w.r. to a pair (endogenous, parameter) to be computed
*/
void computingPass(int derivsOrder, int paramsDerivsOrder, const eval_context_t &eval_context, bool no_tmp_terms, bool block);
void computingPass(int derivsOrder, int paramsDerivsOrder, const eval_context_t &eval_context, bool no_tmp_terms, bool block, bool use_dll);
//! Writes static model file (+ bytecode)
void writeStaticFile(const string &basename, bool use_dll, const string &mexext, const filesystem::path &matlabroot, bool julia) const;