C
- the complex array type.R
- the real array type.public abstract class AbstractComplexArray<C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>> extends AbstractArray<C,C,R,AbstractComplexArray.Complex>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractComplexArray.Complex
A representation of complex numbers.
|
Array.IndexingOrder
INVALID_PARITY, parity
dims, order, strides, values
Modifier | Constructor and Description |
---|---|
protected |
AbstractComplexArray(double[] values,
int parity,
int[] dims,
int[] strides)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
aMean()
Computes the mean over the elements.
|
protected double[] |
applyKernelComplexAccumulatorOperation(int type)
Supports the a* series of operations.
|
protected R |
applyKernelComplexToRealOperation(int type)
Supports the tor* series of operations.
|
protected C |
applyKernelComplexUnaryOperation(double aRe,
double aIm,
int type)
Supports the u* series of operations.
|
protected C |
applyKernelElementwiseOperation(C b,
int type)
Supports the e* series of operations.
|
protected C |
applyKernelLeftElementwiseOperation(C b,
int type)
Supports the l* series of operations.
|
double[] |
aProd()
Computes the product over the elements.
|
double[] |
aSum()
Computes the sum over the elements.
|
C |
eAdd(C array)
Computes the elementwise addition.
|
C |
eDiv(C array)
Computes the elementwise division.
|
C |
eMul(C array)
Computes the elementwise multiplication.
|
C |
eSub(C array)
Computes the elementwise subtraction.
|
C |
fft()
Computes the full FFT of this array.
|
C |
fftShift()
Shifts the entries of this array to the zero frequency component.
|
protected C |
fftShift(int direction)
Depending on the direction, performs an
fftShift() or ifftShift() of this array. |
Class<AbstractComplexArray.Complex> |
getComponentType()
Gets the component type.
|
C |
ifft()
Computes the full IFFT of this array.
|
C |
ifftShift()
Undoes the effects of
fftShift() . |
C |
lAdd(C array)
Computes the left elementwise addition.
|
C |
lDiv(C array)
Computes the left elementwise division.
|
C |
lMul(C array)
Computes the left elementwise multiplication.
|
C |
lSub(C array)
Computes the left elementwise subtraction.
|
C |
reshape(int... dims)
Reshapes this array.
|
C |
reverseOrder()
Creates an array where the storage order is reversed.
|
R |
rifft()
Computes the reduced IFFT of this array.
|
int[] |
rifftDimensions()
Gets the reduced IFFT dimensions.
|
C |
subarray(int... bounds)
Gets a subarray delimited by the given bounds.
|
C |
tile(int... repetitions)
Tiles this array according to the given number repetitions along each dimension.
|
R |
torAbs()
Creates an
AbstractRealArray from the complex magnitudes of this array's elements. |
R |
torIm()
Creates an
AbstractRealArray from the imaginary parts of this array's elements. |
R |
torRe()
Creates an
AbstractRealArray from the real parts of this array's elements. |
String |
toString()
Creates a human-readable representation of this array.
|
C |
transpose(int... permutation)
Transposes (permutes) the dimensions of this array.
|
C |
uAdd(double aRe,
double aIm)
Mutatively adds the argument to the elements.
|
C |
uConj()
Mutatively takes the complex conjugates of the elements.
|
C |
uCos()
Mutatively takes the cosine of the elements.
|
C |
uExp()
Mutatively exponentiates the elements to the base
Math.E . |
C |
uFill(double aRe,
double aIm)
Mutatively fills this array with the argument.
|
C |
uMul(double aRe,
double aIm)
Mutatively multiplies the elements by the argument.
|
C |
uRnd(double aRe,
double aIm)
Mutatively randomizes the elements.
|
C |
uShuffle()
Mutatively shuffles this array.
|
C |
uSin()
Mutatively takes the sine of the elements.
|
protected C |
wrap(AbstractComplexArray.Complex value,
Array.IndexingOrder order,
int[] dims,
int[] strides)
Allocates a new array initialized to the given value.
|
protected C |
wrapUp(int parity,
Array.IndexingOrder order,
int[] dims,
int[] strides)
Creates an instance of the "up" type after a forward FFT.
|
checkInvalidParity, checkMatrixOrder, checkShape, get, rfft, rfftDimensions, set, transform, wrap, wrap, wrapDown
protected AbstractComplexArray(double[] values, int parity, int[] dims, int[] strides)
public C fftShift()
public C ifftShift()
fftShift()
.protected C fftShift(int direction)
fftShift()
or ifftShift()
of this array.direction
- the shift direction.public String toString()
Array
toString
in interface Array<C extends AbstractComplexArray<C,R>,AbstractComplexArray.Complex>
toString
in class AbstractArray<C extends AbstractComplexArray<C,R>,C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>,AbstractComplexArray.Complex>
protected C wrap(AbstractComplexArray.Complex value, Array.IndexingOrder order, int[] dims, int[] strides)
ProtoArray
wrap
in class ProtoArray<C extends AbstractComplexArray<C,R>,double[],AbstractComplexArray.Complex>
value
- the initial value.order
- the storage order.dims
- the dimensions.strides
- the strides.protected C wrapUp(int parity, Array.IndexingOrder order, int[] dims, int[] strides)
AbstractArray
wrapUp
in class AbstractArray<C extends AbstractComplexArray<C,R>,C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>,AbstractComplexArray.Complex>
public int[] rifftDimensions()
AbstractArray
rifftDimensions
in class AbstractArray<C extends AbstractComplexArray<C,R>,C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>,AbstractComplexArray.Complex>
public R rifft()
AbstractArray
rifft
in class AbstractArray<C extends AbstractComplexArray<C,R>,C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>,AbstractComplexArray.Complex>
public C fft()
AbstractArray
fft
in class AbstractArray<C extends AbstractComplexArray<C,R>,C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>,AbstractComplexArray.Complex>
public C ifft()
AbstractArray
ifft
in class AbstractArray<C extends AbstractComplexArray<C,R>,C extends AbstractComplexArray<C,R>,R extends AbstractRealArray<R,C>,AbstractComplexArray.Complex>
public C subarray(int... bounds)
Array
subarray
in interface Array<C extends AbstractComplexArray<C,R>,AbstractComplexArray.Complex>
subarray
in class ProtoArray<C extends AbstractComplexArray<C,R>,double[],AbstractComplexArray.Complex>
bounds
- the subarray bounds as an array of two-tuples. Given the i
th tuple, the first component
is the (inclusive) lower range and the second component is the (exclusive) upper range.public C tile(int... repetitions)
Array
tile
in interface Array<C extends AbstractComplexArray<C,R>,AbstractComplexArray.Complex>
tile
in class ProtoArray<C extends AbstractComplexArray<C,R>,double[],AbstractComplexArray.Complex>
repetitions
- the number times to repeat along each dimension.public C transpose(int... permutation)
Array
transpose
in interface Array<C extends AbstractComplexArray<C,R>,AbstractComplexArray.Complex>
transpose
in class ProtoArray<C extends AbstractComplexArray<C,R>,double[],AbstractComplexArray.Complex>
permutation
- the dimension permutation.public C reshape(int... dims)
Array
reshape
in interface Array<C extends AbstractComplexArray<C,R>,AbstractComplexArray.Complex>
reshape
in class ProtoArray<C extends AbstractComplexArray<C,R>,double[],AbstractComplexArray.Complex>
dims
- the reshaped dimensions.public C reverseOrder()
Array
reverseOrder
in interface Array<C extends AbstractComplexArray<C,R>,AbstractComplexArray.Complex>
reverseOrder
in class ProtoArray<C extends AbstractComplexArray<C,R>,double[],AbstractComplexArray.Complex>
public Class<AbstractComplexArray.Complex> getComponentType()
Array
public R torAbs()
AbstractRealArray
from the complex magnitudes of this array's elements.public R torRe()
AbstractRealArray
from the real parts of this array's elements.public R torIm()
AbstractRealArray
from the imaginary parts of this array's elements.public C uRnd(double aRe, double aIm)
public C uConj()
public C uCos()
public C uSin()
public C uAdd(double aRe, double aIm)
public C uMul(double aRe, double aIm)
public C uFill(double aRe, double aIm)
public C uShuffle()
public double[] aSum()
public double[] aProd()
public double[] aMean()
protected double[] applyKernelComplexAccumulatorOperation(int type)
protected R applyKernelComplexToRealOperation(int type)
protected C applyKernelElementwiseOperation(C b, int type)
protected C applyKernelLeftElementwiseOperation(C b, int type)
protected C applyKernelComplexUnaryOperation(double aRe, double aIm, int type)