[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47013] bug in spline function
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #47013] bug in spline function |
Date: |
Fri, 29 Jan 2016 17:04:40 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?47013>
Summary: bug in spline function
Project: GNU Octave
Submitted by: None
Submitted on: Fri 29 Jan 2016 05:04:39 PM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: bug in spline function
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.0.0
Operating System: GNU/Linux
_______________________________________________________
Details:
Hi,
There is a bug in spline.
For the complete case in function `spline`, when n > 2,
(line 138 ~ 139 in source code)
g(2:n-1,:) = (a(3:n,:) - a(2:n-1,:)) ./ h(2:n-1) - ...
(a(2:n-1,:) - a(1:n-2,:)) ./ h(1:n-2);
should be
g(2:n-1,:) = (a(3:n,:) - a(2:n-1,:)) ./ h(2:n-1, idx) - ...
(a(2:n-1,:) - a(1:n-2,:)) ./ h(1:n-2, idx);
and (line 147~150 in source code)
d = d(1:n-1,:);
c = c(1:n-1,:);
b = b(1:n-1,:);
a = a(1:n-1,:);
should be
d = d(1:n-1,:); d = reshape(permute(d, [2, 1]), 1, []);
c = c(1:n-1,:); c = reshape(permute(c, [2, 1]), 1, []);
b = b(1:n-1,:); b = reshape(permute(b, [2, 1]), 1, []);
a = a(1:n-1,:); a = reshape(permute(a, [2, 1]), 1, []);
sincerely,
ChingChuan Chen
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47013>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #47013] bug in spline function,
anonymous <=