Logo ROOT  
Reference Guide
TFFTReal.h
Go to the documentation of this file.
1// @(#)root/fft:$Id$
2// Author: Anna Kreshuk 07/4/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TFFTReal
13#define ROOT_TFFTReal
14
15#include "TVirtualFFT.h"
16#include "TString.h"
17
18class TComplex;
19
20class TFFTReal: public TVirtualFFT{
21 protected:
22 void *fIn; //input array
23 void *fOut; //output array
24 void *fPlan; //fftw plan (the plan how to compute the transform)
25 Int_t fNdim; //number of dimensions
26 Int_t fTotalSize; //total size of the transform
27 Int_t *fN; //transform sizes in each dimension
28 void *fKind; //transform kinds in each dimension
29 TString fFlags; //transform flags
30
31 Int_t MapOptions(const Int_t *kind);
32 UInt_t MapFlag(Option_t *flag);
33
34 public:
35 TFFTReal();
36 TFFTReal(Int_t n, Bool_t inPlace=kFALSE);
37 TFFTReal(Int_t ndim, Int_t *n, Bool_t inPlace=kFALSE);
38 virtual ~TFFTReal();
39
40 virtual void Init( Option_t *flags,Int_t sign, const Int_t *kind);
41
42 virtual Int_t GetSize() const {return fTotalSize;}
43 virtual Int_t *GetN() const {return fN;}
44 virtual Int_t GetNdim() const {return fNdim;}
45 virtual Option_t *GetType() const;
46 virtual Int_t GetSign() const {return 0;}
47 virtual Option_t *GetTransformFlag() const {return fFlags;}
48 virtual Bool_t IsInplace() const {if (fOut) return kTRUE; else return kFALSE;}
49
50 virtual void GetPoints(Double_t *data, Bool_t fromInput = kFALSE) const;
51 virtual Double_t GetPointReal(Int_t ipoint, Bool_t fromInput = kFALSE) const;
52 virtual Double_t GetPointReal(const Int_t *ipoint, Bool_t fromInput = kFALSE) const;
53 virtual void GetPointComplex(const Int_t *ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const;
54
55 virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const;
56
57 virtual Double_t *GetPointsReal(Bool_t fromInput=kFALSE) const;
58 virtual void GetPointsComplex(Double_t* /*re*/, Double_t* /*im*/, Bool_t /*fromInput = kFALSE*/) const{};
59 virtual void GetPointsComplex(Double_t* /*data*/, Bool_t /*fromInput = kFALSE*/) const {};
60
61 virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im = 0);
62 virtual void SetPoint(const Int_t *ipoint, Double_t re, Double_t /*im=0*/);
63 virtual void SetPoints(const Double_t *data);
64 virtual void SetPointComplex(Int_t /*ipoint*/, TComplex &/*c*/){};
65 virtual void SetPointsComplex(const Double_t* /*re*/, const Double_t* /*im*/){};
66 virtual void Transform();
67
68
70};
71
72#endif
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
One of the interface classes to the FFTW package, can be used directly or via the TVirtualFFT class.
Definition: TFFTReal.h:20
virtual Int_t * GetN() const
Definition: TFFTReal.h:43
virtual void Transform()
Computes the transform, specified in Init() function.
Definition: TFFTReal.cxx:197
virtual void SetPointsComplex(const Double_t *, const Double_t *)
Definition: TFFTReal.h:65
Int_t fNdim
Definition: TFFTReal.h:25
virtual void GetPointsComplex(Double_t *, Double_t *, Bool_t) const
Definition: TFFTReal.h:58
virtual void Init(Option_t *flags, Int_t sign, const Int_t *kind)
Creates the fftw-plan.
Definition: TFFTReal.cxx:176
virtual Option_t * GetType() const
Returns the type of the transform.
Definition: TFFTReal.cxx:210
virtual void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const
Copies the output (or input) points into the provided array, that should be big enough.
Definition: TFFTReal.cxx:226
void * fPlan
Definition: TFFTReal.h:24
UInt_t MapFlag(Option_t *flag)
allowed options:
Definition: TFFTReal.cxx:403
virtual void GetPointsComplex(Double_t *, Bool_t) const
Definition: TFFTReal.h:59
Int_t fTotalSize
Definition: TFFTReal.h:26
virtual Double_t * GetPointsReal(Bool_t fromInput=kFALSE) const
Returns the output (or input) array we have 4 different cases:
Definition: TFFTReal.cxx:296
virtual void GetPointComplex(const Int_t *ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const
Only for input of HC2R and output of R2HC and for 1d.
Definition: TFFTReal.cxx:282
Int_t * fN
Definition: TFFTReal.h:27
virtual Int_t GetNdim() const
Definition: TFFTReal.h:44
TString fFlags
Definition: TFFTReal.h:29
virtual Option_t * GetTransformFlag() const
Definition: TFFTReal.h:47
void * fOut
Definition: TFFTReal.h:23
virtual void SetPoints(const Double_t *data)
Sets all points.
Definition: TFFTReal.cxx:348
virtual void SetPointComplex(Int_t, TComplex &)
Definition: TFFTReal.h:64
TFFTReal()
default
Definition: TFFTReal.cxx:69
virtual Int_t GetSize() const
Definition: TFFTReal.h:42
void * fIn
Definition: TFFTReal.h:22
virtual Int_t GetSign() const
Definition: TFFTReal.h:46
virtual ~TFFTReal()
clean-up
Definition: TFFTReal.cxx:124
Int_t MapOptions(const Int_t *kind)
transfers the r2r_kind parameters to fftw type
Definition: TFFTReal.cxx:357
virtual Bool_t IsInplace() const
Definition: TFFTReal.h:48
void * fKind
Definition: TFFTReal.h:28
virtual Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const
For 1d tranforms. Returns point #ipoint.
Definition: TFFTReal.cxx:236
virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im=0)
Definition: TFFTReal.cxx:311
Basic string class.
Definition: TString.h:131
TVirtualFFT is an interface class for Fast Fourier Transforms.
Definition: TVirtualFFT.h:88
const Int_t n
Definition: legend1.C:16