/usr/share/doc/libfftw3-doc/html/Complex-numbers.html is in libfftw3-doc 3.3.2-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | <html lang="en">
<head>
<title>Complex numbers - FFTW 3.3.2</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="FFTW 3.3.2">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Data-Types-and-Files.html#Data-Types-and-Files" title="Data Types and Files">
<link rel="prev" href="Data-Types-and-Files.html#Data-Types-and-Files" title="Data Types and Files">
<link rel="next" href="Precision.html#Precision" title="Precision">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual is for FFTW
(version 3.3.2, 28 April 2012).
Copyright (C) 2003 Matteo Frigo.
Copyright (C) 2003 Massachusetts Institute of Technology.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission
notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided
that the entire resulting derived work is distributed under the
terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for
modified versions, except that this permission notice may be
stated in a translation approved by the Free Software Foundation.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Complex-numbers"></a>
<p>
Next: <a rel="next" accesskey="n" href="Precision.html#Precision">Precision</a>,
Previous: <a rel="previous" accesskey="p" href="Data-Types-and-Files.html#Data-Types-and-Files">Data Types and Files</a>,
Up: <a rel="up" accesskey="u" href="Data-Types-and-Files.html#Data-Types-and-Files">Data Types and Files</a>
<hr>
</div>
<h4 class="subsection">4.1.1 Complex numbers</h4>
<p>The default FFTW interface uses <code>double</code> precision for all
floating-point numbers, and defines a <code>fftw_complex</code> type to hold
complex numbers as:
<pre class="example"> typedef double fftw_complex[2];
</pre>
<p><a name="index-fftw_005fcomplex-139"></a>
Here, the <code>[0]</code> element holds the real part and the <code>[1]</code>
element holds the imaginary part.
<p>Alternatively, if you have a C compiler (such as <code>gcc</code>) that
supports the C99 revision of the ANSI C standard, you can use C's new
native complex type (which is binary-compatible with the typedef above).
In particular, if you <code>#include <complex.h></code> <em>before</em>
<code><fftw3.h></code>, then <code>fftw_complex</code> is defined to be the native
complex type and you can manipulate it with ordinary arithmetic
(e.g. <code>x = y * (3+4*I)</code>, where <code>x</code> and <code>y</code> are
<code>fftw_complex</code> and <code>I</code> is the standard symbol for the
imaginary unit);
<a name="index-C99-140"></a>
<p>C++ has its own <code>complex<T></code> template class, defined in the
standard <code><complex></code> header file. Reportedly, the C++ standards
committee has recently agreed to mandate that the storage format used
for this type be binary-compatible with the C99 type, i.e. an array
<code>T[2]</code> with consecutive real <code>[0]</code> and imaginary <code>[1]</code>
parts. (See report
<a href="http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2002/n1388.pdf WG21/N1388">http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2002/n1388.pdf WG21/N1388</a>.) Although not part of the official standard as of this
writing, the proposal stated that: “This solution has been tested with
all current major implementations of the standard library and shown to
be working.” To the extent that this is true, if you have a variable
<code>complex<double> *x</code>, you can pass it directly to FFTW via
<code>reinterpret_cast<fftw_complex*>(x)</code>.
<a name="index-C_002b_002b-141"></a><a name="index-portability-142"></a>
<!-- =========> -->
</body></html>
|