From 9372796b0552b442f2f363cdc987001f4824c779 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 13 Feb 2025 17:34:36 +0100
Subject: [PATCH] =?UTF-8?q?Allow=20MATLAB/Octave=20vectors=20in=20?=
 =?UTF-8?q?=E2=80=9Cconditional=5Fforecast=5Fpaths=E2=80=9D=20block?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ref. dynare#1949
---
 src/Shocks.cc | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/Shocks.cc b/src/Shocks.cc
index 6a80a84c..3c33baf2 100644
--- a/src/Shocks.cc
+++ b/src/Shocks.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2003-2024 Dynare Team
+ * Copyright © 2003-2025 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -881,12 +881,9 @@ ConditionalForecastPathsStatement::writeOutput(ostream& output,
       for (const auto& [period_range, value] : elems)
         {
           auto [period1, period2] = get<pair<int, int>>(period_range);
-          for (int j = period1; j <= period2; j++)
-            {
-              output << "constrained_paths_(" << k << "," << j << ")=";
-              value->writeOutput(output);
-              output << ";" << endl;
-            }
+          output << "constrained_paths_(" << k << "," << period1 << ":" << period2 << ")=";
+          value->writeOutput(output);
+          output << ";" << endl;
         }
       k++;
     }
-- 
GitLab