casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FFTW.h
Go to the documentation of this file.
1 //# Copyright (C) 1993,1994,1995,1997,1999,2000,2001
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 //# $Id$
27 
28 #ifndef SCIMATH_FFTW_H
29 #define SCIMATH_FFTW_H
30 
31 #include <casacore/casa/aips.h>
36 #include <casacore/casa/OS/Mutex.h>
37 
38 namespace casacore {
39 
40 //# Forward Declarations.
41 class FFTWPlan;
42 class FFTWPlanf;
43 
44 // <summary> C++ interface to the FFTWw library </summary>
45 // <reviewed reviewer="NONE" date="" tests="" demos="">
46 // </reviewed>
47 // <synopsis>
48 // This is a wrapper of FFTW3.
49 // It is only active if FFTW3 was found during the build.
50 // If not found, all functions won't do anything at all.
51 //
52 // The interface is such that the presence of FFTW3 is only visible
53 // in the implementation. The header file does not need to know.
54 // In this way external code using this class does not need to set HAVE_FFTW.
55 // </synopsis>
56 
57 class FFTW
58 {
59 public:
60  FFTW() ;
61 
62  ~FFTW() ;
63 
64  // polymorphic interface to fftw[f]_plan...
65  void plan_r2c(const IPosition &size, Float *in, Complex *out) ;
66  void plan_r2c(const IPosition &size, Double *in, DComplex *out) ;
67  void plan_c2r(const IPosition &size, Complex *in, Float *out) ;
68  void plan_c2r(const IPosition &size, DComplex *in, Double *out) ;
69  void plan_c2c_forward(const IPosition &size, DComplex *in) ;
70  void plan_c2c_forward(const IPosition &size, Complex *in) ;
71  void plan_c2c_backward(const IPosition &size, DComplex *in) ;
72  void plan_c2c_backward(const IPosition &size, Complex *in) ;
73 
74  // polymorphic interface to fftw[f]_execute...
75  void r2c(const IPosition &size, Float *in, Complex *out) ;
76  void r2c(const IPosition &size, Double *in, DComplex *out) ;
77  void c2r(const IPosition &size, Complex *in, Float *out);
78  void c2r(const IPosition &size, DComplex *in, Double *out);
79  void c2c(const IPosition &size, Complex *in, Bool forward);
80  void c2c(const IPosition &size, DComplex *in, Bool forward);
81 
82 private:
83  FFTWPlanf* itsPlanR2Cf;
84  FFTWPlan* itsPlanR2C;
85 
86  FFTWPlanf* itsPlanC2Rf;
87  FFTWPlan* itsPlanC2R;
88 
89  FFTWPlanf* itsPlanC2CFf; // forward
90  FFTWPlan* itsPlanC2CF;
91 
92  FFTWPlanf* itsPlanC2CBf; // backward
93  FFTWPlan* itsPlanC2CB;
94 
95  unsigned flags;
96 
97  static volatile Bool is_initialized_fftw; // FFTW needs initialization
98  // only once per process,
99  // not once per object
100  static Mutex theirMutex; // Initialization mutex
101 };
102 
103 } //# NAMESPACE CASACORE - END
104 
105 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void plan_c2c_backward(const IPosition &size, DComplex *in)
FFTWPlan * itsPlanC2CB
Definition: FFTW.h:93
void plan_c2c_forward(const IPosition &size, DComplex *in)
void c2r(const IPosition &size, Complex *in, Float *out)
static volatile Bool is_initialized_fftw
Definition: FFTW.h:97
FFTWPlanf * itsPlanC2Rf
Definition: FFTW.h:86
FFTWPlan * itsPlanR2C
Definition: FFTW.h:84
void c2c(const IPosition &size, Complex *in, Bool forward)
size_t size() const
C++ interface to the FFTWw library.
Definition: FFTW.h:57
FFTWPlan * itsPlanC2R
Definition: FFTW.h:87
unsigned flags
Definition: FFTW.h:95
double Double
Definition: aipstype.h:55
FFTWPlanf * itsPlanR2Cf
Definition: FFTW.h:83
FFTWPlan * itsPlanC2CF
Definition: FFTW.h:90
FFTWPlanf * itsPlanC2CFf
Definition: FFTW.h:89
void r2c(const IPosition &size, Float *in, Complex *out)
polymorphic interface to fftw[f]_execute...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static Mutex theirMutex
only once per process, not once per object
Definition: FFTW.h:100
float Float
Definition: aipstype.h:54
Wrapper around a pthreads mutex.
Definition: Mutex.h:58
FFTWPlanf * itsPlanC2CBf
Definition: FFTW.h:92
void plan_r2c(const IPosition &size, Float *in, Complex *out)
polymorphic interface to fftw[f]_plan...
void plan_c2r(const IPosition &size, Complex *in, Float *out)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42