[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #30121] interpn.m & __interpn_lin__.m problem
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #30121] interpn.m & __interpn_lin__.m problem |
Date: |
Sat, 12 Jun 2010 22:21:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090903 SeaMonkey/1.1.18 |
URL:
<http://savannah.gnu.org/bugs/?30121>
Summary: interpn.m & __interpn_lin__.m problem
Project: GNU Octave
Submitted by: philipnienhuis
Submitted on: Sat 12 Jun 2010 10:21:22 PM GMT
Category: Libraries
Severity: 3 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Philip Nienhuis
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.2.4
Operating System: Microsoft Windows
_______________________________________________________
Details:
interpn.m (& __interpn_lin__.cc) fail to operate properly in octave-3.2.4
(MingW build / Windows). It also fails in a self-compiled octave-3.2.4 under
MandrivaLinux.
It worked properly in octave-3.0.3 (VC build / Windows).
FWIW, the examples below work OK in ML.
Attached .mat file contains some test data that help to show the error.
octave-3.2.4.exe:2> load interpn.mat
octave-3.2.4.exe:3> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
Phi 26x9x51 95472 double
ans 1x11 92 cell
dd2 9x26x5 9360 double
dirlist 1x6 18 cell
ii 1x1 8 double
rm 1x9 72 double
t 1x5 40 double
tnum 1x51 408 double
zm 26x1 208 double
Total is 13213 elements using 105678 bytes
octave-3.2.4.exe:4> dd2 = interpn (rm, zm, tnum, Phi, rm, zm, t)
error: interpn: incompatible size of argument number 6
error: called from:
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\general\interpn.m at
line 141, column 8
octave-3.2.4.exe:4>
In addition, interpn.m has a typo in line 5 of the first demo test: "AI="
should read "yi=".
But even after fixing this, interpn.m fails a number of demo tests:
---------------------------------------------
# DEMO 1
octave-3.2.4.exe:4> A=[13,-1,12;5,4,3;1,6,2];
octave-3.2.4.exe:5> x=[0,1,4]; y=[10,11,12];
octave-3.2.4.exe:6> xi=linspace(min(x),max(x),17);
octave-3.2.4.exe:7> yi=linspace(min(y),max(y),26)'; # Here yi was
replaced by "AI"
octave-3.2.4.exe:8> mesh(xi,yi,interpn(x,y,A.',xi,yi,"linear").');
error: interpn: incompatible size of argument number 5
error: called from:
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\general\interpn.m at
line 141, colu
mn 8
error: evaluating argument list element number 3
error: evaluating argument list element number 1
octave-3.2.4.exe:8>
----------------------------------------
# DEMO 2
<all initialization commands (lines 1..4) are identical to DEMO 1 so only the
call to interpn is shown:)
# .. init lines ....
octave-3.2.4.exe:9> mesh(xi,yi,interpn(x,y,A.',xi,yi,"nearest").');
error: operator -: nonconformant arguments (op1 is 17x1, op2 is 1x17)
error: called from:
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\general\interpn.m at
line 152, colu
mn 15
error: evaluating argument list element number 3
error: evaluating argument list element number 1
octave-3.2.4.exe:9>
-----------------------------------------
# DEMO 3
# .. init lines ....
octave-3.2.4.exe:9> mesh(xi,yi,interpn(x,y,A.',xi,yi,"cubic").')
error: cubic interpolation not yet implemented
error: called from:
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\general\interpn.m at
line 190, colu
mn 5
error: evaluating argument list element number 3
error: evaluating argument list element number 1
octave-3.2.4.exe:9>
# Note: This one performs as expected! as "cubic" is not implemented indeed
--------------------------------------------
# DEMO 4
# .. init lines ....
octave-3.2.4.exe:8> mesh(xi,yi,interpn(x,y,A.',xi,yi,"spline").');
works OK and gives a nice 3D plot.
# DEMO 5
# .. works OK and gives plot similar to demo 4
For smaller-size test cases below the demo stanzas interpn.m seems to work OK
(I haven tested them all)..
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sat 12 Jun 2010 10:21:22 PM GMT Name: interpn.zip Size: 114kB By:
philipnienhuis
<http://savannah.gnu.org/bugs/download.php?file_id=20740>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30121>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #30121] interpn.m & __interpn_lin__.m problem,
Philip Nienhuis <=