changeset 11235:b954d35e1594 octave-forge

fftconv2: warn if using with 1 matrix and 2 vectors as this is no longer working. Marked failing tests with xtest
author carandraug
date Sun, 11 Nov 2012 13:22:03 +0000
parents f31a074baf3c
children 9eb4a3b222e2
files main/image/NEWS main/image/inst/fftconv2.m
diffstat 2 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/NEWS	Sun Nov 11 13:04:54 2012 +0000
+++ b/main/image/NEWS	Sun Nov 11 13:22:03 2012 +0000
@@ -6,6 +6,11 @@
     colormarp is used on the colorbar for indexed images; and the stems no
     longer display the markers at their top.
 
+ ** The `fftconv2' usage "fftconv2 (v1, v2, a)", for convolution of a matrix by
+    one vector in the column direction and another vector in the row direction,
+    will issue a warning as is not working correctly. It has been removed from
+    the documentation.
+
 Summary of important user-visible changes for image 2.0.0:
 -------------------------------------------------------------------
 
--- a/main/image/inst/fftconv2.m	Sun Nov 11 13:04:54 2012 +0000
+++ b/main/image/inst/fftconv2.m	Sun Nov 11 13:22:03 2012 +0000
@@ -23,7 +23,6 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} fftconv2 (@var{a}, @var{b}, @var{shape})
-## @deftypefnx{Function File} fftconv2 (@var{v1}, @var{v2}, @var{a}, @var{shape})
 ## Convolve 2 dimensional signals using the FFT.
 ##
 ## This method is faster but less accurate than @var{conv2} for large @var{a} and @var{b}.
@@ -32,9 +31,11 @@
 ## @seealso{conv2}
 ## @end deftypefn
 
+## @deftypefnx{Function File} fftconv2 (@var{v1}, @var{v2}, @var{a}, @var{shape})
+## FIXME fftconv2 also has the code for this kind of usage but sometime along
+## the way it stopped working. Would be nice if someone could fix it...
+
 function X = fftconv2(varargin)
-  ## FIXME seems to not work when using a vector for the convolution in the row
-  ## direction and another in the column direction (fftconv2 (v1, v2, m)
     if (nargin < 2)
       print_usage;
     endif
@@ -43,9 +44,8 @@
     rowcolumn = 0;
     
     if ((nargin > 2) && ismatrix(varargin{3}) && !ischar(varargin{3}))
-
         ## usage: fftconv2(v1, v2, a[, shape])
-
+        warning ("fftconv2: the usage fftconv2(v1, v2, a, ...) seems to be broken. Beware of the results or fix fftconv2.");
         rowcolumn = 1;
         v1 = varargin{1}(:)';
         v2 = varargin{2}(:);
@@ -109,10 +109,10 @@
 %!##FIXME this usage seems to be broken...
 %!shared x,y,a
 %! x = 1:4; y = 4:-1:1; a = repmat(1:10, 5);
-%!assert(norm(fftconv2(x,y,a)-conv2(x,y,a)), 0, 1e6*eps)
-%!assert(norm(fftconv2(x,y,a,'full')-conv2(x,y,a,'full')), 0, 1e6*eps)
-%!assert(norm(fftconv2(x,y,a,'same')-conv2(x,y,a,'same')), 0, 1e6*eps)
-%!assert(norm(fftconv2(x,y,a,'valid')-conv2(x,y,a,'valid')), 0, 1e6*eps)
+%!xtest assert(norm(fftconv2(x,y,a)-conv2(x,y,a)), 0, 1e6*eps)
+%!xtest assert(norm(fftconv2(x,y,a,'full')-conv2(x,y,a,'full')), 0, 1e6*eps)
+%!xtest assert(norm(fftconv2(x,y,a,'same')-conv2(x,y,a,'same')), 0, 1e6*eps)
+%!xtest assert(norm(fftconv2(x,y,a,'valid')-conv2(x,y,a,'valid')), 0, 1e6*eps)
 
 %!demo
 %! ## Draw a cross