public class DenseFComplexMatrix1D extends FComplexMatrix1D
Internally holds one single contiguous one-dimensional array. Complex data is represented by 2 float values in sequence, i.e. elements[zero + 2 * k * stride] constitute real part and elements[zero + 2 * k * stride + 1] constitute imaginary part (k=0,...,size()-1).
| Constructor and Description |
|---|
DenseFComplexMatrix1D(float[] values)
Constructs a matrix with a copy of the given values.
|
DenseFComplexMatrix1D(FloatMatrix1D realPart)
Constructs a complex matrix with the same size as realPart
matrix and fills the real part of this matrix with elements of
realPart.
|
DenseFComplexMatrix1D(int size)
Constructs a matrix with a given number of cells.
|
DenseFComplexMatrix1D(int size,
float[] elements,
int zero,
int stride,
boolean isNoView)
Constructs a matrix with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
float[] |
aggregate(FComplexFComplexFComplexFunction aggr,
FComplexFComplexFunction f)
Applies a function to each cell and aggregates the results.
|
float[] |
aggregate(FComplexMatrix1D other,
FComplexFComplexFComplexFunction aggr,
FComplexFComplexFComplexFunction f)
Applies a function to each corresponding cell of two matrices and
aggregates the results.
|
FComplexMatrix1D |
assign(FComplexFComplexFunction function)
Assigns the result of a function to each cell;
|
FComplexMatrix1D |
assign(FComplexMatrix1D source)
Replaces all cell values of the receiver with the values of another
matrix.
|
FComplexMatrix1D |
assign(FComplexMatrix1D y,
FComplexFComplexFComplexFunction function)
Assigns the result of a function to each cell;
|
FComplexMatrix1D |
assign(FComplexProcedure cond,
FComplexFComplexFunction function)
Assigns the result of a function to all cells that satisfy a condition.
|
FComplexMatrix1D |
assign(FComplexProcedure cond,
float[] value)
Assigns a value to all cells that satisfy a condition.
|
FComplexMatrix1D |
assign(FComplexRealFunction function)
Assigns the result of a function to the real part of the receiver.
|
FComplexMatrix1D |
assign(float[] values)
Sets all cells to the state specified by values.
|
FComplexMatrix1D |
assign(float re,
float im)
Sets all cells to the state specified by re and im.
|
FComplexMatrix1D |
assignImaginary(FloatMatrix1D other)
Replaces imaginary part of the receiver with the values of another real
matrix.
|
FComplexMatrix1D |
assignReal(FloatMatrix1D other)
Replaces real part of the receiver with the values of another real
matrix.
|
float[] |
elements()
Returns the elements of this matrix.
|
void |
fft()
Computes the discrete Fourier transform (DFT) of this matrix.
|
FloatMatrix1D |
getImaginaryPart()
Returns the imaginary part of this matrix
|
void |
getNonZeros(IntArrayList indexList,
ArrayList<float[]> valueList)
Fills the coordinates and values of cells having non-zero values into the
specified lists.
|
float[] |
getQuick(int index)
Returns the matrix cell value at coordinate index.
|
FloatMatrix1D |
getRealPart()
Returns the real part of this matrix
|
void |
ifft(boolean scale)
Computes the inverse of the discrete Fourier transform (IDFT) of this
matrix.
|
long |
index(int rank)
Returns the position of the element with the given relative rank within
the (virtual or non-virtual) internal 1-dimensional array.
|
FComplexMatrix1D |
like(int size)
Construct and returns a new empty matrix of the same dynamic type
as the receiver, having the specified size.
|
FComplexMatrix2D |
like2D(int rows,
int columns)
Construct and returns a new 2-d matrix of the corresponding dynamic
type, entirely independent of the receiver.
|
FComplexMatrix2D |
reshape(int rows,
int columns)
Returns new FloatMatrix2D of size rows x columns whose elements are taken
column-wise from this matrix.
|
FComplexMatrix3D |
reshape(int slices,
int rows,
int columns)
Returns new FloatMatrix3D of size slices x rows x columns, whose elements
are taken column-wise from this matrix.
|
void |
setQuick(int index,
float[] value)
Sets the matrix cell at coordinate index to the specified value.
|
void |
setQuick(int index,
float re,
float im)
Sets the matrix cell at coordinate index to the specified value.
|
void |
swap(FComplexMatrix1D other)
Swaps each element this[i] with other[i].
|
void |
toArray(float[] values)
Fills the cell values into the specified 1-dimensional array.
|
float[] |
zDotProduct(FComplexMatrix1D y,
int from,
int length)
Returns the dot product of two vectors x and y.
|
float[] |
zSum()
Returns the sum of all cells.
|
cardinality, copy, equals, equals, get, like, set, set, toArray, toString, toString, viewFlip, viewPart, viewSelection, viewSelection, viewStrides, zDotProduct, zDotProductcheckSize, size, stride, toStringShortensureCapacity, isView, trimToSizeclonepublic DenseFComplexMatrix1D(float[] values)
values - The values to be filled into the new matrix.public DenseFComplexMatrix1D(FloatMatrix1D realPart)
realPart - a real matrix whose elements become a real part of this matrixIllegalArgumentException - if size<0.public DenseFComplexMatrix1D(int size)
size - the number of cells the matrix shall have.IllegalArgumentException - if size<0.public DenseFComplexMatrix1D(int size,
float[] elements,
int zero,
int stride,
boolean isNoView)
size - the number of cells the matrix shall have.elements - the cells.zero - the index of the first element.stride - the number of indexes between any two elements, i.e.
index(i+1)-index(i).isNoView - if false then the view is constructedIllegalArgumentException - if size<0.public float[] aggregate(FComplexFComplexFComplexFunction aggr, FComplexFComplexFunction f)
FComplexMatrix1Daggregate in class FComplexMatrix1Daggr - an aggregation function taking as first argument the current
aggregation and as second argument the transformed current
cell value.f - a function transforming the current cell value.FComplexFunctionspublic float[] aggregate(FComplexMatrix1D other, FComplexFComplexFComplexFunction aggr, FComplexFComplexFComplexFunction f)
FComplexMatrix1Daggregate in class FComplexMatrix1Dother - the secondary matrix to operate on.aggr - an aggregation function taking as first argument the current
aggregation and as second argument the transformed current
cell values.f - a function transforming the current cell values.FComplexFunctionspublic FComplexMatrix1D assign(FComplexFComplexFunction function)
FComplexMatrix1Dassign in class FComplexMatrix1Dfunction - a function object taking as argument the current cell's value.FComplexFunctionspublic FComplexMatrix1D assign(FComplexProcedure cond, FComplexFComplexFunction function)
FComplexMatrix1Dassign in class FComplexMatrix1Dcond - a condition.function - a function object.FComplexFunctionspublic FComplexMatrix1D assign(FComplexProcedure cond, float[] value)
FComplexMatrix1Dassign in class FComplexMatrix1Dcond - a condition.value - a value (re=value[0], im=value[1]).public FComplexMatrix1D assign(FComplexRealFunction function)
FComplexMatrix1Dassign in class FComplexMatrix1Dfunction - a function object taking as argument the current cell's value.FComplexFunctionspublic FComplexMatrix1D assign(FComplexMatrix1D source)
FComplexMatrix1Dassign in class FComplexMatrix1Dsource - the source matrix to copy from (may be identical to the
receiver).public FComplexMatrix1D assign(FComplexMatrix1D y, FComplexFComplexFComplexFunction function)
FComplexMatrix1Dassign in class FComplexMatrix1Dy - the secondary matrix to operate on.function - a function object taking as first argument the current cell's
value of this, and as second argument the current
cell's value of y,FComplexFunctionspublic FComplexMatrix1D assign(float re, float im)
FComplexMatrix1Dassign in class FComplexMatrix1Dre - the real part of the value to be filled into the cells.im - the imaginary part of the value to be filled into the cells.public FComplexMatrix1D assign(float[] values)
FComplexMatrix1DThe values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.
assign in class FComplexMatrix1Dvalues - the values to be filled into the cells.public FComplexMatrix1D assignImaginary(FloatMatrix1D other)
FComplexMatrix1DassignImaginary in class FComplexMatrix1Dother - the source matrix to copy frompublic FComplexMatrix1D assignReal(FloatMatrix1D other)
FComplexMatrix1DassignReal in class FComplexMatrix1Dother - the source matrix to copy frompublic void fft()
public float[] elements()
FComplexMatrix1Delements in class FComplexMatrix1Dpublic FloatMatrix1D getImaginaryPart()
FComplexMatrix1DgetImaginaryPart in class FComplexMatrix1Dpublic void getNonZeros(IntArrayList indexList, ArrayList<float[]> valueList)
FComplexMatrix1DIn general, fill order is unspecified. This implementation fills like: for (index = 0..size()-1) do ... . However, subclasses are free to us any other order, even an order that may change over time as cell values are changed. (Of course, result lists indexes are guaranteed to correspond to the same cell).
getNonZeros in class FComplexMatrix1DindexList - the list to be filled with indexes, can have any size.valueList - the list to be filled with values, can have any size.public float[] getQuick(int index)
FComplexMatrix1DProvided with invalid parameters this method may return invalid objects without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): index<0 || index>=size().
getQuick in class FComplexMatrix1Dindex - the index of the cell.public FloatMatrix1D getRealPart()
FComplexMatrix1DgetRealPart in class FComplexMatrix1Dpublic void ifft(boolean scale)
scale - if true, then scaling is performed.public FComplexMatrix1D like(int size)
FComplexMatrix1Dlike in class FComplexMatrix1Dsize - the number of cell the matrix shall have.public FComplexMatrix2D like2D(int rows, int columns)
FComplexMatrix1Dlike2D in class FComplexMatrix1Drows - the number of rows the matrix shall have.columns - the number of columns the matrix shall have.public FComplexMatrix2D reshape(int rows, int columns)
FComplexMatrix1Dreshape in class FComplexMatrix1Drows - number of rowscolumns - number of columnspublic FComplexMatrix3D reshape(int slices, int rows, int columns)
FComplexMatrix1Dreshape in class FComplexMatrix1Drows - number of rowscolumns - number of columnspublic void setQuick(int index,
float re,
float im)
FComplexMatrix1DProvided with invalid parameters this method may access illegal indexes without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): index<0 || index>=size().
setQuick in class FComplexMatrix1Dindex - the index of the cell.re - the real part of the value to be filled into the specified
cell.im - the imaginary part of the value to be filled into the
specified cell.public void setQuick(int index,
float[] value)
FComplexMatrix1DProvided with invalid parameters this method may access illegal indexes without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): index<0 || index>=size().
setQuick in class FComplexMatrix1Dindex - the index of the cell.value - the value to be filled into the specified cell (re=value[0],
im=value[1]).public void swap(FComplexMatrix1D other)
FComplexMatrix1Dswap in class FComplexMatrix1Dpublic void toArray(float[] values)
FComplexMatrix1DtoArray in class FComplexMatrix1Dpublic float[] zDotProduct(FComplexMatrix1D y, int from, int length)
FComplexMatrix1DzDotProduct in class FComplexMatrix1Dy - the second vector.from - the first index to be considered.length - the number of cells to be considered.public float[] zSum()
FComplexMatrix1DzSum in class FComplexMatrix1Dpublic long index(int rank)
AbstractMatrix1Dindex in class AbstractMatrix1Drank - the rank of the element.Jump to the Parallel Colt Homepage