1 #ifndef FFTW_ComplexArray_H 2 #define FFTW_ComplexArray_H 64 static inline SP::FFTW_ComplexArray
New() {
111 "index out of bounds [0,1]");
112 return (*
this)[i][j];
126 "index out of bounds [0,1]");
127 return (*
this)[i][j];
220 if (s==0)
throw CORE_Exception(
"math/fftw",
"FFTW_ComplexArray/=",
"division by 0");
282 mIsPrivateAllocated=
false;
373 mIsPrivateAllocated=
false;
423 std::swap(mValues[i][0],mValues[j][0]);
424 std::swap(mValues[i][1],mValues[j][1]);
487 return sqrt(
norm2());
void allocate(const tUIndex &cap)
allocate the memory if the array
Definition: FFTW_ComplexArray.cpp:38
void copy(const FFTW_ComplexArray &f)
copy the complex array
Definition: FFTW_ComplexArray.cpp:180
DEFINE_SPTR(FFTW_ComplexArray)
FFTW_ComplexArray & operator-=(const tFFTWReal &s)
sub s to the array
Definition: FFTW_ComplexArray.h:254
const tFFTWReal & operator()(const tUIndex &i, const tUSInt &j) const
get the value for reading only
Definition: FFTW_ComplexArray.h:122
const tFFTWComplex & operator[](const tUIndex &i) const
get the value for reading only
Definition: FFTW_ComplexArray.h:91
FFTW_ComplexArray & operator+=(const tFFTWComplex &s)
add s to the array
Definition: FFTW_ComplexArray.h:237
const tUIndex & getCapacity() const
get the capacity
Definition: FFTW_ComplexArray.h:412
FFTW_ComplexArray & operator+=(const FFTW_ComplexArray &s)
add s to the array
Definition: FFTW_ComplexArray.h:245
FFTW_ComplexArray & operator+=(const tFFTWReal &s)
add s to the array
Definition: FFTW_ComplexArray.h:229
tBoolean mIsPrivateAllocated
Definition: FFTW_ComplexArray.h:34
void multiply(const tFFTWReal &s)
multiply the real part of the elements of the array by the scalar s
Definition: FFTW_ComplexArray.cpp:329
FFTW_ComplexArray & operator/=(const tFFTWReal &s)
divide operator
Definition: FFTW_ComplexArray.h:219
tFFTWReal & operator()(const tUIndex &i, const tUSInt &j)
get the value for reading & writing
Definition: FFTW_ComplexArray.h:107
#define tUSInt
Definition: types.h:28
FFTW_ComplexArray & operator=(const FFTW_ComplexArray &s)
copy the values of the complex array
Definition: FFTW_ComplexArray.h:133
#define tBoolean
Definition: types.h:139
virtual ~FFTW_ComplexArray(void)
destroy an FFT complex array
Definition: FFTW_ComplexArray.cpp:22
#define tFFTWComplex
Definition: fftw_types.h:65
FFTW_ComplexArray & operator=(const CORE_DoubleArray &s)
copy only the real part to s
Definition: FFTW_ComplexArray.h:159
tString toString() const
return the string associated to the integer
Definition: CORE_Integer.h:106
FFTW_ComplexArray(void)
create a FFT complex array
Definition: FFTW_ComplexArray.cpp:5
#define null
Definition: types.h:144
tBoolean setValuesByReference(const tUIndex &n, tFFTWComplex *array)
set the the values by reference
Definition: FFTW_ComplexArray.h:368
SP_OBJECT(FFTW_ComplexArray)
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: FFTW_ComplexArray.h:388
FFTW_ComplexArray & operator=(const tFFTWComplex &s)
init uniform value
Definition: FFTW_ComplexArray.h:184
FFTW_ComplexArray & operator=(const CORE_RealArray &s)
copy only the real part to s
Definition: FFTW_ComplexArray.h:151
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
void setValue(const tUIndex &index, const tFFTWReal &x, const tFFTWReal &y)
set the value at index
Definition: FFTW_ComplexArray.h:356
const tUIndex & getSize() const
get the size
Definition: FFTW_ComplexArray.h:406
void clear()
clear the vector
Definition: FFTW_ComplexArray.h:276
this class describes an array
Definition: CORE_Array.h:19
const tFFTWComplex * getValues() const
get values for reading only
Definition: FFTW_ComplexArray.h:394
tFFTWComplex & operator[](const tUIndex &i)
get the value for reading & writing
Definition: FFTW_ComplexArray.h:79
This class describes FFT complex array based on fft_complex structure.
Definition: FFTW_ComplexArray.h:17
This class is the base class of FFTW objects.
Definition: FFTW_Object.h:19
#define tUIndex
Definition: types.h:126
static SP::FFTW_ComplexArray New()
return a FFTW_ComplexArray shared pointer
Definition: FFTW_ComplexArray.h:64
void setSize(const tUIndex &n)
set size of the array
Definition: FFTW_ComplexArray.h:288
FFTW_ComplexArray & operator=(const CORE_FloatArray &s)
copy only the real part to s
Definition: FFTW_ComplexArray.h:167
tFFTWReal distance2(const FFTW_ComplexArray &x) const
compute the square of distance of this to x
Definition: FFTW_ComplexArray.cpp:596
tFFTWComplex * mValues
Definition: FFTW_ComplexArray.h:25
FFTW_ComplexArray & operator*=(const FFTW_ComplexArray &s)
make the product term by term
Definition: FFTW_ComplexArray.h:212
#define tString
Definition: types.h:135
tFFTWComplex * getValues()
get values for reading or writing
Definition: FFTW_ComplexArray.h:400
tUIndex mSize
Definition: FFTW_ComplexArray.h:28
tFFTWReal distance(const FFTW_ComplexArray &x) const
compute the distance of this to x
Definition: FFTW_ComplexArray.h:504
tFFTWReal fabs(tUIndex &i) const
compute the index of the array where the module is max
Definition: FFTW_ComplexArray.cpp:682
static void MatrixVectorProduct(const tFFTWReal &alpha, const tUIndex &N, const tFFTWComplex *A, const tFFTWComplex *X, tFFTWComplex *Y)
matrix vector product Z:=alpha.Z+A*X
Definition: FFTW_ComplexArray.cpp:418
FFTW_ComplexArray & operator=(const tFFTWReal &s)
init uniform value
Definition: FFTW_ComplexArray.h:176
tUIndex mCapacity
Definition: FFTW_ComplexArray.h:31
tFFTWReal norm() const
compute the norm
Definition: FFTW_ComplexArray.h:486
void initArray(const tReal &f)
init uniform value of f
Definition: FFTW_ComplexArray.cpp:126
#define tULLInt
Definition: types.h:45
virtual tString toString() const
to string
Definition: FFTW_ComplexArray.cpp:815
#define tFFTWReal
Definition: fftw_types.h:66
void desallocate()
desallocate the memory
Definition: FFTW_ComplexArray.cpp:27
#define tReal
Definition: types.h:118
void fitToSize()
set the capacityto size
Definition: FFTW_ComplexArray.cpp:118
void swap(const tUIndex &i, const tUIndex &j)
swap the lines i & j
Definition: FFTW_ComplexArray.h:422
FFTW_ComplexArray & operator*=(const tFFTWComplex &s)
multiply the array by s
Definition: FFTW_ComplexArray.h:201
FFTW_ComplexArray & operator*=(const tFFTWReal &s)
multiply the array by s
Definition: FFTW_ComplexArray.h:193
FFTW_ComplexArray & operator=(const CORE_ComplexArray &s)
copy the values of the tComplex array
Definition: FFTW_ComplexArray.h:141
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141
void add(const tFFTWReal &s)
add scalar s to the real part of the elements of the array
Definition: FFTW_ComplexArray.cpp:487
tFFTWReal norm2() const
compute the square of norm
Definition: FFTW_ComplexArray.cpp:572