annotate src/fftw-3.3.5/doc/html/New_002darray-Execute-Functions.html @ 42:2cd0e3b3e1fd

Current fftw source
author Chris Cannam
date Tue, 18 Oct 2016 13:40:26 +0100
parents
children
rev   line source
Chris@42 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Chris@42 2 <html>
Chris@42 3 <!-- This manual is for FFTW
Chris@42 4 (version 3.3.5, 30 July 2016).
Chris@42 5
Chris@42 6 Copyright (C) 2003 Matteo Frigo.
Chris@42 7
Chris@42 8 Copyright (C) 2003 Massachusetts Institute of Technology.
Chris@42 9
Chris@42 10 Permission is granted to make and distribute verbatim copies of this
Chris@42 11 manual provided the copyright notice and this permission notice are
Chris@42 12 preserved on all copies.
Chris@42 13
Chris@42 14 Permission is granted to copy and distribute modified versions of this
Chris@42 15 manual under the conditions for verbatim copying, provided that the
Chris@42 16 entire resulting derived work is distributed under the terms of a
Chris@42 17 permission notice identical to this one.
Chris@42 18
Chris@42 19 Permission is granted to copy and distribute translations of this manual
Chris@42 20 into another language, under the above conditions for modified versions,
Chris@42 21 except that this permission notice may be stated in a translation
Chris@42 22 approved by the Free Software Foundation. -->
Chris@42 23 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
Chris@42 24 <head>
Chris@42 25 <title>FFTW 3.3.5: New-array Execute Functions</title>
Chris@42 26
Chris@42 27 <meta name="description" content="FFTW 3.3.5: New-array Execute Functions">
Chris@42 28 <meta name="keywords" content="FFTW 3.3.5: New-array Execute Functions">
Chris@42 29 <meta name="resource-type" content="document">
Chris@42 30 <meta name="distribution" content="global">
Chris@42 31 <meta name="Generator" content="makeinfo">
Chris@42 32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Chris@42 33 <link href="index.html#Top" rel="start" title="Top">
Chris@42 34 <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
Chris@42 35 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
Chris@42 36 <link href="FFTW-Reference.html#FFTW-Reference" rel="up" title="FFTW Reference">
Chris@42 37 <link href="Wisdom.html#Wisdom" rel="next" title="Wisdom">
Chris@42 38 <link href="64_002dbit-Guru-Interface.html#g_t64_002dbit-Guru-Interface" rel="prev" title="64-bit Guru Interface">
Chris@42 39 <style type="text/css">
Chris@42 40 <!--
Chris@42 41 a.summary-letter {text-decoration: none}
Chris@42 42 blockquote.smallquotation {font-size: smaller}
Chris@42 43 div.display {margin-left: 3.2em}
Chris@42 44 div.example {margin-left: 3.2em}
Chris@42 45 div.indentedblock {margin-left: 3.2em}
Chris@42 46 div.lisp {margin-left: 3.2em}
Chris@42 47 div.smalldisplay {margin-left: 3.2em}
Chris@42 48 div.smallexample {margin-left: 3.2em}
Chris@42 49 div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
Chris@42 50 div.smalllisp {margin-left: 3.2em}
Chris@42 51 kbd {font-style:oblique}
Chris@42 52 pre.display {font-family: inherit}
Chris@42 53 pre.format {font-family: inherit}
Chris@42 54 pre.menu-comment {font-family: serif}
Chris@42 55 pre.menu-preformatted {font-family: serif}
Chris@42 56 pre.smalldisplay {font-family: inherit; font-size: smaller}
Chris@42 57 pre.smallexample {font-size: smaller}
Chris@42 58 pre.smallformat {font-family: inherit; font-size: smaller}
Chris@42 59 pre.smalllisp {font-size: smaller}
Chris@42 60 span.nocodebreak {white-space:nowrap}
Chris@42 61 span.nolinebreak {white-space:nowrap}
Chris@42 62 span.roman {font-family:serif; font-weight:normal}
Chris@42 63 span.sansserif {font-family:sans-serif; font-weight:normal}
Chris@42 64 ul.no-bullet {list-style: none}
Chris@42 65 -->
Chris@42 66 </style>
Chris@42 67
Chris@42 68
Chris@42 69 </head>
Chris@42 70
Chris@42 71 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
Chris@42 72 <a name="New_002darray-Execute-Functions"></a>
Chris@42 73 <div class="header">
Chris@42 74 <p>
Chris@42 75 Next: <a href="Wisdom.html#Wisdom" accesskey="n" rel="next">Wisdom</a>, Previous: <a href="Guru-Interface.html#Guru-Interface" accesskey="p" rel="prev">Guru Interface</a>, Up: <a href="FFTW-Reference.html#FFTW-Reference" accesskey="u" rel="up">FFTW Reference</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
Chris@42 76 </div>
Chris@42 77 <hr>
Chris@42 78 <a name="New_002darray-Execute-Functions-1"></a>
Chris@42 79 <h3 class="section">4.6 New-array Execute Functions</h3>
Chris@42 80 <a name="index-execute-2"></a>
Chris@42 81 <a name="index-new_002darray-execution"></a>
Chris@42 82
Chris@42 83 <p>Normally, one executes a plan for the arrays with which the plan was
Chris@42 84 created, by calling <code>fftw_execute(plan)</code> as described in <a href="Using-Plans.html#Using-Plans">Using Plans</a>.
Chris@42 85 <a name="index-fftw_005fexecute-2"></a>
Chris@42 86 However, it is possible for sophisticated users to apply a given plan
Chris@42 87 to a <em>different</em> array using the &ldquo;new-array execute&rdquo; functions
Chris@42 88 detailed below, provided that the following conditions are met:
Chris@42 89 </p>
Chris@42 90 <ul>
Chris@42 91 <li> The array size, strides, etcetera are the same (since those are set by
Chris@42 92 the plan).
Chris@42 93
Chris@42 94 </li><li> The input and output arrays are the same (in-place) or different
Chris@42 95 (out-of-place) if the plan was originally created to be in-place or
Chris@42 96 out-of-place, respectively.
Chris@42 97
Chris@42 98 </li><li> For split arrays, the separations between the real and imaginary
Chris@42 99 parts, <code>ii-ri</code> and <code>io-ro</code>, are the same as they were for
Chris@42 100 the input and output arrays when the plan was created. (This
Chris@42 101 condition is automatically satisfied for interleaved arrays.)
Chris@42 102
Chris@42 103 </li><li> The <em>alignment</em> of the new input/output arrays is the same as that
Chris@42 104 of the input/output arrays when the plan was created, unless the plan
Chris@42 105 was created with the <code>FFTW_UNALIGNED</code> flag.
Chris@42 106 <a name="index-FFTW_005fUNALIGNED-1"></a>
Chris@42 107 Here, the alignment is a platform-dependent quantity (for example, it is
Chris@42 108 the address modulo 16 if SSE SIMD instructions are used, but the address
Chris@42 109 modulo 4 for non-SIMD single-precision FFTW on the same machine). In
Chris@42 110 general, only arrays allocated with <code>fftw_malloc</code> are guaranteed to
Chris@42 111 be equally aligned (see <a href="SIMD-alignment-and-fftw_005fmalloc.html#SIMD-alignment-and-fftw_005fmalloc">SIMD alignment and fftw_malloc</a>).
Chris@42 112
Chris@42 113 </li></ul>
Chris@42 114
Chris@42 115 <a name="index-alignment-2"></a>
Chris@42 116 <p>The alignment issue is especially critical, because if you don&rsquo;t use
Chris@42 117 <code>fftw_malloc</code> then you may have little control over the alignment
Chris@42 118 of arrays in memory. For example, neither the C++ <code>new</code> function
Chris@42 119 nor the Fortran <code>allocate</code> statement provide strong enough
Chris@42 120 guarantees about data alignment. If you don&rsquo;t use <code>fftw_malloc</code>,
Chris@42 121 therefore, you probably have to use <code>FFTW_UNALIGNED</code> (which
Chris@42 122 disables most SIMD support). If possible, it is probably better for
Chris@42 123 you to simply create multiple plans (creating a new plan is quick once
Chris@42 124 one exists for a given size), or better yet re-use the same array for
Chris@42 125 your transforms.
Chris@42 126 </p>
Chris@42 127 <a name="index-fftw_005falignment_005fof-1"></a>
Chris@42 128 <p>For rare circumstances in which you cannot control the alignment of
Chris@42 129 allocated memory, but wish to determine where a given array is
Chris@42 130 aligned like the original array for which a plan was created, you can
Chris@42 131 use the <code>fftw_alignment_of</code> function:
Chris@42 132 </p><div class="example">
Chris@42 133 <pre class="example">int fftw_alignment_of(double *p);
Chris@42 134 </pre></div>
Chris@42 135 <p>Two arrays have equivalent alignment (for the purposes of applying a
Chris@42 136 plan) if and only if <code>fftw_alignment_of</code> returns the same value
Chris@42 137 for the corresponding pointers to their data (typecast to <code>double*</code>
Chris@42 138 if necessary).
Chris@42 139 </p>
Chris@42 140 <p>If you are tempted to use the new-array execute interface because you
Chris@42 141 want to transform a known bunch of arrays of the same size, you should
Chris@42 142 probably go use the advanced interface instead (see <a href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>)).
Chris@42 143 </p>
Chris@42 144 <p>The new-array execute functions are:
Chris@42 145 </p>
Chris@42 146 <div class="example">
Chris@42 147 <pre class="example">void fftw_execute_dft(
Chris@42 148 const fftw_plan p,
Chris@42 149 fftw_complex *in, fftw_complex *out);
Chris@42 150
Chris@42 151 void fftw_execute_split_dft(
Chris@42 152 const fftw_plan p,
Chris@42 153 double *ri, double *ii, double *ro, double *io);
Chris@42 154
Chris@42 155 void fftw_execute_dft_r2c(
Chris@42 156 const fftw_plan p,
Chris@42 157 double *in, fftw_complex *out);
Chris@42 158
Chris@42 159 void fftw_execute_split_dft_r2c(
Chris@42 160 const fftw_plan p,
Chris@42 161 double *in, double *ro, double *io);
Chris@42 162
Chris@42 163 void fftw_execute_dft_c2r(
Chris@42 164 const fftw_plan p,
Chris@42 165 fftw_complex *in, double *out);
Chris@42 166
Chris@42 167 void fftw_execute_split_dft_c2r(
Chris@42 168 const fftw_plan p,
Chris@42 169 double *ri, double *ii, double *out);
Chris@42 170
Chris@42 171 void fftw_execute_r2r(
Chris@42 172 const fftw_plan p,
Chris@42 173 double *in, double *out);
Chris@42 174 </pre></div>
Chris@42 175 <a name="index-fftw_005fexecute_005fdft"></a>
Chris@42 176 <a name="index-fftw_005fexecute_005fsplit_005fdft"></a>
Chris@42 177 <a name="index-fftw_005fexecute_005fdft_005fr2c"></a>
Chris@42 178 <a name="index-fftw_005fexecute_005fsplit_005fdft_005fr2c"></a>
Chris@42 179 <a name="index-fftw_005fexecute_005fdft_005fc2r"></a>
Chris@42 180 <a name="index-fftw_005fexecute_005fsplit_005fdft_005fc2r"></a>
Chris@42 181 <a name="index-fftw_005fexecute_005fr2r"></a>
Chris@42 182
Chris@42 183 <p>These execute the <code>plan</code> to compute the corresponding transform on
Chris@42 184 the input/output arrays specified by the subsequent arguments. The
Chris@42 185 input/output array arguments have the same meanings as the ones passed
Chris@42 186 to the guru planner routines in the preceding sections. The <code>plan</code>
Chris@42 187 is not modified, and these routines can be called as many times as
Chris@42 188 desired, or intermixed with calls to the ordinary <code>fftw_execute</code>.
Chris@42 189 </p>
Chris@42 190 <p>The <code>plan</code> <em>must</em> have been created for the transform type
Chris@42 191 corresponding to the execute function, e.g. it must be a complex-DFT
Chris@42 192 plan for <code>fftw_execute_dft</code>. Any of the planner routines for that
Chris@42 193 transform type, from the basic to the guru interface, could have been
Chris@42 194 used to create the plan, however.
Chris@42 195 </p>
Chris@42 196 <hr>
Chris@42 197 <div class="header">
Chris@42 198 <p>
Chris@42 199 Next: <a href="Wisdom.html#Wisdom" accesskey="n" rel="next">Wisdom</a>, Previous: <a href="Guru-Interface.html#Guru-Interface" accesskey="p" rel="prev">Guru Interface</a>, Up: <a href="FFTW-Reference.html#FFTW-Reference" accesskey="u" rel="up">FFTW Reference</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
Chris@42 200 </div>
Chris@42 201
Chris@42 202
Chris@42 203
Chris@42 204 </body>
Chris@42 205 </html>