annotate src/fftw-3.3.3/doc/html/New_002darray-Execute-Functions.html @ 10:37bf6b4a2645

Add FFTW3
author Chris Cannam
date Wed, 20 Mar 2013 15:35:50 +0000
parents
children
rev   line source
Chris@10 1 <html lang="en">
Chris@10 2 <head>
Chris@10 3 <title>New-array Execute Functions - FFTW 3.3.3</title>
Chris@10 4 <meta http-equiv="Content-Type" content="text/html">
Chris@10 5 <meta name="description" content="FFTW 3.3.3">
Chris@10 6 <meta name="generator" content="makeinfo 4.13">
Chris@10 7 <link title="Top" rel="start" href="index.html#Top">
Chris@10 8 <link rel="up" href="FFTW-Reference.html#FFTW-Reference" title="FFTW Reference">
Chris@10 9 <link rel="prev" href="Guru-Interface.html#Guru-Interface" title="Guru Interface">
Chris@10 10 <link rel="next" href="Wisdom.html#Wisdom" title="Wisdom">
Chris@10 11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
Chris@10 12 <!--
Chris@10 13 This manual is for FFTW
Chris@10 14 (version 3.3.3, 25 November 2012).
Chris@10 15
Chris@10 16 Copyright (C) 2003 Matteo Frigo.
Chris@10 17
Chris@10 18 Copyright (C) 2003 Massachusetts Institute of Technology.
Chris@10 19
Chris@10 20 Permission is granted to make and distribute verbatim copies of
Chris@10 21 this manual provided the copyright notice and this permission
Chris@10 22 notice are preserved on all copies.
Chris@10 23
Chris@10 24 Permission is granted to copy and distribute modified versions of
Chris@10 25 this manual under the conditions for verbatim copying, provided
Chris@10 26 that the entire resulting derived work is distributed under the
Chris@10 27 terms of a permission notice identical to this one.
Chris@10 28
Chris@10 29 Permission is granted to copy and distribute translations of this
Chris@10 30 manual into another language, under the above conditions for
Chris@10 31 modified versions, except that this permission notice may be
Chris@10 32 stated in a translation approved by the Free Software Foundation.
Chris@10 33 -->
Chris@10 34 <meta http-equiv="Content-Style-Type" content="text/css">
Chris@10 35 <style type="text/css"><!--
Chris@10 36 pre.display { font-family:inherit }
Chris@10 37 pre.format { font-family:inherit }
Chris@10 38 pre.smalldisplay { font-family:inherit; font-size:smaller }
Chris@10 39 pre.smallformat { font-family:inherit; font-size:smaller }
Chris@10 40 pre.smallexample { font-size:smaller }
Chris@10 41 pre.smalllisp { font-size:smaller }
Chris@10 42 span.sc { font-variant:small-caps }
Chris@10 43 span.roman { font-family:serif; font-weight:normal; }
Chris@10 44 span.sansserif { font-family:sans-serif; font-weight:normal; }
Chris@10 45 --></style>
Chris@10 46 </head>
Chris@10 47 <body>
Chris@10 48 <div class="node">
Chris@10 49 <a name="New-array-Execute-Functions"></a>
Chris@10 50 <a name="New_002darray-Execute-Functions"></a>
Chris@10 51 <p>
Chris@10 52 Next:&nbsp;<a rel="next" accesskey="n" href="Wisdom.html#Wisdom">Wisdom</a>,
Chris@10 53 Previous:&nbsp;<a rel="previous" accesskey="p" href="Guru-Interface.html#Guru-Interface">Guru Interface</a>,
Chris@10 54 Up:&nbsp;<a rel="up" accesskey="u" href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>
Chris@10 55 <hr>
Chris@10 56 </div>
Chris@10 57
Chris@10 58 <h3 class="section">4.6 New-array Execute Functions</h3>
Chris@10 59
Chris@10 60 <p><a name="index-execute-264"></a><a name="index-new_002darray-execution-265"></a>
Chris@10 61 Normally, one executes a plan for the arrays with which the plan was
Chris@10 62 created, by calling <code>fftw_execute(plan)</code> as described in <a href="Using-Plans.html#Using-Plans">Using Plans</a>.
Chris@10 63 <a name="index-fftw_005fexecute-266"></a>However, it is possible for sophisticated users to apply a given plan
Chris@10 64 to a <em>different</em> array using the &ldquo;new-array execute&rdquo; functions
Chris@10 65 detailed below, provided that the following conditions are met:
Chris@10 66
Chris@10 67 <ul>
Chris@10 68 <li>The array size, strides, etcetera are the same (since those are set by
Chris@10 69 the plan).
Chris@10 70
Chris@10 71 <li>The input and output arrays are the same (in-place) or different
Chris@10 72 (out-of-place) if the plan was originally created to be in-place or
Chris@10 73 out-of-place, respectively.
Chris@10 74
Chris@10 75 <li>For split arrays, the separations between the real and imaginary
Chris@10 76 parts, <code>ii-ri</code> and <code>io-ro</code>, are the same as they were for
Chris@10 77 the input and output arrays when the plan was created. (This
Chris@10 78 condition is automatically satisfied for interleaved arrays.)
Chris@10 79
Chris@10 80 <li>The <dfn>alignment</dfn> of the new input/output arrays is the same as that
Chris@10 81 of the input/output arrays when the plan was created, unless the plan
Chris@10 82 was created with the <code>FFTW_UNALIGNED</code> flag.
Chris@10 83 <a name="index-FFTW_005fUNALIGNED-267"></a>Here, the alignment is a platform-dependent quantity (for example, it is
Chris@10 84 the address modulo 16 if SSE SIMD instructions are used, but the address
Chris@10 85 modulo 4 for non-SIMD single-precision FFTW on the same machine). In
Chris@10 86 general, only arrays allocated with <code>fftw_malloc</code> are guaranteed to
Chris@10 87 be equally aligned (see <a href="SIMD-alignment-and-fftw_005fmalloc.html#SIMD-alignment-and-fftw_005fmalloc">SIMD alignment and fftw_malloc</a>).
Chris@10 88
Chris@10 89 </ul>
Chris@10 90
Chris@10 91 <p><a name="index-alignment-268"></a>The alignment issue is especially critical, because if you don't use
Chris@10 92 <code>fftw_malloc</code> then you may have little control over the alignment
Chris@10 93 of arrays in memory. For example, neither the C++ <code>new</code> function
Chris@10 94 nor the Fortran <code>allocate</code> statement provide strong enough
Chris@10 95 guarantees about data alignment. If you don't use <code>fftw_malloc</code>,
Chris@10 96 therefore, you probably have to use <code>FFTW_UNALIGNED</code> (which
Chris@10 97 disables most SIMD support). If possible, it is probably better for
Chris@10 98 you to simply create multiple plans (creating a new plan is quick once
Chris@10 99 one exists for a given size), or better yet re-use the same array for
Chris@10 100 your transforms.
Chris@10 101
Chris@10 102 <p>If you are tempted to use the new-array execute interface because you
Chris@10 103 want to transform a known bunch of arrays of the same size, you should
Chris@10 104 probably go use the advanced interface instead (see <a href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>)).
Chris@10 105
Chris@10 106 <p>The new-array execute functions are:
Chris@10 107
Chris@10 108 <pre class="example"> void fftw_execute_dft(
Chris@10 109 const fftw_plan p,
Chris@10 110 fftw_complex *in, fftw_complex *out);
Chris@10 111
Chris@10 112 void fftw_execute_split_dft(
Chris@10 113 const fftw_plan p,
Chris@10 114 double *ri, double *ii, double *ro, double *io);
Chris@10 115
Chris@10 116 void fftw_execute_dft_r2c(
Chris@10 117 const fftw_plan p,
Chris@10 118 double *in, fftw_complex *out);
Chris@10 119
Chris@10 120 void fftw_execute_split_dft_r2c(
Chris@10 121 const fftw_plan p,
Chris@10 122 double *in, double *ro, double *io);
Chris@10 123
Chris@10 124 void fftw_execute_dft_c2r(
Chris@10 125 const fftw_plan p,
Chris@10 126 fftw_complex *in, double *out);
Chris@10 127
Chris@10 128 void fftw_execute_split_dft_c2r(
Chris@10 129 const fftw_plan p,
Chris@10 130 double *ri, double *ii, double *out);
Chris@10 131
Chris@10 132 void fftw_execute_r2r(
Chris@10 133 const fftw_plan p,
Chris@10 134 double *in, double *out);
Chris@10 135 </pre>
Chris@10 136 <p><a name="index-fftw_005fexecute_005fdft-269"></a><a name="index-fftw_005fexecute_005fsplit_005fdft-270"></a><a name="index-fftw_005fexecute_005fdft_005fr2c-271"></a><a name="index-fftw_005fexecute_005fsplit_005fdft_005fr2c-272"></a><a name="index-fftw_005fexecute_005fdft_005fc2r-273"></a><a name="index-fftw_005fexecute_005fsplit_005fdft_005fc2r-274"></a><a name="index-fftw_005fexecute_005fr2r-275"></a>
Chris@10 137 These execute the <code>plan</code> to compute the corresponding transform on
Chris@10 138 the input/output arrays specified by the subsequent arguments. The
Chris@10 139 input/output array arguments have the same meanings as the ones passed
Chris@10 140 to the guru planner routines in the preceding sections. The <code>plan</code>
Chris@10 141 is not modified, and these routines can be called as many times as
Chris@10 142 desired, or intermixed with calls to the ordinary <code>fftw_execute</code>.
Chris@10 143
Chris@10 144 <p>The <code>plan</code> <em>must</em> have been created for the transform type
Chris@10 145 corresponding to the execute function, e.g. it must be a complex-DFT
Chris@10 146 plan for <code>fftw_execute_dft</code>. Any of the planner routines for that
Chris@10 147 transform type, from the basic to the guru interface, could have been
Chris@10 148 used to create the plan, however.
Chris@10 149
Chris@10 150 <!-- -->
Chris@10 151 </body></html>
Chris@10 152