|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfftw.ArrayUtil
public class ArrayUtil
Class containing some useful static method to manipulate double arrays containing complex data used in jfftw. All array access is by array index with no setter/getter overhead. This is not very OOP, but vastly improves efficiency.
Constructor Summary | |
---|---|
ArrayUtil()
|
Method Summary | |
---|---|
static void |
conjugate(double[] data)
Method to take form the conjugate of an interleaved array by taking the negative of imaginary parts. |
static void |
conjugate(double[][] split)
Method to take form the conjugate of a split array by taking the negative of the imaginary parts. |
static void |
conjugate(double[] data,
int i)
Conjugate specified element of an interleaved array |
static Complex |
getComplex(double[][] split,
int i)
Static method to get the ith Complex element from a split array consisting of real and imaginary parts in a [2][] array |
static Complex |
getComplex(double[] real,
double[] imag,
int i)
Static method to get the ith Complex element from a split array consisting of real and imaginary parts. |
static Complex |
getComplex(double[] data,
int i)
Static method to get the ith Complex element from an interleaved array where real part is in 2*i and imaginary in 2*i + 1. |
static double[] |
interleave(double[][] data)
Static method to take split array normally holding real and imaginary parts and interleave them to a single array. |
static double[] |
interleave(double[] real,
double[] imag)
Static method to take two double arrays normally holding real and imaginary parts and interleave them to a single array. |
static double |
maxModSqr(double[] data)
Method to get the modulus squared of the largest elements of an interleaved Complex array. |
static double |
maxModSqr(double[][] split)
Method to get the modulus squared of the largest elements of a split Complex array |
static double |
maxModSqr(double[] real,
double[] imag)
Method to get the modulus squared of the largest elements of a split Complex array with real and imaginary parts held in separate arrays. |
static double |
modulus(double[] data,
int i)
Get the modulus of specified element of interleaved array |
static double |
modulusSqr(double[] data,
int i)
Get the modulus square of specified element of interleaved array |
static void |
mult(double[][] split,
Complex c)
Method to multiply a split array by a complex. |
static void |
mult(double[][] split,
double a)
Method to multiply a split array by a double. |
static void |
mult(double[][] first,
double[][] second)
Method to multiply two split arrays putting the result in the first. |
static void |
mult(double[][] split,
double a,
double b)
Method to multiply a split array by a complex specified as two doubles. |
static void |
mult(double[] data,
Complex c)
Method to multiply an interleaved array by a complex. |
static void |
mult(double[] data,
double a)
Method to multiply an interleaved array by a double. |
static void |
mult(double[] first,
double[] second)
Method to multiply two complex interleaved data arrays placing the result in the first. |
static void |
mult(double[] data,
double a,
double b)
Method to multiply a interleaved array by a complex specified as two doubles. |
static void |
mult(double[] data,
int i,
Complex c)
Multiply specified element of interleaved array by a complex. |
static void |
mult(double[] data,
int i,
double a)
Multiply specified element of interleaved array by a double |
static void |
mult(double[] data,
int i,
double a,
double b)
Multiply specified element of interleaved array by a complex specified as two doubles. |
static void |
multConjugate(double[][] first,
double[][] second)
Method to multiply first array by complex conjugate of the second. |
static void |
multConjugate(double[] first,
double[] second)
Method to multiply a interleaves complex arrays with the complex conjugate of an interleaved array, placing the result in the first. |
static double |
power(double[] data)
Method to get power (sum of modulus squared) in an Complex interleaved array. |
double |
power(double[][] split)
Method to get power (sum of modulus squared) in an Complex split array. |
double |
power(double[] real,
double[] imag)
Method to get power (sum of modulus squared) in an Complex split array held in real and imaginary arrays. |
static void |
setComplex(double[][] split,
int i,
Complex z)
Static to set the ith component of split array array with a Complex. |
static void |
setComplex(double[][] split,
int i,
double a,
double b)
Static to set the ith component of split array array with a Complex. |
static void |
setComplex(double[] real,
double[] imag,
int i,
Complex z)
Static to set the ith component of split array array with a Complex. |
static void |
setComplex(double[] real,
double[] imag,
int i,
double a,
double b)
Static to set the ith component of split array array with two doubles |
static void |
setComplex(double[] data,
int i,
Complex z)
Static to set the ith component of a interleaved complex array with a Complex. |
static void |
setComplex(double[] data,
int i,
double a,
double b)
Static to set the ith component of a interleaved complex array with a two doubles |
static double[][] |
split(double[] data)
Static method to split an interleaved array into two split array, returned as a double[2][] array with [0][i] and [1][i] holding the real / imaginary parts. |
static double[][] |
split(double[] real,
double[] imag)
Static method to form a split array from a real and imaginary array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayUtil()
Method Detail |
---|
public static double[] interleave(double[] real, double[] imag)
real
- the real arrayimag
- the imaginary array (can be null, or length zero).
double[]
interleaved array.public static double[] interleave(double[][] data)
data
- the split array
double[]
interleaved array.public static double[][] split(double[] data)
data
- the interleaved array.
double[][]
of size [2][data.length/2]public static double[][] split(double[] real, double[] imag)
Note the data is not copied to new space.
real
- the real arrayimag
- the imaginary array
double[][]
array in split format.public static Complex getComplex(double[] data, int i)
data
- the interleaved arrayi
- the element indexpublic static void setComplex(double[] data, int i, Complex z)
data
- the interleaved arrayi
- the element indexz
- the valuepublic static void setComplex(double[] data, int i, double a, double b)
data
- the interleaved arrayi
- the element indexa
- the real partb
- the imaginary part.public static Complex getComplex(double[] real, double[] imag, int i)
real
- the real array.imag
- the imaginary array.i
- the element index.public static void setComplex(double[] real, double[] imag, int i, Complex z)
real
- the real arrayimag
- the imaginary arrayi
- the element indexz
- the valuepublic static void setComplex(double[] real, double[] imag, int i, double a, double b)
real
- the real arrayimag
- the imaginary arrayi
- the element indexa
- the real partb
- the imaginary partpublic static Complex getComplex(double[][] split, int i)
split
- the [2][] arrayi
- the element index.public static void setComplex(double[][] split, int i, Complex z)
split
- the split array of real and imaginary partsi
- the element indexz
- the valuepublic static void setComplex(double[][] split, int i, double a, double b)
split
- the split array of real and imaginary partsi
- the element indexa
- the real partb
- the imaginary part.public static void conjugate(double[] data, int i)
i
- the indexpublic static double modulusSqr(double[] data, int i)
i
- the indexpublic static double modulus(double[] data, int i)
i
- the indexpublic static void mult(double[] data, int i, double a)
data
- the interleaved arrayi
- the indexa
- the double.public static void mult(double[] data, int i, double a, double b)
data
- the interleaved arrayi
- the indexa
- real partb
- imaginary partpublic static void mult(double[] data, int i, Complex c)
data
- the interleaved arrayi
- the indexc
- the Complexpublic static void mult(double[] data, double a)
data
- the interleaved arraya
- the multiplier.public static void mult(double[][] split, double a)
split
- the split arraya
- the multiplier.public static void mult(double[] data, double a, double b)
data
- the interleaved arraya
- real part of multiplierb
- imaginary part of multiplierpublic static void mult(double[] data, Complex c)
data
- the interleaved arrayc
- the Complex multiplierpublic static void mult(double[][] split, double a, double b)
split
- the split arraya
- real part of multiplierb
- imaginary part of multiplier
ArrayIndexOutOfBoundsException
- if
real and imaginary arrays of different lengths.public static void mult(double[][] split, Complex c)
split
- the split arrayc
- the Complex multiplierpublic static void mult(double[] first, double[] second)
first
- the first interleaved arraysecond
- the second interleaved array (not changed)
ArrayIndexOutOfBoundsException
- if
the two arrays are not the same length.public static void multConjugate(double[] first, double[] second)
first
- the first interleaved arraysecond
- the second interleaved array (not changed)
ArrayIndexOutOfBoundsException
- if
the two arrays are not the same length.public static void mult(double[][] first, double[][] second)
first
- the first split arraysecond
- the second split array.
ArrayIndexOutOfBoundsException
- if
the two arrays are not the same length.public static void multConjugate(double[][] first, double[][] second)
first
- the first split arraysecond
- the second split array.
ArrayIndexOutOfBoundsException
- if
the two arrays are not the same length.public static void conjugate(double[] data)
data
- the interleaved array.public static void conjugate(double[][] split)
split
- the split array.public static double maxModSqr(double[] data)
data
- the interleaved Complex array
double
maximum modulus squaredpublic static double maxModSqr(double[] real, double[] imag)
real
- the real arrayimag
- the imaginary array
double
maximum modulus squaredpublic static double maxModSqr(double[][] split)
split
- the split array
double
maximum modulus squaredpublic static double power(double[] data)
data
- the interleaved Complex array
double
the power.public double power(double[] real, double[] imag)
real
- the real arrayimag
- the imaginary array
double
the powerpublic double power(double[][] split)
split
- the split array
return double
the power
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |