Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Compile Fourier

  • To: mathgroup at
  • Subject: [mg64899] Re: Compile Fourier
  • From: Paul Abbott <paul at>
  • Date: Tue, 7 Mar 2006 06:11:49 -0500 (EST)
  • Organization: The University of Western Australia
  • References: <duh209$5kq$>
  • Sender: owner-wri-mathgroup at

In article <duh209$5kq$1 at>,
 Alberto Verga <Alberto.Verga at> wrote:

> The following piece of code gives an error message 'Compiled expression 
> should be a rank 1 tensor of machine-size complex numbers'
>     Compile[{{m, _Real, 2}}, Fourier[m]][Table[N[i - j], {i, 4}, {j, 4}]]
> Does this mean that Fourier[] cannot be compiled with rank 2 arrays?

The error message is avoided by specifying the type for Fourier[m]:

  cf = Compile[{{m, _Real, 2}}, Fourier[m], 
    {{Fourier[_], _Complex, 2}}][Table[N[i - j], {i, 4}, {j, 4}]]

However, timing shows no speed-up compared to direct use of Fourier. And 
an examination of the compiled function shows that Fourier is _not_ 


> My goal is to write a pseudospectral code to solve 2D PDE: compiling the 
> time loop seems unavoidable if one wants reasonable performance.

Rob Knapp gave a talk on the Split Step Fourier Method. See the gzipped 
file NLS.tgz in

This has the code to do this using arbitrary time order.


Paul Abbott                                      Phone:  61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    

  • Prev by Date: Re: Possible Bug in ArcTan ?
  • Next by Date: Re: Compile Fourier (2)
  • Previous by thread: Re: Compile Fourier
  • Next by thread: Plus Behavior Inside a Notation Box?