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

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

[Octave-bug-tracker] [bug #29601] bugs in cubic and spline interpolation


From: Thorsten Meyer
Subject: [Octave-bug-tracker] [bug #29601] bugs in cubic and spline interpolation with interp2
Date: Mon, 19 Apr 2010 20:52:02 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100308 Iceweasel/3.5.8 (like Firefox/3.5.8)

Update of bug #29601 (project octave):

             Assigned to:                    None => tmeyier                

    _______________________________________________________

Follow-up Comment #1:

The attached patch fixes the fails of demo("interp2"). But now the cubic
interpolation code within interp2 will never be used (as far as I can see).
Could you have a look Søren (as you seem to be author of that code).

--- a/scripts/general/interp2.m Sun Apr 18 21:27:53 2010 +0200
+++ b/scripts/general/interp2.m Mon Apr 19 22:41:16 2010 +0200
@@ -318,7 +318,7 @@
 
   else
 
-    ## If X and Y vectors produce a grid from them
+    ## Check dimensions of X and Y
     if (isvector (X) && isvector (Y))
       X = X(:).';
       Y = Y(:);
@@ -332,10 +332,10 @@
       endif
     endif
 
-    ## If Xi and Yi are vectors of different orientation build a grid
-    if ((rows (XI) == 1 && columns (YI) == 1)
-       || (columns (XI) == 1 && rows (YI) == 1))
-      ## Do nothing
+    ## Check dimensions of XI and YI
+    if (isvector (XI) && isvector (YI))
+      XI = XI(:).';
+      YI = YI(:);
     elseif (! size_equal (XI, YI))
       error ("XI and YI must be matrices of same size");
     endif
@@ -409,8 +409,7 @@
 
 function b = isgriddata (X)
   d1 = diff (X, 1, 1);
-  d2 = diff (X, 1, 2);
-  b = all (d1 (:) == 0) & all (d2 (:) == d2 (1));
+  b = all (d1 (:) == 0);
 endfunction
 
 ## Compute the bicubic interpolation coefficients


    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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