|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.transform.FastFourierTransformer.RootsOfUnity
private static class FastFourierTransformer.RootsOfUnity
Computes the nth roots of unity. A cache of already computed values is maintained.
Field Summary | |
---|---|
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 Summary | |
---|---|
FastFourierTransformer.RootsOfUnity()
Build an engine for computing then th roots of unity |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private int omegaCount
private double[] omegaReal
private double[] omegaImaginaryForward
private double[] omegaImaginaryInverse
private boolean isForward
Constructor Detail |
---|
public FastFourierTransformer.RootsOfUnity()
Method Detail |
---|
public boolean isForward() throws IllegalStateException
IllegalStateException
- if no roots of unity have been computed yetpublic void computeOmega(int n) throws 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 transform
IllegalArgumentException
- if n = 0public double getOmegaReal(int k) throws IllegalStateException, IllegalArgumentException
k
- index of the nth root of unity
IllegalStateException
- if no roots of unity have been computed yet
IllegalArgumentException
- if k is out of rangepublic double getOmegaImaginary(int k) throws IllegalStateException, IllegalArgumentException
k
- index of the nth root of unity
IllegalStateException
- if no roots of unity have been computed yet
IllegalArgumentException
- if k is out of range
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |