FTransform.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2006 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9#ifndef __FTransform_h_
10#define __FTransform_h_
11
12#include "Reference.h"
13
14#include <string>
15#include <vector>
16
18namespace FTransform {
19
20 /* ////////////////////////////////////////////////////////////////////
21
22 One-dimensional FFT library interface
23
25
27
28 void frc1d (size_t nfft, float* into, const float* from);
29
31
32 void bcr1d (size_t nfft, float* into, const float* from);
33
35 void fcc1d (size_t nfft, float* into, const float* from);
36
38 void bcc1d (size_t nfft, float* into, const float* from);
39
41 extern bool optimize;
42
44 extern bool simd;
45
47 extern unsigned nthread;
48
50 std::string get_library ();
51
53 void set_library (const std::string& name);
54
56 unsigned get_num_libraries ();
57
59 std::string get_library_name (unsigned i);
60
62 void clean_plans();
63
65 enum normalization { normalized, unnormalized };
66
68 enum direction { forward = 0x10, backward = 0x20 };
69
71 enum dimension { real = 0x01, analytic = 0x02 };
72
74 enum type {
76 frc = forward | real,
78 bcr = backward | real,
80 fcc = forward | analytic,
82 bcc = backward | analytic
83 };
84
87
89 double get_scale (size_t nfft, type t);
90
92 void shift (unsigned npts, float* arr, double shift);
93
95 void derivative (unsigned npts, float* data);
96
98 int inplace_frc1d(size_t nfft, float* srcdest);
100 int inplace_fcc1d(size_t nfft, float* srcdest);
102 int inplace_bcc1d(size_t nfft, float* srcdest);
104 int inplace_bcr1d(size_t nfft, float* srcdest);
105
106
107 /* ////////////////////////////////////////////////////////////////////
108
109 Two-dimensional FFT library interface
110
112
114 void fcc2d (size_t nx, size_t ny, float* into, const float* from);
115
117 void bcc2d (size_t nx, size_t ny, float* into, const float* from);
118
119}
120
121#endif
122
Defines a single interface to a variety of Fourier transform libraries.
Definition FFTW3_Transform.h:14
double get_scale(size_t nfft, type t)
Returns the scale factor associated with the FFT operation.
Definition FTransform.C:109
unsigned nthread
Number of threads that will use the plan.
Definition FTransform.C:19
type
The FFT type.
Definition FTransform.h:74
@ fcc
forward complex to complex
Definition FTransform.h:80
@ frc
forward real to complex
Definition FTransform.h:76
@ bcc
backward complex to complex
Definition FTransform.h:82
@ bcr
backward complex to real
Definition FTransform.h:78
int inplace_bcr1d(size_t nfft, float *srcdest)
Inplace wrapper-function- performs a memcpy after FFTing.
Definition FTransform.C:209
void set_library(const std::string &name)
Set the library to the specified name.
Definition FTransform.C:146
bool simd
Whether to use SIMD or not.
Definition FTransform.C:18
void fcc1d(size_t nfft, float *into, const float *from)
Forward complex-to-complex FFT.
Definition FTransform.C:51
normalization
The normalization convention.
Definition FTransform.h:65
void clean_plans()
Clears out the memory associated with the plans.
Definition FTransform.C:130
normalization get_norm()
Returns the normalization convention of the currently selected library.
Definition FTransform.C:102
int inplace_fcc1d(size_t nfft, float *srcdest)
Inplace wrapper-function- performs a memcpy after FFTing.
Definition FTransform.C:179
unsigned get_num_libraries()
Get the number of available libraries.
Definition FTransform.C:152
int inplace_bcc1d(size_t nfft, float *srcdest)
Inplace wrapper-function- performs a memcpy after FFTing.
Definition FTransform.C:194
void shift(unsigned npts, float *arr, double shift)
Use the Fourier transform to cyclically shift the elements in array.
Definition shift.C:16
void bcc1d(size_t nfft, float *into, const float *from)
Backward complex-to-complex FFT.
Definition FTransform.C:57
void derivative(unsigned npts, float *data)
Use the Fourier transform to compute the derivative of data.
Definition derivative.C:16
int inplace_frc1d(size_t nfft, float *srcdest)
Inplace wrapper-function- performs a memcpy after FFTing.
Definition FTransform.C:164
bool optimize
Whether to optimize or not.
Definition FTransform.C:17
void bcr1d(size_t nfft, float *into, const float *from)
Backward complex-to-real FFT.
Definition FTransform.C:45
dimension
The FFT dimension.
Definition FTransform.h:71
void frc1d(size_t nfft, float *into, const float *from)
Forward real-to-complex FFT.
Definition FTransform.C:39
std::string get_library()
Returns the name of the currently selected library.
Definition FTransform.C:96
std::string get_library_name(unsigned i)
Get the name of the ith available library.
Definition FTransform.C:158
direction
The FFT direction.
Definition FTransform.h:68

Generated using doxygen 1.14.0