help-octave
[Top][All Lists]
Advanced

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

A bug in spline


From: 陳慶全
Subject: A bug in spline
Date: Fri, 29 Jan 2016 04:32:49 +0800

Hi, 

There is a bug in spline. 

I don't know where to report this, so I use this mail to send a bug.

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 via email to

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