83 static inline SP::FFTW_Complex
New() {
151 mWork=mValue[0]*s[0]-mValue[1]*s[1];
152 mValue[1]=mValue[0]*s[1]+mValue[1]*s[0];
162 mWork=mValue[0]*s[0]-mValue[1]*s[1];
163 mValue[1]=mValue[0]*s[1]+mValue[1]*s[0];
173 if (s==0)
throw CORE_Exception(
"math/signam",
"FFTW_Complex/=",
"division by 0");
183 mWork=mValue[0]*s[0]+mValue[1]*s[1];
184 mValue[1]=(-mValue[0]*s[1]+mValue[1]*s[0]);
187 if (mWork==0)
throw CORE_Exception(
"math/signam",
"FFTW_Complex/=",
"division by 0");
276 return f[0]*f[0]+f[1]*f[1];
309 wrk=a[0]*b[0]-a[1]*b[1];
310 r[1]=a[0]*b[1]+a[1]*b[0];
321 r[0]=a[0]*b[0]-a[1]*b[1];
322 r[1]=a[0]*b[1]+a[1]*b[0];
382 std::swap(a[0],b[0]);
383 std::swap(a[1],b[1]);
393 return (a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1]);
402 return sqrt(
norm2(a,b));
static void sub(tFFTWComplex &a, const tFFTWComplex &b)
Definition: FFTW_Complex.h:364
static void product(const tFFTWReal &a, const tFFTWReal &b, const tFFTWReal &x, const tFFTWReal &y, tFFTWComplex &r)
Definition: FFTW_Complex.h:339
static tFFTWReal norm(const tFFTWComplex &a, const tFFTWComplex &b)
return the norm of the difference
Definition: FFTW_Complex.h:400
tFFTWReal module() const
compute the module of this
Definition: FFTW_Complex.h:268
static void sub(const tFFTWComplex &a, const tFFTWComplex &b, tFFTWComplex &r)
Definition: FFTW_Complex.h:373
FFTW_Complex & operator+=(const FFTW_Complex &s)
add operator
Definition: FFTW_Complex.h:196
static void add(const tFFTWComplex &a, const tFFTWComplex &b, tFFTWComplex &r)
Definition: FFTW_Complex.h:356
FFTW_Complex & operator*=(const tFFTWComplex &s)
multiply operator
Definition: FFTW_Complex.h:161
FFTW_Complex & operator-=(const tFFTWComplex &s)
sub operator
Definition: FFTW_Complex.h:223
static void swap(tFFTWComplex &a, tFFTWComplex &b)
Definition: FFTW_Complex.h:381
virtual ~FFTW_Complex(void)
destroy an FFT complex array
Definition: FFTW_Complex.h:68
This class describes complex based on fftw_complex structure.
Definition: FFTW_Complex.h:18
static tFFTWReal module2(const tFFTWComplex &f)
compute the square of module of f
Definition: FFTW_Complex.h:275
static tString toString(const fftw_complex &f, const tUSInt &nDigits)
return the string representation of the complex f
Definition: FFTW_Complex.h:432
static void product(const FFTW_Complex &a, const FFTW_Complex &b, FFTW_Complex &r)
Definition: FFTW_Complex.h:329
#define tUSInt
Definition: types.h:28
FFTW_Complex & operator=(const tFFTWReal &s)
copy the real
Definition: FFTW_Complex.h:131
#define tFFTWComplex
Definition: fftw_types.h:65
tFFTWComplex mValue
Definition: FFTW_Complex.h:25
void setValue(const tFFTWReal &x, const tFFTWReal &y)
set the value at index
Definition: FFTW_Complex.h:234
FFTW_Complex & operator/=(const FFTW_Complex &s)
divide operator
Definition: FFTW_Complex.h:182
FFTW_Complex & operator*=(const tFFTWReal &s)
multiply operator
Definition: FFTW_Complex.h:141
DEFINE_SPTR(FFTW_Complex)
static SP::FFTW_Complex New()
return a FFTW_Complex shared pointer
Definition: FFTW_Complex.h:83
FFTW_Complex & operator*=(const FFTW_Complex &s)
multiply operator
Definition: FFTW_Complex.h:150
static void product(tFFTWComplex &a, const tFFTWComplex &b)
Definition: FFTW_Complex.h:290
tFFTWReal mWork
Definition: FFTW_Complex.h:28
FFTW_Complex(void)
create a FFT complex
Definition: FFTW_Complex.h:38
static tString toString(const tFFTWComplex &f)
return the string representation of the complex f
Definition: FFTW_Complex.h:417
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
FFTW_Complex & operator=(const tFFTWComplex &s)
copy the complex
Definition: FFTW_Complex.h:121
This class is the base class of FFTW objects.
Definition: FFTW_Object.h:19
static tFFTWReal module(const tFFTWComplex &f)
compute the module of f
Definition: FFTW_Complex.h:282
tFFTWReal module2() const
compute the square of module of this
Definition: FFTW_Complex.h:262
static void product(const tFFTWComplex &a, const tFFTWComplex &b, tFFTWComplex &r)
Definition: FFTW_Complex.h:318
void conjugate()
conjugate the complex
Definition: FFTW_Complex.h:256
#define tString
Definition: types.h:135
FFTW_Complex & operator+=(const tFFTWComplex &s)
add operator
Definition: FFTW_Complex.h:205
FFTW_Complex(const tFFTWComplex &f)
create a FFT complex
Definition: FFTW_Complex.h:53
const tFFTWReal & operator[](const tUSInt &i) const
get the value for reading only
Definition: FFTW_Complex.h:104
static void add(tFFTWComplex &a, const tFFTWComplex &b)
Definition: FFTW_Complex.h:347
tString toString() const
return the string associated to the real
Definition: CORE_Real.h:97
FFTW_Complex & operator/=(const tFFTWReal &s)
divide operator
Definition: FFTW_Complex.h:172
FFTW_Complex & operator-=(const FFTW_Complex &s)
sub operator
Definition: FFTW_Complex.h:214
FFTW_Complex(const FFTW_Complex &f)
create a copy FFT complex
Definition: FFTW_Complex.h:60
#define tFFTWReal
Definition: fftw_types.h:66
tFFTWReal & operator[](const tUSInt &i)
get the value for reading & writing
Definition: FFTW_Complex.h:97
static void product(const tFFTWComplex &a, const tFFTWComplex &b, tFFTWComplex &r, tFFTWReal &wrk)
Definition: FFTW_Complex.h:308
static tFFTWReal norm2(const tFFTWComplex &a, const tFFTWComplex &b)
return the norm of the difference
Definition: FFTW_Complex.h:391
FFTW_Complex(const tFFTWReal &a, const tFFTWReal &b)
create a FFT complex
Definition: FFTW_Complex.h:46
#define ASSERT_IN(a)
Definition: types.h:196
FFTW_Complex & operator=(const FFTW_Complex &s)
copy the complex
Definition: FFTW_Complex.h:112
const tFFTWComplex & getValue() const
get values for reading only
Definition: FFTW_Complex.h:244
virtual tString toString() const
return the string repesentation of this
Definition: FFTW_Complex.h:410
static void product(tFFTWComplex &a, const tFFTWComplex &b, tFFTWReal &wrk)
Definition: FFTW_Complex.h:298
tFFTWComplex & getValue()
get values for reading or writing
Definition: FFTW_Complex.h:250
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141