octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65668] test suite and demos reset 'tic'


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65668] test suite and demos reset 'tic'
Date: Wed, 1 May 2024 17:02:49 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65668>

                 Summary: test suite and demos reset 'tic'
                   Group: GNU Octave
               Submitter: nrjank
               Submitted: Wed 01 May 2024 05:02:49 PM EDT
                Category: Test Suite
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 9.1.0
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 01 May 2024 05:02:49 PM EDT By: Nicholas Jankowski <nrjank>
while running checks on the test suite it was determined that tic/toc doesn't
work for overall timing because a tic is called resetting the timer. this
occurs within system.tst:

%!test
%! tic ();
%! pause (2);
%! assert (toc > 0);

a quick search showed this also occurs within the first few demos for ode23s:

%!demo
%! ## Demo function: stiff Van Der Pol equation
%! fcn = @(t,y) [y(2); 10*(1-y(1)^2)*y(2)-y(1)];
%! ## Calling ode23s method
%! tic ()
%! [vt, vy] = ode23s (fcn, [0 20], [2 0]);
%! toc ()
%! ## Plotting the result
%! plot (vt,vy(:,1),'-o');

%!demo
%! ## Demo function: stiff Van Der Pol equation
%! fcn = @(t,y) [y(2); 10*(1-y(1)^2)*y(2)-y(1)];
%! ## Calling ode23s method
%! odeopts = odeset ("Jacobian", @(t,y) [0 1; -20*y(1)*y(2)-1,
10*(1-y(1)^2)],
%!                   "InitialStep", 1e-3)
%! tic ()
%! [vt, vy] = ode23s (fcn, [0 20], [2 0], odeopts);
%! toc ()
%! ## Plotting the result
%! plot (vt,vy(:,1),'-o');

%!demo
%! ## Demo function: stiff Van Der Pol equation
%! fcn = @(t,y) [y(2); 100*(1-y(1)^2)*y(2)-y(1)];
%! ## Calling ode23s method
%! odeopts = odeset ("InitialStep", 1e-4);
%! tic ()
%! [vt, vy] = ode23s (fcn, [0 200], [2 0]);
%! toc ()
%! ## Plotting the result
%! plot (vt,vy(:,1),'-o');

%!demo
%! ## Demo function: stiff Van Der Pol equation
%! fcn = @(t,y) [y(2); 100*(1-y(1)^2)*y(2)-y(1)];
%! ## Calling ode23s method
%! odeopts = odeset ("Jacobian", @(t,y) [0 1; -200*y(1)*y(2)-1,
100*(1-y(1)^2)],
%!                   "InitialStep", 1e-4);
%! tic ()
%! [vt, vy] = ode23s (fcn, [0 200], [2 0], odeopts);
%! toc ()
%! ## Plotting the result
%! plot (vt,vy(:,1),'-o');

if these are changed from `tic()` to t = tic(), then the calls would not reset
the global tic timer.  The attached patch makes that change in both files.  I
don't see any issues with making this change in the demos, but is there any
concern about testing a variable assignment tic/toc vs the current no-argument
tic/toc in system.tst? I noticed test coverage doesn't include both forms, is
there a particular need to test both?







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65668>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]