changeset 22643:fb8b23754d76 stable

Remove useless persistent declarations in ode23, ode45. * ode23.m, ode45.m: Remove persistent attribute from variables defaults, classes, attributes. * odedefaults.m: Write calculation of MaxStep as (tf - t0) which is more intuitive.
author Rik <rik@octave.org>
date Wed, 19 Oct 2016 09:54:44 -0700
parents 18dd44e56815
children 23941beb44cd
files scripts/ode/ode23.m scripts/ode/ode45.m scripts/ode/private/odedefaults.m
diffstat 3 files changed, 2 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ode/ode23.m	Wed Oct 19 08:49:47 2016 -0700
+++ b/scripts/ode/ode23.m	Wed Oct 19 09:54:44 2016 -0700
@@ -161,12 +161,6 @@
 
   ## Start preprocessing, have a look which options are set in odeopts,
   ## check if an invalid or unused option is set.
-  ## FIXME: Why persistent?  Won't these have different values for every
-  ##        run of ode23?
-  persistent defaults   = [];
-  persistent classes    = [];
-  persistent attributes = [];
-
   [defaults, classes, attributes] = odedefaults (numel (init),
                                                  trange(1), trange(end));
 
--- a/scripts/ode/ode45.m	Wed Oct 19 08:49:47 2016 -0700
+++ b/scripts/ode/ode45.m	Wed Oct 19 09:54:44 2016 -0700
@@ -143,11 +143,6 @@
 
   ## Start preprocessing, have a look which options are set in odeopts,
   ## check if an invalid or unused option is set
-  ## FIXME: Why persistent when it is changed with every run of ode45?
-  persistent defaults   = [];
-  persistent classes    = [];
-  persistent attributes = [];
-
   [defaults, classes, attributes] = odedefaults (numel (init),
                                                  trange(1), trange(end));
 
--- a/scripts/ode/private/odedefaults.m	Wed Oct 19 08:49:47 2016 -0700
+++ b/scripts/ode/private/odedefaults.m	Wed Oct 19 09:54:44 2016 -0700
@@ -35,7 +35,7 @@
                                 "Mass", [],
                                 "MassSingular", "maybe",
                                 "MaxOrder", 5,
-                                "MaxStep", 0.1 * abs (t0-tf),
+                                "MaxStep", 0.1 * abs (tf - t0),
                                 "MStateDependence", "weak",
                                 "MvPattern", [],
                                 "NonNegative", [],
@@ -47,7 +47,7 @@
                                 "Stats", "off",
                                 "Vectorized", "off");
 
-  defaults.MaxStep = (0.1 * abs (t0-tf));
+  defaults.MaxStep = 0.1 * abs (tf -t0);
 
   persistent classes = struct ("AbsTol", {{"float"}},
                                "BDF", "char",