From d0c0f552e3439c7af4cbb5a14d4f0d7cafffa8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 13 Sep 2024 17:27:27 +0200 Subject: [PATCH] =?UTF-8?q?Manual:=20fix=20documentation=20of=20=E2=80=9Cn?= =?UTF-8?q?oclearall=E2=80=9D=20and=20=E2=80=9Conlyclearglobals=E2=80=9D?= =?UTF-8?q?=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (manually cherry picked from commit de780c322c2d4ecd099e5d48bdc6450c83d31bcb) --- doc/manual/source/running-dynare.rst | 25 +++++++++++-------------- matlab/dynare.m | 2 -- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/doc/manual/source/running-dynare.rst b/doc/manual/source/running-dynare.rst index 983e2aa076..c1a2850558 100644 --- a/doc/manual/source/running-dynare.rst +++ b/doc/manual/source/running-dynare.rst @@ -125,23 +125,20 @@ by the ``dynare`` command. .. option:: noclearall - By default, ``dynare`` will issue a ``clear all`` command to - MATLAB (<R2015b) or Octave, thereby deleting all workspace - variables and functions; this option instructs ``dynare`` not - to clear the workspace. Note that starting with MATLAB 2015b - ``dynare`` only deletes the global variables and the functions - using persistent variables, in order to benefit from the JIT - (Just In Time) compilation. In this case the option instructs - ``dynare`` not to clear the globals and functions. + By default, ``dynare`` deletes all the global variables and the + functions using persistent variables, in order to benefit from the JIT + (just-in-time) compilation. This option instructs ``dynare`` not to + clear those. .. option:: onlyclearglobals - By default, ``dynare`` will issue a ``clear all`` command to - MATLAB versions before 2015b and to Octave, thereby deleting - all workspace variables; this option instructs ``dynare`` to - clear only the global variables (i.e. ``M_, options_, oo_, - estim_params_, bayestopt_``, and ``dataset_``), leaving the - other variables in the workspace. + By default, ``dynare`` deletes all the global variables and the + functions using persistent variables, in order to benefit from the JIT + (just-in-time) compilation. This option instructs ``dynare`` to clear + only its own global variables (*i.e.* ``M_, options_, oo_, + estim_params_, bayestopt_``, ``dataset_``, ``dataset_info`` and + ``estimation_info``), leaving the other variables in the workspace, and + not clearing functions using persistent variables. .. option:: debug diff --git a/matlab/dynare.m b/matlab/dynare.m index ff01c28521..ef85aec916 100644 --- a/matlab/dynare.m +++ b/matlab/dynare.m @@ -301,8 +301,6 @@ if ~ isempty(find(abs(fname) == 46)) fname = fname(:,1:find(abs(fname) == 46)-1) ; end -% We need to clear the driver (and only the driver, because the "clear all" -% within the driver will clean the rest) clear(['+' fname '/driver']) try -- GitLab