From 114d8eadfb3dee24ab65f291253076c4d0ea83c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 7 Feb 2023 14:44:28 -0500
Subject: [PATCH] =?UTF-8?q?New=20=E2=80=9Chomotopy=5Falt=5Fstarting=5Fpoin?=
 =?UTF-8?q?t=E2=80=9D=20option=20to=20=E2=80=9Cperfect=5Fforesight=5Fsolve?=
 =?UTF-8?q?r=E2=80=9D=20command?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/DynareBison.yy | 4 +++-
 src/DynareFlex.ll  | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/DynareBison.yy b/src/DynareBison.yy
index d82aafa2..c505d866 100644
--- a/src/DynareBison.yy
+++ b/src/DynareBison.yy
@@ -189,7 +189,7 @@ class ParsingDriver;
 %token TOL_RANK TOL_DERIV TOL_SV CHECKS_VIA_SUBSETS MAX_DIM_SUBSETS_GROUPS ZERO_MOMENTS_TOLERANCE
 %token MAX_NROWS SQUEEZE_SHOCK_DECOMPOSITION WITH_EPILOGUE MODEL_REMOVE MODEL_REPLACE MODEL_OPTIONS
 %token VAR_REMOVE ESTIMATED_PARAMS_REMOVE BLOCK_STATIC BLOCK_DYNAMIC INCIDENCE RESID NON_ZERO LEARNT_IN PLUS_EQUAL TIMES_EQUAL
-%token FSOLVE_OPTIONS
+%token FSOLVE_OPTIONS HOMOTOPY_ALT_STARTING_POINT
 
 %token <vector<string>> SYMBOL_VEC
 
@@ -1437,6 +1437,7 @@ perfect_foresight_solver_options : o_stack_solve_algo
                                  | o_endogenous_terminal_period
                                  | o_linear_approximation
                                  | o_no_homotopy
+                                 | o_homotopy_alt_starting_point
                                  | o_solve_algo
                                  | o_robust_lin_solve
                                  | o_lmmcp
@@ -4047,6 +4048,7 @@ o_consider_all_endogenous : CONSIDER_ALL_ENDOGENOUS { driver.option_str("endo_va
 o_consider_all_endogenous_and_auxiliary : CONSIDER_ALL_ENDOGENOUS_AND_AUXILIARY { driver.option_str("endo_vars_for_moment_computations_in_estimation", "all_endogenous_and_auxiliary_variables"); };
 o_consider_only_observed : CONSIDER_ONLY_OBSERVED { driver.option_str("endo_vars_for_moment_computations_in_estimation", "only_observed_variables"); };
 o_no_homotopy : NO_HOMOTOPY { driver.option_num("no_homotopy", "true"); };
+o_homotopy_alt_starting_point : HOMOTOPY_ALT_STARTING_POINT { driver.option_num("homotopy_alt_starting_point", "true"); };
 
 o_infile : INFILE EQUAL filename { driver.option_str("infile", $3); };
 o_invars : INVARS EQUAL '(' symbol_list ')' { driver.option_symbol_list("invars", $4); };
diff --git a/src/DynareFlex.ll b/src/DynareFlex.ll
index 40884519..3d0641d0 100644
--- a/src/DynareFlex.ll
+++ b/src/DynareFlex.ll
@@ -880,6 +880,7 @@ DATE -?[0-9]+([ya]|m([1-9]|1[0-2])|q[1-4])
 <DYNARE_STATEMENT>calibration {return token::CALIBRATION;}
 <DYNARE_STATEMENT>irf_plot_threshold {return token::IRF_PLOT_THRESHOLD;}
 <DYNARE_STATEMENT>no_homotopy {return token::NO_HOMOTOPY;}
+<DYNARE_STATEMENT>homotopy_alt_starting_point {return token::HOMOTOPY_ALT_STARTING_POINT;}
 <DYNARE_STATEMENT>particle_filter_options {return token::PARTICLE_FILTER_OPTIONS;}
 <DYNARE_STATEMENT>terminal_steady_state_as_guess_value {return token::TERMINAL_STEADY_STATE_AS_GUESS_VALUE;}
 <DYNARE_STATEMENT>constant_simulation_length {return token::CONSTANT_SIMULATION_LENGTH;}
-- 
GitLab