vnl_fft_prime_factors.h
Go to the documentation of this file.
1 // This is core/vnl/algo/vnl_fft_prime_factors.h
2 #ifndef vnl_fft_prime_factors_h_
3 #define vnl_fft_prime_factors_h_
4 //:
5 // \file
6 // \brief Holds prime factor information
7 // \author Veit U.B. Schenk, Oxford RRG
8 // \date 19 Mar 98
9 //
10 // \verbatim
11 // Modifications
12 // 10/4/2001 Ian Scott (Manchester) Converted perceps header to doxygen
13 // \endverbatim
14 
15 #include "vnl/vnl_export.h"
16 #include <vnl/algo/vnl_algo_export.h>
17 
18 //: Holds prime factor information
19 // Helper class used by the vnl_fft_xd<> FFT routines
20 //
21 // Given an integer N of the form
22 // $N = 2^P 3^Q 5^R$
23 // split N into its primefactors (2, 3, 5)
24 
25 template <class T>
27 {
28 private:
29 
30 public:
32 
33  //: constructor takes the size of the signal.
35 
37 
38  //: array of twiddle factors.
39  T const *trigs () const { return trigs_; }
40 
41  //: number which was factorized
42  int number () const { return number_; }
43 
44  //: exponents P, Q, R.
45  long const *pqr () const { return pqr_; }
46 
47  explicit operator bool () const
48  { return (trigs_ && info_ >= 0)? true : false; }
49  bool operator!() const
50  { return (trigs_ && info_ >= 0)? false : true; }
51 
52  void resize(int N) {
53  destruct();
54  construct(N);
55  }
56 
57  private:
58  T *trigs_;
59  long number_; // the number that is being split into prime-facs
60  long pqr_[3]; // store P, Q and R
61  long info_;
62 
63  void construct(int N);
64  void destruct();
65 
66  // disallow copying
69 };
70 
71 #endif // vnl_fft_prime_factors_h_
T const * trigs() const
array of twiddle factors.
vnl_fft_prime_factors(vnl_fft_prime_factors< T > const &)
vnl_fft_prime_factors(int N)
constructor takes the size of the signal.
int number() const
number which was factorized.
Holds prime factor information.
long const * pqr() const
exponents P, Q, R.
vnl_fft_prime_factors< T > & operator=(vnl_fft_prime_factors< T > const &)