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