Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFFTComplex.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_TFFTComplex
13#define ROOT_TFFTComplex
14
15#include "TVirtualFFT.h"
16#include "TString.h"
17
18class TComplex;
19
20class TFFTComplex : public TVirtualFFT{
21protected:
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 Int_t fSign; //sign of the exponent of the transform (-1 is FFTW_FORWARD and +1 FFTW_BACKWARD)
29 TString fFlags; //transform flags
30
31 UInt_t MapFlag(Option_t *flag);
32
33public:
35 TFFTComplex(Int_t n, Bool_t inPlace);
36 TFFTComplex(Int_t ndim, Int_t *n, Bool_t inPlace = kFALSE);
37 ~TFFTComplex() override;
38
39 void Init(Option_t *flags, Int_t sign, const Int_t* /*kind*/) override;
40
41 Int_t *GetN() const override {return fN;}
42 Int_t GetNdim() const override {return fNdim;}
43 virtual Int_t GetSize() const {return fTotalSize;}
44 Option_t *GetType() const override {if (fSign==-1) return "C2CBackward"; else return "C2CForward";}
45 Int_t GetSign() const override {return fSign;}
46 Option_t *GetTransformFlag() const override {return fFlags;}
47 Bool_t IsInplace() const override {if (fOut) return kTRUE; else return kFALSE;};
48
49 void GetPoints(Double_t *data, Bool_t fromInput = kFALSE) const override;
50 Double_t GetPointReal(Int_t /*ipoint*/, Bool_t /*fromInput = kFALSE*/) const override {return 0;};
51 Double_t GetPointReal(const Int_t* /*ipoint*/, Bool_t /*fromInput=kFALSE*/) const override{return 0;}
52 void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const override;
53 void GetPointComplex(const Int_t *ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const override;
54 Double_t* GetPointsReal(Bool_t /*fromInput=kFALSE*/) const override {return nullptr;};
55 void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput = kFALSE) const override ;
56 void GetPointsComplex(Double_t *data, Bool_t fromInput = kFALSE) const override ;
57
58 void SetPoint(Int_t ipoint, Double_t re, Double_t im = 0) override;
59 void SetPoint(const Int_t *ipoint, Double_t re, Double_t im = 0) override;
60 void SetPoints(const Double_t *data) override;
61 void SetPointComplex(Int_t ipoint, TComplex &c) override;
62 void SetPointsComplex(const Double_t *re, const Double_t *im) override;
63 void Transform() override;
64
66};
67
68#endif
#define c(i)
Definition RSha256.hxx:101
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
One of the interface classes to the FFTW package, can be used directly or via the TVirtualFFT class.
Definition TFFTComplex.h:20
Option_t * GetType() const override
Definition TFFTComplex.h:44
Int_t fTotalSize
Definition TFFTComplex.h:26
void * fPlan
Definition TFFTComplex.h:24
UInt_t MapFlag(Option_t *flag)
allowed options:
void SetPoints(const Double_t *data) override
set all points.
void SetPointComplex(Int_t ipoint, TComplex &c) override
void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput=kFALSE) const override
Copies real and imaginary parts of the output (input) into the argument arrays.
void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const override
Copies the output(or input) into the argument array.
void SetPointsComplex(const Double_t *re, const Double_t *im) override
set all points. the values are copied
Bool_t IsInplace() const override
Definition TFFTComplex.h:47
Double_t GetPointReal(Int_t, Bool_t) const override
Definition TFFTComplex.h:50
void Transform() override
Computes the transform, specified in Init() function.
Int_t * GetN() const override
Definition TFFTComplex.h:41
Double_t GetPointReal(const Int_t *, Bool_t) const override
Definition TFFTComplex.h:51
TString fFlags
Definition TFFTComplex.h:29
TFFTComplex()
default
Option_t * GetTransformFlag() const override
Definition TFFTComplex.h:46
void Init(Option_t *flags, Int_t sign, const Int_t *) override
Creates the fftw-plan.
void * fOut
Definition TFFTComplex.h:23
virtual Int_t GetSize() const
Definition TFFTComplex.h:43
Int_t * fN
Definition TFFTComplex.h:27
Int_t GetSign() const override
Definition TFFTComplex.h:45
~TFFTComplex() override
Destroys the data arrays and the plan.
Int_t GetNdim() const override
Definition TFFTComplex.h:42
Double_t * GetPointsReal(Bool_t) const override
Definition TFFTComplex.h:54
void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const override
returns real and imaginary parts of the point #ipoint
void SetPoint(Int_t ipoint, Double_t re, Double_t im=0) override
sets real and imaginary parts of point # ipoint
Basic string class.
Definition TString.h:139
TVirtualFFT is an interface class for Fast Fourier Transforms.
Definition TVirtualFFT.h:88
const Int_t n
Definition legend1.C:16