comparison fft/fftw/fftw-3.3.4/doc/html/New_002darray-Execute-Functions.html @ 19:26056e866c29

Add FFTW to comparison table
author Chris Cannam
date Tue, 06 Oct 2015 13:08:39 +0100
parents
children
comparison
equal deleted inserted replaced
18:8db794ca3e0b 19:26056e866c29
1 <html lang="en">
2 <head>
3 <title>New-array Execute Functions - FFTW 3.3.4</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="FFTW 3.3.4">
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.4, 20 September 2013).
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-266"></a><a name="index-new_002darray-execution-267"></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-268"></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-269"></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-270"></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><a name="index-fftw_005falignment_005fof-271"></a>For rare circumstances in which you cannot control the alignment of
103 allocated memory, but wish to determine where a given array is
104 aligned like the original array for which a plan was created, you can
105 use the <code>fftw_alignment_of</code> function:
106 <pre class="example"> int fftw_alignment_of(double *p);
107 </pre>
108 <p>Two arrays have equivalent alignment (for the purposes of applying a
109 plan) if and only if <code>fftw_alignment_of</code> returns the same value
110 for the corresponding pointers to their data (typecast to <code>double*</code>
111 if necessary).
112
113 <p>If you are tempted to use the new-array execute interface because you
114 want to transform a known bunch of arrays of the same size, you should
115 probably go use the advanced interface instead (see <a href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>)).
116
117 <p>The new-array execute functions are:
118
119 <pre class="example"> void fftw_execute_dft(
120 const fftw_plan p,
121 fftw_complex *in, fftw_complex *out);
122
123 void fftw_execute_split_dft(
124 const fftw_plan p,
125 double *ri, double *ii, double *ro, double *io);
126
127 void fftw_execute_dft_r2c(
128 const fftw_plan p,
129 double *in, fftw_complex *out);
130
131 void fftw_execute_split_dft_r2c(
132 const fftw_plan p,
133 double *in, double *ro, double *io);
134
135 void fftw_execute_dft_c2r(
136 const fftw_plan p,
137 fftw_complex *in, double *out);
138
139 void fftw_execute_split_dft_c2r(
140 const fftw_plan p,
141 double *ri, double *ii, double *out);
142
143 void fftw_execute_r2r(
144 const fftw_plan p,
145 double *in, double *out);
146 </pre>
147 <p><a name="index-fftw_005fexecute_005fdft-272"></a><a name="index-fftw_005fexecute_005fsplit_005fdft-273"></a><a name="index-fftw_005fexecute_005fdft_005fr2c-274"></a><a name="index-fftw_005fexecute_005fsplit_005fdft_005fr2c-275"></a><a name="index-fftw_005fexecute_005fdft_005fc2r-276"></a><a name="index-fftw_005fexecute_005fsplit_005fdft_005fc2r-277"></a><a name="index-fftw_005fexecute_005fr2r-278"></a>
148 These execute the <code>plan</code> to compute the corresponding transform on
149 the input/output arrays specified by the subsequent arguments. The
150 input/output array arguments have the same meanings as the ones passed
151 to the guru planner routines in the preceding sections. The <code>plan</code>
152 is not modified, and these routines can be called as many times as
153 desired, or intermixed with calls to the ordinary <code>fftw_execute</code>.
154
155 <p>The <code>plan</code> <em>must</em> have been created for the transform type
156 corresponding to the execute function, e.g. it must be a complex-DFT
157 plan for <code>fftw_execute_dft</code>. Any of the planner routines for that
158 transform type, from the basic to the guru interface, could have been
159 used to create the plan, however.
160
161 <!-- -->
162 </body></html>
163