diff scripts/ode/private/integrate_adaptive.m @ 20586:b7ac1e94266e

maint: Further clean up of functions in ode/private dir. * AbsRel_Norm.m, fuzzy_compare.m, integrate_adaptive.m, integrate_const.m, integrate_n_steps.m, ode_struct_value_check.m, odepkg_event_handle.m, odepkg_structure_check.m, runge_kutta_45_dorpri.m: Place latest copyright first in file. Use two spaces before beginning single-line comment. Use parentheses around variable to be tested in switch stmt. Use space between function name and opening parenthesis.
author Rik <rik@octave.org>
date Mon, 05 Oct 2015 12:03:16 -0700
parents eb9e2d187ed2
children 87b557ee8e5d
line wrap: on
line diff
--- a/scripts/ode/private/integrate_adaptive.m	Mon Oct 05 11:59:18 2015 -0700
+++ b/scripts/ode/private/integrate_adaptive.m	Mon Oct 05 12:03:16 2015 -0700
@@ -182,7 +182,7 @@
           while ((counter <= k)
                  && (vdirection * z(i) > vdirection * tspan(counter)))
             ## choose interpolation scheme according to order of the solver
-            switch order
+            switch (order)
               case 1
                 u_interp = linear_interpolation ([z(i-1) z(i)],
                                                  [u(:,i-1) u(:,i)],
@@ -286,8 +286,8 @@
       ## code fragment has moved here.  Stop integration if plot function
       ## returns false
       if (options.vhaveoutputfunction)
-        for vcnt = 0:options.Refine # Approximation between told and t
-          if (options.vhaverefine) # Do interpolation
+        for vcnt = 0:options.Refine  # Approximation between told and t
+          if (options.vhaverefine)   # Do interpolation
             vapproxtime = (vcnt + 1) / (options.Refine + 2);
             vapproxvals = (1 - vapproxtime) * vSaveVUForRefine ...
                           + (vapproxtime) * y(:,end);
@@ -301,11 +301,11 @@
           endif
           vpltret = feval (options.OutputFcn, vapproxtime,
                            vapproxvals, [], options.vfunarguments{:});
-          if (vpltret) # Leave refinement loop
+          if (vpltret)  # Leave refinement loop
             break;
           endif
         endfor
-        if (vpltret) # Leave main loop
+        if (vpltret)  # Leave main loop
           solution.vunhandledtermination = false;
           break;
         endif
@@ -340,8 +340,8 @@
     dt = vdirection * min (abs (dt), options.MaxStep);
     
     ## Update counters that count the number of iteration cycles
-    solution.vcntcycles += 1; # Needed for cost statistics
-    vcntiter += 1; # Needed to find iteration problems
+    solution.vcntcycles += 1;  # Needed for cost statistics
+    vcntiter += 1;  # Needed to find iteration problems
 
     ## Stop solving because in the last 1000 steps no successful valid
     ## value has been found