changeset 11239:52d4771fa488 octave-forge

fftconv2: remove usage with 1 matrix and 2 vectors as this was never working.
author carandraug
date Tue, 13 Nov 2012 14:18:08 +0000
parents 4ad4a68fd5b3
children 626106d0507b
files main/image/NEWS main/image/inst/fftconv2.m
diffstat 2 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/NEWS	Mon Nov 12 19:26:49 2012 +0000
+++ b/main/image/NEWS	Tue Nov 13 14:18:08 2012 +0000
@@ -8,8 +8,7 @@
 
  ** 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.
+    has been removed. Please use conv2 for such cases.
 
 Summary of important user-visible changes for image 2.0.0:
 -------------------------------------------------------------------
--- a/main/image/inst/fftconv2.m	Mon Nov 12 19:26:49 2012 +0000
+++ b/main/image/inst/fftconv2.m	Tue Nov 13 14:18:08 2012 +0000
@@ -22,19 +22,15 @@
 ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} fftconv2 (@var{a}, @var{b}, @var{shape})
+## @deftypefn {Function File} {} fftconv2 (@var{a}, @var{b}, @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}.
-## It also uses more memory. A small complex component will be 
+## This method is faster but less accurate than @var{conv2} for large @var{a}
+## and @var{b}.  It also uses more memory. A small complex component will be 
 ## introduced even if both @var{a} and @var{b} are real.
-## @seealso{conv2}
+## @seealso{conv2, fftconv, fft, ifft}
 ## @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)
     if (nargin < 2)
       print_usage;
@@ -45,7 +41,13 @@
     
     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.");
+        error ("fftconv2: the usage fftconv2(v1, v2, a, ...) Has not been implemented yet. Use conv2 instead");
+
+        ## @deftypefnx{Function File} fftconv2 (@var{v1}, @var{v2}, @var{a}, @var{shape})
+        ## FIXME this type of usage was apparently working back on Octave 3.2.4
+        ## but in truth it was wrong all the time and just looked right because
+        ## conv2 had the same problem. Once conv2 was fixed, it was obvious.
+
         rowcolumn = 1;
         v1 = varargin{1}(:)';
         v2 = varargin{2}(:);
@@ -106,7 +108,7 @@
 %!assert(norm(fftconv2(b,a,'valid')-conv2(b,a,'valid')), 0, 1e6*eps)
 
 %!# usage: fftconv2(v1, v2, a[, shape])
-%!##FIXME this usage seems to be broken...
+%!##FIXME this usage is broken
 %!shared x,y,a
 %! x = 1:4; y = 4:-1:1; a = repmat(1:10, 5);
 %!xtest assert(norm(fftconv2(x,y,a)-conv2(x,y,a)), 0, 1e6*eps)