38 #define G_FACTOR "GFftWavetable::factor(int&)"
39 #define G_SET_MEMBERS "GFftWavetable::set_members(int&)"
40 #define G_SET_FACTORS "GFftWavetable::set_factors(int&)"
129 if (
this != &wavetable) {
195 if (index < 0 || index >=
factors()) {
221 result.append(
"=== GFftWavetable ===");
228 for (
int i = 0; i <
factors(); ++i) {
236 result.append(
"none");
322 std::string msg =
"Invalid array length "+
gammalib::str(n)+
". Array "
323 "needs to be of positive length.";
337 for (
int i = 0; i <
m_factors.size(); ++i) {
343 int product_1 = product;
355 for (
int k = 0, m = 0; k < q; ++k) {
358 m = m + j * product_1;
360 double theta = d_theta * m;
405 std::string msg =
"Invalid array length "+
gammalib::str(n)+
". Array "
406 "needs to be of positive length.";
412 std::vector<int> subtransforms;
413 subtransforms.push_back(7);
414 subtransforms.push_back(6);
415 subtransforms.push_back(5);
416 subtransforms.push_back(4);
417 subtransforms.push_back(3);
418 subtransforms.push_back(2);
432 for (
int i = 0; i < subtransforms.size() && ntest > 1; ++i) {
433 int factor = subtransforms[i];
434 while ((ntest % factor) == 0) {
442 while ((ntest % factor) == 0 && (ntest != 1)) {
450 while ((ntest % factor) != 0) {
459 for (
int i = 0; i <
m_factors.size(); ++i) {
464 "factorisation factors differs from array "
void free_members(void)
Delete class members.
void clear(void)
Clear lookup table for Fast Fourier Transform.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
Lookup table class for Fast Fourier Transformation.
std::vector< int > m_twiddle
Start index of factors.
GFftWavetable * clone(void) const
Clone lookup table for Fast Fourier Transform.
int factor(const int &index) const
Return factorisation factor.
void copy_members(const GFftWavetable &wavetable)
Copy class members.
std::vector< std::complex< double > > m_trig
Trigonometric coefficients.
Lookup table class interface definition for Fast Fourier transformation.
int factors(void) const
Return number of factorisation factors.
void init_members(void)
Initialise class members.
GFftWavetable & operator=(const GFftWavetable &wavetable)
Assignment operator.
virtual ~GFftWavetable(void)
Destructor.
std::string print(const GChatter &chatter=NORMAL) const
Print lookup table for Fast Fourier Transform information.
GVector sin(const GVector &vector)
Computes sine of vector elements.
Exception handler interface definition.
void set_factors(const int &n)
Compute FFT factorisation.
int size(void) const
Return number of trigonometric coefficients.
void set_members(const int &n)
Set wavetable.
GFftWavetable(void)
Void constructor.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::vector< int > m_factors
Wavetable factors.
Mathematical function definitions.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.