diff --git a/src/ModelEquationBlock.hh b/src/ModelEquationBlock.hh index aedf9e61ce9980339509bcdc8ced7859ee89d903..f90ab4761e5ffeb5bc89db8bc033a8fdfd06ea34 100644 --- a/src/ModelEquationBlock.hh +++ b/src/ModelEquationBlock.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2010-2023 Dynare Team + * Copyright © 2010-2025 Dynare Team * * This file is part of Dynare. * @@ -58,6 +58,17 @@ protected: { return "original Ramsey model"; } + int + getJacobianCol(int deriv_id, [[maybe_unused]] bool sparse) const override + { + /* Override the DynamicModel method by returning a dummy Jacobian column number. + The override is necessary because the method from DynamicModel fails with + endos with lag/lead greater than 1 or exos with a lag/lead, while substitutions + are by definition not done for an original model. + In particular, this fixes dynare#1960 (equation derivatives are computed for models declared + as linear, to check whether they are truly linear). */ + return deriv_id; + } }; class SteadyStateModel : public DataTree