annotate src/fftw-3.3.3/doc/html/New_002darray-Execute-Functions.html @ 95:89f5e221ed7b

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