annotate fft/fftw/fftw-3.3.4/doc/html/Words-of-Wisdom_002dSaving-Plans.html @ 40:223f770b5341 kissfft-double tip

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