annotate Lib/fftw-3.2.1/doc/html/.svn/text-base/Words-of-Wisdom_002dSaving-Plans.html.svn-base @ 9:262e084a15a9

Vectorised everything and made use of unique_ptr so there should be no more memory leaks. Hurrah for RAII
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Wed, 12 Aug 2015 22:25:06 +0100
parents 25bf17994ef1
children
rev   line source
d@0 1 <html lang="en">
d@0 2 <head>
d@0 3 <title>Words of Wisdom-Saving Plans - FFTW 3.2.1</title>
d@0 4 <meta http-equiv="Content-Type" content="text/html">
d@0 5 <meta name="description" content="FFTW 3.2.1">
d@0 6 <meta name="generator" content="makeinfo 4.8">
d@0 7 <link title="Top" rel="start" href="index.html#Top">
d@0 8 <link rel="up" href="Other-Important-Topics.html#Other-Important-Topics" title="Other Important Topics">
d@0 9 <link rel="prev" href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format" title="Multi-dimensional Array Format">
d@0 10 <link rel="next" href="Caveats-in-Using-Wisdom.html#Caveats-in-Using-Wisdom" title="Caveats in Using Wisdom">
d@0 11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
d@0 12 <!--
d@0 13 This manual is for FFTW
d@0 14 (version 3.2.1, 5 February 2009).
d@0 15
d@0 16 Copyright (C) 2003 Matteo Frigo.
d@0 17
d@0 18 Copyright (C) 2003 Massachusetts Institute of Technology.
d@0 19
d@0 20 Permission is granted to make and distribute verbatim copies of
d@0 21 this manual provided the copyright notice and this permission
d@0 22 notice are preserved on all copies.
d@0 23
d@0 24 Permission is granted to copy and distribute modified versions of
d@0 25 this manual under the conditions for verbatim copying, provided
d@0 26 that the entire resulting derived work is distributed under the
d@0 27 terms of a permission notice identical to this one.
d@0 28
d@0 29 Permission is granted to copy and distribute translations of this
d@0 30 manual into another language, under the above conditions for
d@0 31 modified versions, except that this permission notice may be
d@0 32 stated in a translation approved by the Free Software Foundation.
d@0 33 -->
d@0 34 <meta http-equiv="Content-Style-Type" content="text/css">
d@0 35 <style type="text/css"><!--
d@0 36 pre.display { font-family:inherit }
d@0 37 pre.format { font-family:inherit }
d@0 38 pre.smalldisplay { font-family:inherit; font-size:smaller }
d@0 39 pre.smallformat { font-family:inherit; font-size:smaller }
d@0 40 pre.smallexample { font-size:smaller }
d@0 41 pre.smalllisp { font-size:smaller }
d@0 42 span.sc { font-variant:small-caps }
d@0 43 span.roman { font-family:serif; font-weight:normal; }
d@0 44 span.sansserif { font-family:sans-serif; font-weight:normal; }
d@0 45 --></style>
d@0 46 </head>
d@0 47 <body>
d@0 48 <div class="node">
d@0 49 <p>
d@0 50 <a name="Words-of-Wisdom-Saving-Plans"></a>
d@0 51 <a name="Words-of-Wisdom_002dSaving-Plans"></a>
d@0 52 Next:&nbsp;<a rel="next" accesskey="n" href="Caveats-in-Using-Wisdom.html#Caveats-in-Using-Wisdom">Caveats in Using Wisdom</a>,
d@0 53 Previous:&nbsp;<a rel="previous" accesskey="p" href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>,
d@0 54 Up:&nbsp;<a rel="up" accesskey="u" href="Other-Important-Topics.html#Other-Important-Topics">Other Important Topics</a>
d@0 55 <hr>
d@0 56 </div>
d@0 57
d@0 58 <h3 class="section">3.3 Words of Wisdom&mdash;Saving Plans</h3>
d@0 59
d@0 60 <p><a name="index-wisdom-121"></a><a name="index-saving-plans-to-disk-122"></a>
d@0 61 FFTW implements a method for saving plans to disk and restoring them.
d@0 62 In fact, what FFTW does is more general than just saving and loading
d@0 63 plans. The mechanism is called <dfn>wisdom</dfn>. Here, we describe
d@0 64 this feature at a high level. See <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>, for a less casual
d@0 65 but more complete discussion of how to use wisdom in FFTW.
d@0 66
d@0 67 <p>Plans created with the <code>FFTW_MEASURE</code>, <code>FFTW_PATIENT</code>, or
d@0 68 <code>FFTW_EXHAUSTIVE</code> options produce near-optimal FFT performance,
d@0 69 but may require a long time to compute because FFTW must measure the
d@0 70 runtime of many possible plans and select the best one. This setup is
d@0 71 designed for the situations where so many transforms of the same size
d@0 72 must be computed that the start-up time is irrelevant. For short
d@0 73 initialization times, but slower transforms, we have provided
d@0 74 <code>FFTW_ESTIMATE</code>. The <code>wisdom</code> mechanism is a way to get the
d@0 75 best of both worlds: you compute a good plan once, save it to
d@0 76 disk, and later reload it as many times as necessary. The wisdom
d@0 77 mechanism can actually save and reload many plans at once, not just
d@0 78 one.
d@0 79 <a name="index-FFTW_005fMEASURE-123"></a><a name="index-FFTW_005fPATIENT-124"></a><a name="index-FFTW_005fEXHAUSTIVE-125"></a><a name="index-FFTW_005fESTIMATE-126"></a>
d@0 80 Whenever you create a plan, the FFTW planner accumulates wisdom, which
d@0 81 is information sufficient to reconstruct the plan. After planning,
d@0 82 you can save this information to disk by means of the function:
d@0 83 <pre class="example"> void fftw_export_wisdom_to_file(FILE *output_file);
d@0 84 </pre>
d@0 85 <p><a name="index-fftw_005fexport_005fwisdom_005fto_005ffile-127"></a>
d@0 86 The next time you run the program, you can restore the wisdom with
d@0 87 <code>fftw_import_wisdom_from_file</code> (which returns non-zero on success),
d@0 88 and then recreate the plan using the same flags as before.
d@0 89 <pre class="example"> int fftw_import_wisdom_from_file(FILE *input_file);
d@0 90 </pre>
d@0 91 <p><a name="index-fftw_005fimport_005fwisdom_005ffrom_005ffile-128"></a>
d@0 92 Wisdom is automatically used for any size to which it is applicable, as
d@0 93 long as the planner flags are not more &ldquo;patient&rdquo; than those with which
d@0 94 the wisdom was created. For example, wisdom created with
d@0 95 <code>FFTW_MEASURE</code> can be used if you later plan with
d@0 96 <code>FFTW_ESTIMATE</code> or <code>FFTW_MEASURE</code>, but not with
d@0 97 <code>FFTW_PATIENT</code>.
d@0 98
d@0 99 <p>The <code>wisdom</code> is cumulative, and is stored in a global, private
d@0 100 data structure managed internally by FFTW. The storage space required
d@0 101 is minimal, proportional to the logarithm of the sizes the wisdom was
d@0 102 generated from. If memory usage is a concern, however, the wisdom can
d@0 103 be forgotten and its associated memory freed by calling:
d@0 104 <pre class="example"> void fftw_forget_wisdom(void);
d@0 105 </pre>
d@0 106 <p><a name="index-fftw_005fforget_005fwisdom-129"></a>
d@0 107 Wisdom can be exported to a file, a string, or any other medium.
d@0 108 For details, see <a href="Wisdom.html#Wisdom">Wisdom</a>.
d@0 109
d@0 110 </body></html>
d@0 111