public class DenseDComplexMatrix1D extends DComplexMatrix1D
Internally holds one single contiguous one-dimensional array. Complex data is represented by 2 double 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 |
|---|
DenseDComplexMatrix1D(double[] values)
Constructs a matrix with a copy of the given values.
|
DenseDComplexMatrix1D(DoubleMatrix1D realPart)
Constructs a complex matrix with the same size as realPart
matrix and fills the real part of this matrix with elements of
realPart.
|
DenseDComplexMatrix1D(int size)
Constructs a matrix with a given number of cells.
|
DenseDComplexMatrix1D(int size,
double[] elements,
int zero,
int stride,
boolean isNoView)
Constructs a matrix with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
aggregate(DComplexDComplexDComplexFunction aggr,
DComplexDComplexFunction f)
Applies a function to each cell and aggregates the results.
|
double[] |
aggregate(DComplexMatrix1D other,
DComplexDComplexDComplexFunction aggr,
DComplexDComplexDComplexFunction f)
Applies a function to each corresponding cell of two matrices and
aggregates the results.
|
DComplexMatrix1D |
assign(DComplexDComplexFunction function)
Assigns the result of a function to each cell;
|
DComplexMatrix1D |
assign(DComplexMatrix1D source)
Replaces all cell values of the receiver with the values of another
matrix.
|
DComplexMatrix1D |
assign(DComplexMatrix1D y,
DComplexDComplexDComplexFunction function)
Assigns the result of a function to each cell;
|
DComplexMatrix1D |
assign(DComplexProcedure cond,
DComplexDComplexFunction function)
Assigns the result of a function to all cells that satisfy a condition.
|
DComplexMatrix1D |
assign(DComplexProcedure cond,
double[] value)
Assigns a value to all cells that satisfy a condition.
|
DComplexMatrix1D |
assign(DComplexRealFunction function)
Assigns the result of a function to the real part of the receiver.
|
DComplexMatrix1D |
assign(double[] values)
Sets all cells to the state specified by values.
|
DComplexMatrix1D |
assign(double re,
double im)
Sets all cells to the state specified by re and im.
|
DComplexMatrix1D |
assignImaginary(DoubleMatrix1D other)
Replaces imaginary part of the receiver with the values of another real
matrix.
|
DComplexMatrix1D |
assignReal(DoubleMatrix1D other)
Replaces real part of the receiver with the values of another real
matrix.
|
double[] |
elements()
Returns the elements of this matrix.
|
void |
fft()
Computes the discrete Fourier transform (DFT) of this matrix.
|
DoubleMatrix1D |
getImaginaryPart()
Returns the imaginary part of this matrix
|
void |
getNonZeros(IntArrayList indexList,
ArrayList<double[]> valueList)
Fills the coordinates and values of cells having non-zero values into the
specified lists.
|
double[] |
getQuick(int index)
Returns the matrix cell value at coordinate index.
|
DoubleMatrix1D |
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.
|
DComplexMatrix1D |
like(int size)
Construct and returns a new empty matrix of the same dynamic type
as the receiver, having the specified size.
|
DComplexMatrix2D |
like2D(int rows,
int columns)
Construct and returns a new 2-d matrix of the corresponding dynamic
type, entirely independent of the receiver.
|
DComplexMatrix2D |
reshape(int rows,
int columns)
Returns new DoubleMatrix2D of size rows x columns whose elements are
taken column-wise from this matrix.
|
DComplexMatrix3D |
reshape(int slices,
int rows,
int columns)
Returns new DoubleMatrix3D of size slices x rows x columns, whose
elements are taken column-wise from this matrix.
|
void |
setQuick(int index,
double[] value)
Sets the matrix cell at coordinate index to the specified value.
|
void |
setQuick(int index,
double re,
double im)
Sets the matrix cell at coordinate index to the specified value.
|
void |
swap(DComplexMatrix1D other)
Swaps each element this[i] with other[i].
|
void |
toArray(double[] values)
Fills the cell values into the specified 1-dimensional array.
|
double[] |
zDotProduct(DComplexMatrix1D y,
int from,
int length)
Returns the dot product of two vectors x and y.
|
double[] |
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 DenseDComplexMatrix1D(double[] values)
values - The values to be filled into the new matrix.public DenseDComplexMatrix1D(DoubleMatrix1D realPart)
realPart - a real matrix whose elements become a real part of this matrixIllegalArgumentException - if size<0.public DenseDComplexMatrix1D(int size)
size - the number of cells the matrix shall have.IllegalArgumentException - if size<0.public DenseDComplexMatrix1D(int size,
double[] 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 double[] aggregate(DComplexDComplexDComplexFunction aggr, DComplexDComplexFunction f)
DComplexMatrix1Daggregate in class DComplexMatrix1Daggr - 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.DComplexFunctionspublic double[] aggregate(DComplexMatrix1D other, DComplexDComplexDComplexFunction aggr, DComplexDComplexDComplexFunction f)
DComplexMatrix1Daggregate in class DComplexMatrix1Dother - 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.DComplexFunctionspublic DComplexMatrix1D assign(DComplexDComplexFunction function)
DComplexMatrix1Dassign in class DComplexMatrix1Dfunction - a function object taking as argument the current cell's value.DComplexFunctionspublic DComplexMatrix1D assign(DComplexProcedure cond, DComplexDComplexFunction function)
DComplexMatrix1Dassign in class DComplexMatrix1Dcond - a condition.function - a function object.DComplexFunctionspublic DComplexMatrix1D assign(DComplexProcedure cond, double[] value)
DComplexMatrix1Dassign in class DComplexMatrix1Dcond - a condition.value - a value (re=value[0], im=value[1]).public DComplexMatrix1D assign(DComplexRealFunction function)
DComplexMatrix1Dassign in class DComplexMatrix1Dfunction - a function object taking as argument the current cell's value.DComplexFunctionspublic DComplexMatrix1D assign(DComplexMatrix1D source)
DComplexMatrix1Dassign in class DComplexMatrix1Dsource - the source matrix to copy from (may be identical to the
receiver).public DComplexMatrix1D assign(DComplexMatrix1D y, DComplexDComplexDComplexFunction function)
DComplexMatrix1Dassign in class DComplexMatrix1Dy - 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,DComplexFunctionspublic DComplexMatrix1D assign(double re, double im)
DComplexMatrix1Dassign in class DComplexMatrix1Dre - 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 DComplexMatrix1D assign(double[] values)
DComplexMatrix1DThe values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.
assign in class DComplexMatrix1Dvalues - the values to be filled into the cells.public DComplexMatrix1D assignImaginary(DoubleMatrix1D other)
DComplexMatrix1DassignImaginary in class DComplexMatrix1Dother - the source matrix to copy frompublic DComplexMatrix1D assignReal(DoubleMatrix1D other)
DComplexMatrix1DassignReal in class DComplexMatrix1Dother - the source matrix to copy frompublic void fft()
public double[] elements()
DComplexMatrix1Delements in class DComplexMatrix1Dpublic DoubleMatrix1D getImaginaryPart()
DComplexMatrix1DgetImaginaryPart in class DComplexMatrix1Dpublic void getNonZeros(IntArrayList indexList, ArrayList<double[]> valueList)
DComplexMatrix1DIn 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 DComplexMatrix1DindexList - the list to be filled with indexes, can have any size.valueList - the list to be filled with values, can have any size.public double[] getQuick(int index)
DComplexMatrix1DProvided 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 DComplexMatrix1Dindex - the index of the cell.public DoubleMatrix1D getRealPart()
DComplexMatrix1DgetRealPart in class DComplexMatrix1Dpublic void ifft(boolean scale)
scale - if true, then scaling is performed.public DComplexMatrix1D like(int size)
DComplexMatrix1Dlike in class DComplexMatrix1Dsize - the number of cell the matrix shall have.public DComplexMatrix2D like2D(int rows, int columns)
DComplexMatrix1Dlike2D in class DComplexMatrix1Drows - the number of rows the matrix shall have.columns - the number of columns the matrix shall have.public DComplexMatrix2D reshape(int rows, int columns)
DComplexMatrix1Dreshape in class DComplexMatrix1Drows - number of rowscolumns - number of columnspublic DComplexMatrix3D reshape(int slices, int rows, int columns)
DComplexMatrix1Dreshape in class DComplexMatrix1Drows - number of rowscolumns - number of columnspublic void setQuick(int index,
double re,
double im)
DComplexMatrix1DProvided 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 DComplexMatrix1Dindex - 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,
double[] value)
DComplexMatrix1DProvided 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 DComplexMatrix1Dindex - the index of the cell.value - the value to be filled into the specified cell (re=value[0],
im=value[1]).public void swap(DComplexMatrix1D other)
DComplexMatrix1Dswap in class DComplexMatrix1Dpublic void toArray(double[] values)
DComplexMatrix1DtoArray in class DComplexMatrix1Dpublic double[] zDotProduct(DComplexMatrix1D y, int from, int length)
DComplexMatrix1DzDotProduct in class DComplexMatrix1Dy - the second vector.from - the first index to be considered.length - the number of cells to be considered.public double[] zSum()
DComplexMatrix1DzSum in class DComplexMatrix1Dpublic long index(int rank)
AbstractMatrix1Dindex in class AbstractMatrix1Drank - the rank of the element.Jump to the Parallel Colt Homepage