bugGNU Octave - Bugs: bug #31626, lsode: patch to make Jacobian...

 
 

bug #31626: lsode: patch to make Jacobian types of dlsode.f accessible

Submitter:  Olaf Till <i7tiol>
Submitted:  Fri 12 Nov 2010 08:11:41 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Olaf Till Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  8.1.0 Planned Release:  8.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 08 Dec 2022 08:44:58 PM UTC, comment #8: 

two months with no concerns, looks like we can close this as fixed as part of 8.1.

Nicholas Jankowski <nrjank>
Group Member
Fri 30 Sep 2022 04:07:00 PM UTC, comment #7: 

Another 19 months went by, and the patch from comment #5 no longer applies again.
Sorry, this is taking almost 12 years now since the original submission.

I think I found with a Google search how to properly check in Perl whether a variable is initialized (and IIUC that is what should be checked by that condition).
I went ahead (if that is still proper to say after almost 12 years) and pushed the updated patch here:
https://hg.savannah.gnu.org/hgweb/octave/rev/de6fc38c78c6

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Fri 30 Sep 2022 02:05:27 PM UTC, comment #6: 

noting that markus's submitted patch needed to be verified by someone familiar with perl, changing status to Need Info. Don't know if we can identify someone to add to the cc for this report who could help us close out this old report.

Nicholas Jankowski <nrjank>
Group Member
Thu 25 Feb 2021 05:39:40 PM UTC, comment #5: 

Sorry, this is taking more than 9 years now.

I applied the last version by Nick of the patch (it still applies) and compiled with the changes.

I'm not sure if I understand the intention correctly. But I think some initialization values for the newly added properties are missing from the perl generated header LSODE-opts.h:

  void init (void)
    {
      x_absolute_tolerance.resize (dim_vector (1, 1));
      x_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
      x_relative_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
      x_integration_method = "stiff";
      x_initial_step_size = -1.0;
      x_maximum_order = -1;
      x_maximum_step_size = -1.0;
      x_minimum_step_size = 0.0;
      x_step_limit = 100000;
      x_jacobian_type = "full";
      reset = true;
    }


IIUC, this should include initial values (0) for x_lower_jacobian_subdiagonals and x_upper_jacobian_subdiagonals.

I think the respective section in the perl script is this:

      if ($INIT_VALUE[$i])
        {
          print "      $OPTVAR[$i] = $INIT_VALUE[$i];\n";
        }


If I interpret that correctly, printing the lines with the default values might be skipped because they are 0?

I can't read or write perl. So that's over my head.

Attached is a patch with just some minor updates of the formatting of the docstring.


(file #50920)

Markus Mützel <mmuetzel>
Group administrator
Tue 10 Mar 2020 07:24:31 PM UTC, comment #4: 

browsing old bugs, this old patch wouldn't apply because of changing octave_idx_type to F77_INT.  a couple replacements nad line shifts and the patch now applies cleanly. updated patch attached.


(file #48576)

Nicholas Jankowski <nrjank>
Group Member
Wed 06 Sep 2017 06:08:15 AM UTC, comment #3: 

Not 2, but 7 years. Before updating the patch, I'd need an indication that the patch, once properly tidied up, will actually be allowed to be applied.

Olaf Till <i7tiol>
Group Member
Tue 05 Sep 2017 08:17:31 PM UTC, comment #2: 

After almost 2 years of waiting, the patch can't be applied.
Can someone make a new patch?

Avinoam Kalma <avinoam>
Group Member
Sat 28 Nov 2015 09:03:30 AM UTC, comment #1: 

This patch seems mildly useful and straightforward.

I've updated this patch to apply cleanly to the current Mercurial repository.

I recommend that it either be applied, or its priority be reduced.

(file #35584)

Lachlan Andrew <lachlan>
Fri 12 Nov 2010 08:11:41 AM UTC, original submission:  

With the BDF method, dlsode.f is able to approximate only a diagonal or banded Jacobian (Method flag: 23, 25) and to use only a banded part of a user supplied Jacobian (Method flag: 24). This is useful for efficiency. But as yet lsode offers no interface to this. The attached patch changes this.

1. In liboctave/LSODE-opts.in, options "jacobian type" (values: "full" (default), "banded", "diagonal"), "lower jacobian subdiagonals", and "upper jacobian subdiagonals" (for use with a "jacobian type" of "banded") are introduced.

2. In liboctave/LSODE.cc, the corresponding values of method_flag are set and iwork(0) and iwork(1) are set to "lower jacobian subdiagonals" and "upper jacobian subdiagonals", respectively. Since except for method_flag == 24 the user-supplied Jacobian must (according to dlsode.f) ignore the arguments "lower jacobian subdiagonals" (ML) and "upper jacobian subdiagonals" (MU), a new file-scope variable tells lsode_j when to ignore them. With method_flag == 24, lsode_j fills only the required subdiagonals of the user-supplied Jacobian into the allocated memory as specified by dlsode.f.

I think the actual user-programmed Jacobian function need not be passed ML and MU (this would necessitate much more changes), since the user knows which "lower jacobian subdiagonals" and "upper jacobian subdiagonals" he sets for lsode and can provide these to his Jacobian-function himself, if desired.

For testing the new features and seeing the time-savings, a function 'odetest' returning a structure with two test-problems and a script 'odetest_script' which uses this function are also attached.

Note: It may be necessary to fix bug #31623 before testing (I had to do it for me), for 'lsode' to be able to see settings changed with 'lsode_options'. I'm not sure whether bug #31623 affects every system.

Olaf Till <i7tiol>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48576:  bug31626patchupdate.diff added by nrjank (6KiB - application/octet-stream - updated patch)
file #35584:  patch_31626.txt added by lachlan (6KiB - text/plain - Updated to current (2015-11-28) mercurial version)
file #21986:  lsode-jacobian-types.changeset added by i7tiol (6KiB - application/octet-stream)
file #21987:  odetest.m added by i7tiol (3KiB - text/x-objcsrc)
file #21988:  odetest_script.m added by i7tiol (3KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by nrjank (Updated the item)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by lachlan (Updated the item)
  • -email is unavailable- added by i7tiol (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 16 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-12-08 nrjank StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 8.1.0
        Planned ReleaseNone 8.1.0
    2022-09-30 mmuetzel StatusNeed Info Ready For Test
    2022-09-30 nrjank Priority5 - Normal 3 - Low
        StatusPatch Submitted Need Info
    2021-02-25 mmuetzel Attached File- Added bug31626_lsode-jacobian-types_v4.patch, #50920
        Operating SystemGNU/Linux Any
    2020-03-10 nrjank Attached File- Added bug31626patchupdate.diff, #48576
    2015-11-28 lachlan Attached File- Added patch_31626.txt, #35584
    2011-08-04 rik5 Carbon-CopyRemoved 72865 -
    2011-08-04 rik5 StatusNone Patch Submitted
    2010-11-12 i7tiol Attached File- Added lsode-jacobian-types.changeset, #21986
        Attached File- Added odetest.m, #21987
        Attached File- Added odetest_script.m, #21988

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code