|
Parallel Colt 0.7.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcern.colt.PersistentObject
cern.colt.matrix.AbstractMatrix
cern.colt.matrix.AbstractMatrix1D
cern.colt.matrix.tfcomplex.FComplexMatrix1D
cern.colt.matrix.tfcomplex.impl.DenseFComplexMatrix1D
public class DenseFComplexMatrix1D
Dense 1-d matrix (aka vector) holding complex elements. Implementation:
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).
Memory requirements:
memory [bytes] = 8*2*size(). Thus, a 1000000 matrix uses 16 MB.
Time complexity:
O(1) (i.e. constant time) for the basic operations get, getQuick, set, setQuick and size,
| Constructor Summary | |
|---|---|
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)
Constructs a matrix view with the given parameters. |
|
| Method Summary | |
|---|---|
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 cols)
Returns new FloatMatrix2D of size rows x columns whose elements are taken column-wise from this matrix. |
FComplexMatrix3D |
reshape(int slices,
int rows,
int cols)
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[] |
zSum()
Returns the sum of all cells. |
| Methods inherited from class cern.colt.matrix.tfcomplex.FComplexMatrix1D |
|---|
cardinality, copy, equals, equals, get, like, set, set, toArray, toString, toString, viewFlip, viewPart, viewSelection, viewSelection, viewStrides, zDotProduct, zDotProduct, zDotProduct |
| Methods inherited from class cern.colt.matrix.AbstractMatrix1D |
|---|
checkSize, size, stride, toStringShort |
| Methods inherited from class cern.colt.matrix.AbstractMatrix |
|---|
ensureCapacity, isView, trimToSize |
| Methods inherited from class cern.colt.PersistentObject |
|---|
clone |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public 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 matrix
IllegalArgumentException - 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)
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).
IllegalArgumentException - if size<0.| Method Detail |
|---|
public float[] aggregate(FComplexFComplexFComplexFunction aggr,
FComplexFComplexFunction f)
FComplexMatrix1D
aggregate 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.
FComplexFunctions
public float[] aggregate(FComplexMatrix1D other,
FComplexFComplexFComplexFunction aggr,
FComplexFComplexFComplexFunction f)
FComplexMatrix1D
aggregate 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)
FComplexMatrix1D
assign in class FComplexMatrix1Dfunction - a function object taking as argument the current cell's value.
FComplexFunctions
public FComplexMatrix1D assign(FComplexProcedure cond,
FComplexFComplexFunction function)
FComplexMatrix1D
assign in class FComplexMatrix1Dcond - a condition.function - a function object.
FComplexFunctions
public FComplexMatrix1D assign(FComplexProcedure cond,
float[] value)
FComplexMatrix1D
assign in class FComplexMatrix1Dcond - a condition.value - a value (re=value[0], im=value[1]).
public FComplexMatrix1D assign(FComplexRealFunction function)
FComplexMatrix1D
assign in class FComplexMatrix1Dfunction - a function object taking as argument the current cell's value.
FComplexFunctionspublic FComplexMatrix1D assign(FComplexMatrix1D source)
FComplexMatrix1D
assign in class FComplexMatrix1Dsource - the source matrix to copy from (may be identical to the
receiver).
public FComplexMatrix1D assign(FComplexMatrix1D y,
FComplexFComplexFComplexFunction function)
FComplexMatrix1D
assign 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,
FComplexFunctions
public FComplexMatrix1D assign(float re,
float im)
FComplexMatrix1D
assign 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)
FComplexMatrix1D
assignImaginary in class FComplexMatrix1Dother - the source matrix to copy from
public FComplexMatrix1D assignReal(FloatMatrix1D other)
FComplexMatrix1D
assignReal in class FComplexMatrix1Dother - the source matrix to copy from
public void fft()
public float[] elements()
FComplexMatrix1D
elements in class FComplexMatrix1Dpublic FloatMatrix1D getImaginaryPart()
FComplexMatrix1D
getImaginaryPart in class FComplexMatrix1D
public 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()
FComplexMatrix1D
getRealPart in class FComplexMatrix1Dpublic void ifft(boolean scale)
scale - if true, then scaling is performed.public FComplexMatrix1D like(int size)
FComplexMatrix1D
like in class FComplexMatrix1Dsize - the number of cell the matrix shall have.
public FComplexMatrix2D like2D(int rows,
int columns)
FComplexMatrix1D
like2D 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 cols)
FComplexMatrix1D
reshape in class FComplexMatrix1Drows - number of rowscols - number of columns
public FComplexMatrix3D reshape(int slices,
int rows,
int cols)
FComplexMatrix1D
reshape in class FComplexMatrix1Drows - number of rowscols - number of columns
public 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)
FComplexMatrix1D
swap in class FComplexMatrix1Dpublic void toArray(float[] values)
FComplexMatrix1D
toArray in class FComplexMatrix1Dpublic float[] zSum()
FComplexMatrix1D
zSum in class FComplexMatrix1Dpublic long index(int rank)
AbstractMatrix1D
index in class AbstractMatrix1Drank - the rank of the element.
|
Parallel Colt 0.7.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||