Do not write bytecode for discretionary optimal policy models
Those models do not have as many variables as equations, and this case is not
supported by bytecode.
The present commit is an improvement over commit
a8ea57dd63
, which had already removed bytecode
for the planner objective model.
master
parent
ef57a28b5f
commit
dec60b25e6
|
@ -2453,7 +2453,10 @@ DynamicModel::writeDynamicFile(const string &basename, bool use_dll, const strin
|
|||
writeDynamicMFile(basename);
|
||||
// The legacy representation is no longer produced for Julia
|
||||
|
||||
writeDynamicBytecode(basename);
|
||||
/* Discretionary optimal policy models don’t have as many variables as
|
||||
equations; bytecode does not support that case */
|
||||
if (static_cast<int>(equations.size()) == symbol_table.endo_nbr())
|
||||
writeDynamicBytecode(basename);
|
||||
if (block_decomposed)
|
||||
writeDynamicBlockBytecode(basename);
|
||||
|
||||
|
|
|
@ -37,12 +37,6 @@ PlannerObjective::computingPassBlock([[maybe_unused]] const eval_context_t &eval
|
|||
// Disable block decomposition on planner objective
|
||||
}
|
||||
|
||||
void
|
||||
PlannerObjective::writeStaticBytecode([[maybe_unused]] const string &basename) const
|
||||
{
|
||||
// Disable bytecode output, because there are not as many variables as equations
|
||||
}
|
||||
|
||||
OrigRamseyDynamicModel::OrigRamseyDynamicModel(SymbolTable &symbol_table_arg,
|
||||
NumericalConstants &num_constants_arg,
|
||||
ExternalFunctionsTable &external_functions_table_arg,
|
||||
|
|
|
@ -41,7 +41,6 @@ protected:
|
|||
|
||||
private:
|
||||
void computingPassBlock(const eval_context_t &eval_context, bool no_tmp_terms) override;
|
||||
void writeStaticBytecode(const string &basename) const override;
|
||||
};
|
||||
|
||||
class OrigRamseyDynamicModel : public DynamicModel
|
||||
|
|
|
@ -475,7 +475,11 @@ StaticModel::writeStaticFile(const string &basename, bool use_dll, const string
|
|||
writeStaticMFile(basename);
|
||||
// The legacy representation is no longer produced for Julia
|
||||
|
||||
writeStaticBytecode(basename);
|
||||
/* PlannerObjective subclass or discretionary optimal policy models don’t
|
||||
have as many variables as equations; bytecode does not support that
|
||||
case */
|
||||
if (static_cast<int>(equations.size()) == symbol_table.endo_nbr())
|
||||
writeStaticBytecode(basename);
|
||||
if (block_decomposed)
|
||||
writeStaticBlockBytecode(basename);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ private:
|
|||
void writeStaticBlockBytecode(const string &basename) const;
|
||||
|
||||
//! Writes the code of the model in virtual machine bytecode
|
||||
virtual void writeStaticBytecode(const string &basename) const;
|
||||
void writeStaticBytecode(const string &basename) const;
|
||||
|
||||
//! Computes jacobian and prepares for equation normalization
|
||||
/*! Using values from initval/endval blocks and parameter initializations:
|
||||
|
|
Loading…
Reference in New Issue