diff src/DLD-FUNCTIONS/fftn.cc @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents a1dbe9d80eee
children 87865ed7405f
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/fftn.cc	Wed May 14 18:09:56 2008 +0200
+++ b/src/DLD-FUNCTIONS/fftn.cc	Sun Apr 27 22:34:17 2008 +0200
@@ -90,29 +90,55 @@
   if (dims.all_zero ())
     return octave_value (Matrix ());
 
-  if (arg.is_real_type ())
+  if (arg.is_single_type ())
     {
-      NDArray nda = arg.array_value ();
+      if (arg.is_real_type ())
+	{
+	  FloatNDArray nda = arg.float_array_value ();
 
-      if (! error_state)
-	{
-	  nda.resize (dims, 0.0);
-	  retval = (type != 0 ? nda.ifourierNd () : nda.fourierNd ());
+	  if (! error_state)
+	    {
+	      nda.resize (dims, 0.0);
+	      retval = (type != 0 ? nda.ifourierNd () : nda.fourierNd ());
+	    }
 	}
-    }
-  else if (arg.is_complex_type ())
-    {
-      ComplexNDArray cnda = arg.complex_array_value ();
+      else
+	{
+	  FloatComplexNDArray cnda = arg.float_complex_array_value ();
 
-      if (! error_state)
-	{
-	  cnda.resize (dims, 0.0);
-	  retval = (type != 0 ? cnda.ifourierNd () : cnda.fourierNd ());
+	  if (! error_state)
+	    {
+	      cnda.resize (dims, 0.0);
+	      retval = (type != 0 ? cnda.ifourierNd () : cnda.fourierNd ());
+	    }
 	}
     }
   else
     {
-      gripe_wrong_type_arg (fcn, arg);
+      if (arg.is_real_type ())
+	{
+	  NDArray nda = arg.array_value ();
+
+	  if (! error_state)
+	    {
+	      nda.resize (dims, 0.0);
+	      retval = (type != 0 ? nda.ifourierNd () : nda.fourierNd ());
+	    }
+	}
+      else if (arg.is_complex_type ())
+	{
+	  ComplexNDArray cnda = arg.complex_array_value ();
+
+	  if (! error_state)
+	    {
+	      cnda.resize (dims, 0.0);
+	      retval = (type != 0 ? cnda.ifourierNd () : cnda.fourierNd ());
+	    }
+	}
+      else
+	{
+	  gripe_wrong_type_arg (fcn, arg);
+	}
     }
 
   return retval;