bugGNU Octave - Bugs: bug #52243, some integrators don't preserve...

 
 

bug #52243: some integrators don't preserve type single

Submitted by:  Nicholas Jankowski <nrjank>
Submitted on:  Tue 17 Oct 2017 06:41:01 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Nicholas JankowskiOpen/Closed: Closed
Release: otherOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 19 Oct 2017 05:01:28 AM UTC, comment #3:

Final patch for integral3 here (http://hg.savannah.gnu.org/hgweb/octave/rev/f9549e90d620). Marking bug as fixed and closing report.

Rik <rik5>
Project Administrator
Thu 19 Oct 2017 04:39:44 AM UTC, comment #2:

I checked in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/5fc5c1a49aa1) which modifies quadcc to return a single type output if any limit of integration is a single. I also changed the function to base the tolerance values on whether the inputs are double or single. It is now equivalent to quadgk in using an AbsTol of 1e-10 for doubles and 1e-6 for singles.

The only quadrature routine which still has a problem is integral3.

Rik <rik5>
Project Administrator
Tue 17 Oct 2017 08:49:22 PM UTC, comment #1:

Confirmed. I checked in the cset for bug #42073 so integral() is working correctly now.

I was surprised by quadl, but it turned out to be very simple. I checked in a change for that here http://hg.savannah.gnu.org/hgweb/octave/rev/ce435b70fd94.

quadcc should probably be changed to return a single when one of the endpoints is single. That would also fix dblquad and triplequad which use quadcc as the underlying integrator. In fact, that probably also would fix integral3.

Rik <rik5>
Project Administrator
Tue 17 Oct 2017 06:41:01 PM UTC, original submission:

many integral functions do not preserve single type in all cases. examples below:

matlab 2017a

Octave:

Generally speaking, for matlab compatibility type single should be preserved for any type single inputs for limits or waypoints but not for tolerances.

so for us seems it applies to:

integral
integral2
integral3
quad2d
dblquad
triplequad
quadl
quadcc

integral passes but it has a patch waiting (bug #42073) that will have it use quadcc. that patch has been updated to preserve single type no matter which underlying quad is called.

the other integral functions and quad2d already do a type check, so a patch that recasts the output as single when necessary should be easy. I can work on a patch for those with appropriate BISTs

Nicholas Jankowski <nrjank>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by nrjank (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 19 Oct 2017 05:01:28 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Tue 17 Oct 2017 08:49:22 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1