bugGNU Octave - Bugs: bug #37294, interp3 fails in some cases when...

 
 

bug #37294: interp3 fails in some cases when passing a method argument

Submitted by:  Kris Thielemans <krthie>
Submitted on:  Fri 07 Sep 2012 11:40:44 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 08 Sep 2012 09:38:51 PM UTC, comment #1:

Thanks, I've rebased and pushed your patch:

http://hg.savannah.gnu.org/hgweb/octave/rev/7d2eb4a01798

You are working off a quite old revision. You should do "hg update" and/or "hg pull" periodically to keep up with the dev sources.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Fri 07 Sep 2012 11:40:44 AM UTC, original submission:

When the first 3 x,y,z arguments are not passed to interp3, it fails when using a method argument:

octave:1> interp3(ones([2,2,2]), 1:2,1:2,1:2,'nearest');
error: interpn: dimensional mismatch
error: called from:
error: /usr/local/share/octave/3.6.1-rc0/m/general/interpn.m at line 135, column 9
error: evaluating argument list element number 1
error: /usr/local/share/octave/3.6.1-rc0/m/general/interp3.m at line 105, column 8
octave:1> [x,y,z]=meshgrid( 1:2,1:2,1:2); interp3(ones([2,2,2]),x,y,z,'nearest');
error: interpn: wrong number or incorrectly formatted input arguments
error: called from:
error: /usr/local/share/octave/3.6.1-rc0/m/general/interpn.m at line 129, column 5
error: evaluating argument list element number 1
error: /usr/local/share/octave/3.6.1-rc0/m/general/interp3.m at line 105, column 8

This needs a one line fix in the code. I add a mercurial patch accordingly, where I've also added more test cases.

I've also changed the 1st test case to make it less symmetric. In the original version, it was using x=y which means it wasn't a very meaningful test to compare interp3 and interpn, and in fact its calling sequence was inaccurate.

Thanks

Kris

Kris Thielemans <krthie>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26492:  octave-interp3.diff added by krthie (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by krthie (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Sep 2012 09:38:51 PM UTCjordighStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 07 Sep 2012 11:40:44 AM UTCkrthieAttached File-=>Added octave-interp3.diff, #26492

    Back to the top


    Powered by Savane 3.1-cleanup1