comparison Lib/fftw-3.2.1/doc/html/.svn/text-base/Using-Plans.html.svn-base @ 0:25bf17994ef1

First commit. VS2013, Codeblocks and Mac OSX configuration
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Thu, 09 Jul 2015 01:12:16 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:25bf17994ef1
1 <html lang="en">
2 <head>
3 <title>Using Plans - FFTW 3.2.1</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="FFTW 3.2.1">
6 <meta name="generator" content="makeinfo 4.8">
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="Data-Types-and-Files.html#Data-Types-and-Files" title="Data Types and Files">
10 <link rel="next" href="Basic-Interface.html#Basic-Interface" title="Basic Interface">
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.2.1, 5 February 2009).
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 <p>
50 <a name="Using-Plans"></a>
51 Next:&nbsp;<a rel="next" accesskey="n" href="Basic-Interface.html#Basic-Interface">Basic Interface</a>,
52 Previous:&nbsp;<a rel="previous" accesskey="p" href="Data-Types-and-Files.html#Data-Types-and-Files">Data Types and Files</a>,
53 Up:&nbsp;<a rel="up" accesskey="u" href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>
54 <hr>
55 </div>
56
57 <h3 class="section">4.2 Using Plans</h3>
58
59 <p>Plans for all transform types in FFTW are stored as type
60 <code>fftw_plan</code> (an opaque pointer type), and are created by one of the
61 various planning routines described in the following sections.
62 <a name="index-fftw_005fplan-146"></a>An <code>fftw_plan</code> contains all information necessary to compute the
63 transform, including the pointers to the input and output arrays.
64
65 <pre class="example"> void fftw_execute(const fftw_plan plan);
66 </pre>
67 <p><a name="index-fftw_005fexecute-147"></a>
68 This executes the <code>plan</code>, to compute the corresponding transform on
69 the arrays for which it was planned (which must still exist). The plan
70 is not modified, and <code>fftw_execute</code> can be called as many times as
71 desired.
72
73 <p>To apply a given plan to a different array, you can use the new-array execute
74 interface. See <a href="New_002darray-Execute-Functions.html#New_002darray-Execute-Functions">New-array Execute Functions</a>.
75
76 <p><code>fftw_execute</code> (and equivalents) is the only function in FFTW
77 guaranteed to be thread-safe; see <a href="Thread-safety.html#Thread-safety">Thread safety</a>.
78
79 <p>This function:
80 <pre class="example"> void fftw_destroy_plan(fftw_plan plan);
81 </pre>
82 <p><a name="index-fftw_005fdestroy_005fplan-148"></a>deallocates the <code>plan</code> and all its associated data.
83
84 <p>FFTW's planner saves some other persistent data, such as the
85 accumulated wisdom and a list of algorithms available in the current
86 configuration. If you want to deallocate all of that and reset FFTW
87 to the pristine state it was in when you started your program, you can
88 call:
89
90 <pre class="example"> void fftw_cleanup(void);
91 </pre>
92 <p><a name="index-fftw_005fcleanup-149"></a>
93 After calling <code>fftw_cleanup</code>, all existing plans become undefined,
94 and you should not attempt to execute them nor to destroy them. You can
95 however create and execute/destroy new plans, in which case FFTW starts
96 accumulating wisdom information again.
97
98 <p><code>fftw_cleanup</code> does not deallocate your plans; you should still
99 call <code>fftw_destroy_plan</code> for this purpose.
100
101 <p>The following two routines are provided purely for academic purposes
102 (that is, for entertainment).
103
104 <pre class="example"> void fftw_flops(const fftw_plan plan,
105 double *add, double *mul, double *fma);
106 </pre>
107 <p><a name="index-fftw_005fflops-150"></a>
108 Given a <code>plan</code>, set <code>add</code>, <code>mul</code>, and <code>fma</code> to an
109 exact count of the number of floating-point additions, multiplications,
110 and fused multiply-add operations involved in the plan's execution. The
111 total number of floating-point operations (flops) is <code>add + mul +
112 2*fma</code>, or <code>add + mul + fma</code> if the hardware supports fused
113 multiply-add instructions (although the number of FMA operations is only
114 approximate because of compiler voodoo). (The number of operations
115 should be an integer, but we use <code>double</code> to avoid overflowing
116 <code>int</code> for large transforms; the arguments are of type <code>double</code>
117 even for single and long-double precision versions of FFTW.)
118
119 <pre class="example"> void fftw_fprint_plan(const fftw_plan plan, FILE *output_file);
120 void fftw_print_plan(const fftw_plan plan);
121 </pre>
122 <p><a name="index-fftw_005ffprint_005fplan-151"></a><a name="index-fftw_005fprint_005fplan-152"></a>
123 This outputs a &ldquo;nerd-readable&rdquo; representation of the <code>plan</code> to
124 the given file or to <code>stdout</code>, respectively.
125
126 <!-- -->
127 </body></html>
128