All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gsl_fft.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2014, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 /** \file gsl_fft.h
24  \brief File defining \ref o2scl::gsl_fft
25 */
26 #ifndef O2SCL_GSL_FFT_H
27 #define O2SCL_GSL_FFT_H
28 
29 #include <iostream>
30 #include <gsl/gsl_errno.h>
31 #include <gsl/gsl_fft_real.h>
32 #include <gsl/gsl_fft_halfcomplex.h>
33 
34 #ifndef DOXYGEN_NO_O2NS
35 namespace o2scl {
36 #endif
37 
38  /** \brief Real mixed-radix fast Fourier transform
39 
40  This is a simple wrapper for the GSL FFT functions which
41  automatically allocates the necessary memory.
42 
43  \future Generalize to generic vector types.
44  */
45  class gsl_fft {
46  public:
47 
48  gsl_fft();
49 
50  virtual ~gsl_fft();
51 
52  /** \brief Perform the FFT transform
53  */
54  int transform(int n, double *x);
55 
56  /** \brief Perform the inverse FFT transform
57  */
58  int inverse_transform(int n, double *x);
59 
60 #ifndef DOXYGEN_INTERNAL
61 
62  protected:
63 
64  /// The current memory size
65  int mem_size;
66 
67  /// Reallocate memory
68  int mem_resize(int new_size);
69 
70  /// The GSL workspace
71  gsl_fft_real_workspace *work;
72 
73  /// The table for the forward transform
74  gsl_fft_real_wavetable *real;
75 
76  /// The table for the inverse transform
77  gsl_fft_halfcomplex_wavetable *hc;
78 
79 #endif
80 
81  };
82 
83 #ifndef DOXYGEN_NO_O2NS
84 }
85 #endif
86 
87 #endif
gsl_fft_real_workspace * work
The GSL workspace.
Definition: gsl_fft.h:71
int mem_resize(int new_size)
Reallocate memory.
gsl_fft_real_wavetable * real
The table for the forward transform.
Definition: gsl_fft.h:74
int transform(int n, double *x)
Perform the FFT transform.
Real mixed-radix fast Fourier transform.
Definition: gsl_fft.h:45
int mem_size
The current memory size.
Definition: gsl_fft.h:65
int inverse_transform(int n, double *x)
Perform the inverse FFT transform.
gsl_fft_halfcomplex_wavetable * hc
The table for the inverse transform.
Definition: gsl_fft.h:77

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..