Fast computation of complex exponential with a rational argument. More...
#include <ComplexExponential.h>
Public Types | |
enum | Sign { Positive, Negative } |
Public Member Functions | |
ComplexExponential (int n, Sign s) | |
const Complex & | value (long int x) |
~ComplexExponential () |
Fast computation of complex exponential with a rational argument.
Compute values of expression exp(2*pi*i*x/n), 0<x, i is the imaginary number. As x and n are integers, this expression has a maximum of n distinct values, even if x is not limited to n (by periodic properties).
This object was first designed for the computation fast partial Fourier transform where a lot of redundant computation of this exponential are required. All values are kept in a cache of dimension n.
QGpCoreTools::ComplexExponential::ComplexExponential | ( | int | n, |
Sign | s | ||
) |
Description of constructor still missing
{
_s=s;
_n=n;
_cache=new Complex[_n];
_invn=1.0/(double)_n;
}
Description of destructor still missing
{
delete [] _cache;
}
const Complex & QGpCoreTools::ComplexExponential::value | ( | long int | x | ) | [inline] |
References QGpCoreTools::Complex::isNull(), Negative, Positive, and QGpCoreTools::Complex::setUnitExp().