public abstract class FComplexMatrix1D extends AbstractMatrix1D
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 f)
Assigns the result of a function to each cell;
|
FComplexMatrix1D |
assign(FComplexMatrix1D other)
Replaces all cell values of the receiver with the values of another
matrix.
|
FComplexMatrix1D |
assign(FComplexMatrix1D y,
FComplexFComplexFComplexFunction f)
Assigns the result of a function to each cell;
|
FComplexMatrix1D |
assign(FComplexProcedure cond,
FComplexFComplexFunction f)
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 f)
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.
|
int |
cardinality()
Returns the number of cells having non-zero values; ignores tolerance.
|
FComplexMatrix1D |
copy()
Constructs and returns a deep copy of the receiver.
|
abstract Object |
elements()
Returns the elements of this matrix.
|
boolean |
equals(float[] value)
Returns whether all cells are equal to the given value.
|
boolean |
equals(Object obj)
Compares this object against the specified object.
|
float[] |
get(int index)
Returns the matrix cell value at coordinate index.
|
abstract 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.
|
abstract float[] |
getQuick(int index)
Returns the matrix cell value at coordinate index.
|
abstract FloatMatrix1D |
getRealPart()
Returns the real part of this matrix
|
FComplexMatrix1D |
like()
Construct and returns a new empty matrix of the same dynamic type
as the receiver, having the same size.
|
abstract FComplexMatrix1D |
like(int size)
Construct and returns a new empty matrix of the same dynamic type
as the receiver, having the specified size.
|
abstract FComplexMatrix2D |
like2D(int rows,
int columns)
Construct and returns a new 2-d matrix of the corresponding dynamic
type, entirely independent of the receiver.
|
abstract FComplexMatrix2D |
reshape(int rows,
int columns)
Returns new FloatMatrix2D of size rows x columns whose elements are taken
column-wise from this matrix.
|
abstract 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 |
set(int index,
float[] value)
Sets the matrix cell at coordinate index to the specified value.
|
void |
set(int index,
float re,
float im)
Sets the matrix cell at coordinate index to the specified value.
|
abstract void |
setQuick(int index,
float[] value)
Sets the matrix cell at coordinate index to the specified value.
|
abstract 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].
|
float[] |
toArray()
Constructs and returns a 1-dimensional array containing the cell values.
|
void |
toArray(float[] values)
Fills the cell values into the specified 1-dimensional array.
|
String |
toString()
Returns a string representation using default formatting ("%.4f").
|
String |
toString(String format)
Returns a string representation using given format
|
FComplexMatrix1D |
viewFlip()
Constructs and returns a new flip view.
|
FComplexMatrix1D |
viewPart(int index,
int width)
Constructs and returns a new sub-range view that is a
width sub matrix starting at index.
|
FComplexMatrix1D |
viewSelection(FComplexProcedure condition)
Constructs and returns a new selection view that is a matrix
holding the cells matching the given condition.
|
FComplexMatrix1D |
viewSelection(int[] indexes)
Constructs and returns a new selection view that is a matrix
holding the indicated cells.
|
FComplexMatrix1D |
viewStrides(int stride)
Constructs and returns a new stride view which is a sub matrix
consisting of every i-th cell.
|
float[] |
zDotProduct(FComplexMatrix1D y)
Returns the dot product of two vectors x and y.
|
float[] |
zDotProduct(FComplexMatrix1D y,
int from,
int length)
Returns the dot product of two vectors x and y.
|
float[] |
zDotProduct(FComplexMatrix1D y,
int from,
int length,
IntArrayList nonZeroIndexes)
Returns the dot product of two vectors x and y.
|
float[] |
zSum()
Returns the sum of all cells.
|
checkSize, index, size, stride, toStringShort
ensureCapacity, isView, trimToSize
clone
public float[] aggregate(FComplexFComplexFComplexFunction aggr, FComplexFComplexFunction f)
aggr
- 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)
other
- 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.IllegalArgumentException
- if size() != other.size().FComplexFunctions
public FComplexMatrix1D assign(FComplexFComplexFunction f)
f
- a function object taking as argument the current cell's value.FComplexFunctions
public FComplexMatrix1D assign(FComplexProcedure cond, FComplexFComplexFunction f)
cond
- a condition.f
- a function object.FComplexFunctions
public FComplexMatrix1D assign(FComplexProcedure cond, float[] value)
cond
- a condition.value
- a value (re=value[0], im=value[1]).public FComplexMatrix1D assign(FComplexRealFunction f)
f
- a function object taking as argument the current cell's value.FComplexFunctions
public FComplexMatrix1D assign(FComplexMatrix1D other)
other
- the source matrix to copy from (may be identical to the
receiver).IllegalArgumentException
- if size() != other.size().public FComplexMatrix1D assign(FComplexMatrix1D y, FComplexFComplexFComplexFunction f)
y
- the secondary matrix to operate on.f
- 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,IllegalArgumentException
- if size() != y.size().FComplexFunctions
public FComplexMatrix1D assign(float re, float im)
re
- 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)
The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.
values
- the values to be filled into the cells.IllegalArgumentException
- if values.length != 2*size().public FComplexMatrix1D assignImaginary(FloatMatrix1D other)
other
- the source matrix to copy fromIllegalArgumentException
- if size() != other.size().public FComplexMatrix1D assignReal(FloatMatrix1D other)
other
- the source matrix to copy fromIllegalArgumentException
- if size() != other.size().public int cardinality()
public FComplexMatrix1D copy()
Note that the returned matrix is an independent deep copy. The returned matrix is not backed by this matrix, so changes in the returned matrix are not reflected in this matrix, and vice-versa.
public boolean equals(float[] value)
value
- the value to test against (re=value[0], im=value[1]).public boolean equals(Object obj)
true
if and only if the argument is not null
and is at least a ComplexMatrix1D
object that has the same
sizes as the receiver and has exactly the same values at the same
indexes.public float[] get(int index)
index
- the index of the cell.IndexOutOfBoundsException
- if index<0 || index>=size().public abstract Object elements()
public abstract FloatMatrix1D getImaginaryPart()
public void getNonZeros(IntArrayList indexList, ArrayList<float[]> valueList)
In 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).
indexList
- the list to be filled with indexes, can have any size.valueList
- the list to be filled with values, can have any size.public abstract float[] getQuick(int index)
Provided 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().
index
- the index of the cell.public abstract FloatMatrix1D getRealPart()
public FComplexMatrix1D like()
public abstract FComplexMatrix1D like(int size)
size
- the number of cell the matrix shall have.public abstract FComplexMatrix2D like2D(int rows, int columns)
rows
- the number of rows the matrix shall have.columns
- the number of columns the matrix shall have.public abstract FComplexMatrix2D reshape(int rows, int columns)
rows
- number of rowscolumns
- number of columnspublic abstract FComplexMatrix3D reshape(int slices, int rows, int columns)
rows
- number of rowscolumns
- number of columnspublic void set(int index, float re, float im)
index
- 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.IndexOutOfBoundsException
- if index<0 || index>=size().public void set(int index, float[] value)
index
- the index of the cell.value
- the value to be filled into the specified cell (re=value[0],
im=value[1]).IndexOutOfBoundsException
- if index<0 || index>=size().public abstract void setQuick(int index, float re, float im)
Provided 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().
index
- 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 abstract void setQuick(int index, float[] value)
Provided 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().
index
- 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)
IllegalArgumentException
- if size() != other.size().public float[] toArray()
public void toArray(float[] values)
IllegalArgumentException
- if values.length < 2*size().public String toString()
public String toString(String format)
format
- a format for java.lang.String.format().public FComplexMatrix1D viewFlip()
public FComplexMatrix1D viewPart(int index, int width)
Note that the view is really just a range restriction: The returned matrix is backed by this matrix, so changes in the returned matrix are reflected in this matrix, and vice-versa.
The view contains the cells from index..index+width-1. and has view.size() == width. A view's legal coordinates are again zero based, as usual. In other words, legal coordinates of the view are 0 .. view.size()-1==width-1. As usual, any attempt to access a cell at other coordinates will throw an IndexOutOfBoundsException.
index
- The index of the first cell.width
- The width of the range.IndexOutOfBoundsException
- if index<0 || width<0 || index+width>size().public FComplexMatrix1D viewSelection(FComplexProcedure condition)
condition
- The condition to be matched.public FComplexMatrix1D viewSelection(int[] indexes)
indexes
- The indexes of the cells that shall be visible in the new
view. To indicate that all cells shall be visible,
simply set this parameter to null.IndexOutOfBoundsException
- if !(0 <= indexes[i] < size()) for any
i=0..indexes.length()-1.public FComplexMatrix1D viewStrides(int stride)
stride
- the step factor.IndexOutOfBoundsException
- if stride <= 0.public float[] zDotProduct(FComplexMatrix1D y)
y
- the second vector.public float[] zDotProduct(FComplexMatrix1D y, int from, int length)
y
- the second vector.from
- the first index to be considered.length
- the number of cells to be considered.public float[] zDotProduct(FComplexMatrix1D y, int from, int length, IntArrayList nonZeroIndexes)
y
- the second vector.nonZeroIndexes
- the indexes of cells in yhaving a non-zero value.public float[] zSum()
Jump to the Parallel Colt Homepage