octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #31352] interp2 broken for non-quadratic matri


From: anonymous
Subject: [Octave-bug-tracker] [bug #31352] interp2 broken for non-quadratic matrices when using cubic interpolation
Date: Sat, 16 Oct 2010 17:16:08 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.13) Gecko/20100916 Iceweasel/3.5.13 (like Firefox/3.5.13)

URL:
  <http://savannah.gnu.org/bugs/?31352>

                 Summary: interp2 broken for non-quadratic matrices when
using cubic interpolation
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Sat 16 Oct 2010 05:16:07 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Gunnar Farnebäck
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

As shown below interp2 fails with a bogus error message when called with a
non-quadratic Z argument and cubic interpolation.

octave:1> interp2([0 0 1;0 1 1], [1.5 2.5], [1.5 1.5], 'linear')
ans =

   0.25000   0.75000

octave:2> interp2([0 0 1;0 1 1], [1.5 2.5], [1.5 1.5], 'cubic')
error: interp2: X and Y size must match Z dimensions
error: called from:
error:   /tmp/octave/scripts/general/interp2.m at line 330, column 9

After applying the attached trivial patch interp2_fix1.diff a new failure
appears:

octave:1> interp2([0 0 1;0 1 1], [1.5 2.5], [1.5 1.5], 'cubic')
error: interp2: mx_el_or: nonconformant arguments (op1 is 1x2, op2 is 2x1)
error: called from:
error:   /tmp/octave/scripts/general/interp2.m at line 357, column 8

This is maybe best fixed by duplicating the corresponding code from the
linear case, although it begs the question why this code isn't shared between
interpolation methods in the first place. Patch attached as
interp2_fix2.diff.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 16 Oct 2010 05:16:07 PM UTC  Name: interp2_fix1.diff  Size: 728B  
By: None
Patches for interp2.
<http://savannah.gnu.org/bugs/download.php?file_id=21695>
-------------------------------------------------------
Date: Sat 16 Oct 2010 05:16:07 PM UTC  Name: interp2_fix2.diff  Size: 971B  
By: None
Patches for interp2.
<http://savannah.gnu.org/bugs/download.php?file_id=21696>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31352>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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