Wed 09 Apr 2014 03:03:49 AM UTC, comment #11:
I added a test for strictly monotonic x and y to the default branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/4792a115c735). Closing report.
|
Mon 31 Mar 2014 03:05:37 PM UTC, comment #10:
no, the one that you get from ordering y and yi increasingly, which is actually only a different way of axis labeling, isn't it?
|
Mon 31 Mar 2014 02:49:50 PM UTC, comment #9:
Was the same result an error message about the data not being monotonic?
|
Mon 31 Mar 2014 02:40:06 PM UTC, comment #8:
as ML wants to have at least 3 points I did
and obtained in both cases the exact same result.
|
Mon 31 Mar 2014 01:56:51 PM UTC, comment #7:
Matlab uses 'cubic' for an interpolation method with C1 continuity rather than 'pchip'.
Could you try changing the method and repeating the examples below.
I think the solution is going to come back to doing better input validation as is done in interp1. I overhauled interp1, interp2, interp3 on the development branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/0ede4dbb37f1). Any improvements should start after that changeset so that the patches apply cleanly.
|
Mon 31 Mar 2014 06:48:06 AM UTC, comment #6:
There is no 2d pchip method in Matlab.
The error does not occur for interp1 because there are at least two checks/repairs for decreasing data:
Without that, the slatec call to _pchip_deriv_ returns the error seen in the segfault message.
|
Sat 29 Mar 2014 10:58:40 PM UTC, comment #5:
The test for strict monotonic is there, but written in fortran. If it is added to C++ code it could be removed in fortran. I don't have Matlab to test, and pchip is not a valid method according to online documentation. However, we had a discussion on IRC yesterday about this issue. Seems Matlab 2014a returns some results.
|
Sat 29 Mar 2014 07:14:44 PM UTC, comment #4:
I applied Stefan's patch to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/e7369c43ebe0). This at least stops the segmentation fault.
Back to the root problem, there should be input validation of X and Y. According to the documentation, when X and Y are grid vectors (rather than matrices from meshgrid()), the must be strictly monotonic, but there is no test for that. We could add one though.
What does Matlab do for these two test cases?
|
Sun 16 Mar 2014 07:08:39 AM UTC, comment #3:
I found the error is due to this line in file interp2.m:
about line 243:
DY = _pchip_deriv_ (Y, Z, 1);
and in the input Y is decreasing.
So I think it's the problem with function _pchip_deriv_
But I don't know how to find the definition of this function.
|
Wed 12 Mar 2014 01:54:27 AM UTC, comment #2:
Attached patch fixes this bug.
(file #30869)
|
Tue 11 Mar 2014 09:54:31 PM UTC, comment #1:
Confirmed on Windows XP (3.8.1) and Linux (Mageia-2 32b; 4.1.0+ and 3.8.0).
Tried a backtrace from 3.8.0, but got, apart from Muhali's uppercase messages, only:
|
Tue 11 Mar 2014 08:43:51 PM UTC, original submission:
causes a crash in my current octave-dev:
***MESSAGE FROM ROUTINE DPCHIM IN LIBRARY SLATEC.
***POTENTIALLY RECOVERABLE ERROR, PROG ABORTED, TRACEBACK REQUESTED
- X-ARRAY NOT STRICTLY INCREASING
- ERROR NUMBER = -3
-
***END OF MESSAGE
***JOB ABORT DUE TO UNRECOVERED ERROR.
- ERROR MESSAGE SUMMARY
LIBRARY SUBROUTINE MESSAGE START NERR LEVEL COUNT
SLATEC DPCHIM X-ARRAY NOT STRICTLY -3 1 1
Segmentation fault (core dumped)
It happens each time one of the arguments is decreasing (consistent with the interp2 help which only requires them to be monotonic).
|