From cc02690acffc335ea31f20d2963f9257c65c7d90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 5 Jan 2024 16:08:09 +0100
Subject: [PATCH] Forbid alternative 1st order solvers with k_order_solver
 option

---
 matlab/stochastic_solver/k_order_pert.m | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/matlab/stochastic_solver/k_order_pert.m b/matlab/stochastic_solver/k_order_pert.m
index 28946e0026..573c76e166 100644
--- a/matlab/stochastic_solver/k_order_pert.m
+++ b/matlab/stochastic_solver/k_order_pert.m
@@ -1,7 +1,7 @@
 function [dr,info] = k_order_pert(dr,M_,options_)
 % Compute decision rules using the k-order DLL from Dynare++
 
-% Copyright © 2009-2023 Dynare Team
+% Copyright © 2009-2024 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -30,6 +30,16 @@ if M_.maximum_endo_lead == 0 && order>1
            'backward models'])
 end
 
+if options_.aim_solver
+    error('Option aim_solver is not compatible with k_order_solver')
+end
+if options_.dr_cycle_reduction
+    error('Option dr=cycle_reduction is not compatible with k_order_solver')
+end
+if options_.dr_logarithmic_reduction
+    error('Option dr=logarithmic_reduction is not compatible with k_order_solver')
+end
+
 try
     [dynpp_derivs, dyn_derivs] = k_order_perturbation(dr,M_,options_);
 catch ME
-- 
GitLab