[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52243] some integrators don't preserve type s
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #52243] some integrators don't preserve type single |
Date: |
Tue, 17 Oct 2017 14:41:02 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 |
URL:
<http://savannah.gnu.org/bugs/?52243>
Summary: some integrators don't preserve type single
Project: GNU Octave
Submitted by: nrjank
Submitted on: Tue 17 Oct 2017 06:41:01 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Nicholas Jankowski
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: other
Operating System: Any
_______________________________________________________
Details:
many integral functions do not preserve single type in all cases. examples
below:
matlab 2017a
>> class(quad(@sin,0,single(1)))
ans =
'single'
>> class(quadv(@sin,0,single(1)))
ans =
'single'
>> class(quadl(@sin,0,single(1)))
ans =
'single'
>> class(quadgk(@sin,0,single(1)))
ans =
'single'
>> class(quad(@sin,0,single(1)))
ans =
'single'
>> class(integral(@sin,0,single(1)))
ans =
'single'
>> class(integral2(@plus,1,2,single(3),4))
ans =
'single'
>> class(dblquad(@plus,1,2,single(3),4))
ans =
'single'
>> class(quad2d(@plus,1,2,single(3),4))
ans =
'single'
>> class(integral3(@(x,y,z) x+y+z,1,2,1,2,single(3),4))
ans =
'single'
>> class(triplequad(@(x,y,z) x+y+z,1,2,1,2,single(3),4))
ans =
'single'
Octave:
>> class(quad(@sin,0,single(1)))
ans = single
>> class(quadv(@sin,0,single(1)))
ans = single
>> class(quadl(@sin,0,single(1)))
ans = double
>> class(quadgk(@sin,0,single(1)))
ans = single
>> class(quadcc(@sin,0,single(1)))
ans = double
>> class(integral(@sin,0,single(1)))
ans = single
>> class(integral2(@plus,1,2,single(3),4))
ans = single
>> class(integral3(@plus,1,2,1,2,single(3),4))
ans = double
>> class(dblquad(@plus,1,2,single(3),4))
ans = double
>> class(triplequad(@plus,1,2,1,2,single(3),4))
ans = double
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
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52243>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52243] some integrators don't preserve type single,
Nicholas Jankowski <=