private static class FastFourierTransformer.RootsOfUnity
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private boolean |
isForward
Forward/reverse indicator.
|
private int |
omegaCount
Number of roots of unity.
|
private double[] |
omegaImaginaryForward
Imaginary part of the roots for forward transform.
|
private double[] |
omegaImaginaryInverse
Imaginary part of the roots for reverse transform.
|
private double[] |
omegaReal
Real part of the roots.
|
private static long |
serialVersionUID
Serializable version id.
|
Constructor and Description |
---|
FastFourierTransformer.RootsOfUnity()
Build an engine for computing then th roots of unity
|
Modifier and Type | Method and Description |
---|---|
void |
computeOmega(int n)
Computes the nth roots of unity.
|
double |
getOmegaImaginary(int k)
Get the imaginary part of the kth nth root of unity
|
double |
getOmegaReal(int k)
Get the real part of the kth nth root of unity
|
boolean |
isForward()
Check if computation has been done for forward or reverse transform.
|
private static final long serialVersionUID
private int omegaCount
private double[] omegaReal
private double[] omegaImaginaryForward
private double[] omegaImaginaryInverse
private boolean isForward
public FastFourierTransformer.RootsOfUnity()
public boolean isForward() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if no roots of unity have been computed yetpublic void computeOmega(int n) throws java.lang.IllegalArgumentException
The computed omega[] = { 1, w, w2, ... w(n-1) } where w = exp(-2 π i / n), i = &sqrt;(-1).
Note that n is positive for forward transform and negative for inverse transform.
n
- number of roots of unity to compute,
positive for forward transform, negative for inverse transformjava.lang.IllegalArgumentException
- if n = 0public double getOmegaReal(int k) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
k
- index of the nth root of unityjava.lang.IllegalStateException
- if no roots of unity have been computed yetjava.lang.IllegalArgumentException
- if k is out of rangepublic double getOmegaImaginary(int k) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
k
- index of the nth root of unityjava.lang.IllegalStateException
- if no roots of unity have been computed yetjava.lang.IllegalArgumentException
- if k is out of rangeCopyright (c) 2003-2014 Apache Software Foundation