diff src/DLD-FUNCTIONS/fft.cc @ 6620:bf4bdc21dc8d

[project @ 2007-05-14 17:35:46 by jwe]
author jwe
date Mon, 14 May 2007 17:38:38 +0000
parents 080c08b192d8
children 80a8e2019d39
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/fft.cc	Mon May 14 16:32:54 2007 +0000
+++ b/src/DLD-FUNCTIONS/fft.cc	Mon May 14 17:38:38 2007 +0000
@@ -99,7 +99,7 @@
   if (dim < 0)
     {
       for (octave_idx_type i = 0; i < dims.length (); i++)
-	if ( dims(i) > 1)
+	if (dims(i) > 1)
 	  {
 	    dim = i;
 	    break;
@@ -115,8 +115,8 @@
   else
     dims (dim) = n_points;
 
-  if (dims.all_zero () || n_points == 0)
-    return octave_value (Matrix ());
+  if (dims.any_zero () || n_points == 0)
+    return octave_value (NDArray (dims));
 
   if (arg.is_real_type ())
     {
@@ -146,6 +146,21 @@
   return retval;
 }
 
+/*
+
+%!error(fft())
+%!assert(fft([]), [])
+%!assert(fft(zeros(-1,-1)), [])
+%!assert(fft(zeros(1,-1)), [])
+%!assert(fft(zeros(-1,1)), [])
+%!assert(fft(0), 0)
+%!assert(fft(1), 1)
+%!assert(fft(1), 1)
+%!assert(fft(ones(2,2)), [2,2; 0,0])
+%!assert(fft(eye(2,2)), [1,1; 1,-1])
+
+*/
+
 
 DEFUN_DLD (fft, args, ,
   "-*- texinfo -*-\n\