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) {
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;
363 std::complex<double> value(std::cos(theta), std::sin(theta));
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 "
Exception handler interface definition.
Lookup table class interface definition for Fast Fourier transformation.
Mathematical function definitions.
Lookup table class for Fast Fourier Transformation.
int factor(const int &index) const
Return factorisation factor.
GFftWavetable(void)
Void constructor.
std::vector< int > m_twiddle
Start index of factors.
std::vector< int > m_factors
Wavetable factors.
int size(void) const
Return number of trigonometric coefficients.
void clear(void)
Clear lookup table for Fast Fourier Transform.
void set_members(const int &n)
Set wavetable.
std::string print(const GChatter &chatter=NORMAL) const
Print lookup table for Fast Fourier Transform information.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
void set_factors(const int &n)
Compute FFT factorisation.
std::vector< std::complex< double > > m_trig
Trigonometric coefficients.
const int & index(const int &factor) const
Return start index for a given factor.
virtual ~GFftWavetable(void)
Destructor.
GFftWavetable * clone(void) const
Clone lookup table for Fast Fourier Transform.
void copy_members(const GFftWavetable &wavetable)
Copy class members.
GFftWavetable & operator=(const GFftWavetable &wavetable)
Assignment operator.
int factors(void) const
Return number of factorisation factors.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.