Class SparseFComplexMatrix3D
- java.lang.Object
-
- cern.colt.PersistentObject
-
- cern.colt.matrix.AbstractMatrix
-
- cern.colt.matrix.AbstractMatrix3D
-
- cern.colt.matrix.tfcomplex.FComplexMatrix3D
-
- cern.colt.matrix.tfcomplex.impl.SparseFComplexMatrix3D
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class SparseFComplexMatrix3D extends FComplexMatrix3D
Sparse hashed 3-d matrix holding complex elements. This implementation uses ConcurrentHashMap- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SparseFComplexMatrix3D(float[][][] values)Constructs a matrix with a copy of the given values.SparseFComplexMatrix3D(int slices, int rows, int columns)Constructs a matrix with a given number of slices, rows and columns and default memory usage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FComplexMatrix3Dassign(float[] value)Sets all cells to the state specified by values.intcardinality()Returns the number of cells having non-zero values; ignores tolerance.java.util.concurrent.ConcurrentHashMap<java.lang.Long,float[]>elements()Returns the elements of this matrix.FloatMatrix3DgetImaginaryPart()Returns the imaginary part of this matrixfloat[]getQuick(int slice, int row, int column)Returns the matrix cell value at coordinate [slice,row,column].FloatMatrix3DgetRealPart()Returns the real part of this matrixlongindex(int slice, int row, int column)Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array.FComplexMatrix3Dlike(int slices, int rows, int columns)Construct and returns a new empty matrix of the same dynamic type as the receiver, having the specified number of slices, rows and columns.FComplexMatrix2Dlike2D(int rows, int columns)Construct and returns a new 2-d matrix of the corresponding dynamic type, sharing the same cells.voidsetQuick(int slice, int row, int column, float[] value)Sets the matrix cell at coordinate [slice,row,column] to the specified value.voidsetQuick(int slice, int row, int column, float re, float im)Sets the matrix cell at coordinate [slice,row,column] to the specified value.FComplexMatrix1Dvectorize()Returns a vector obtained by stacking the columns of each slice of the matrix on top of one another.-
Methods inherited from class cern.colt.matrix.tfcomplex.FComplexMatrix3D
aggregate, aggregate, assign, assign, assign, assign, assign, assign, assign, assign, assignImaginary, assignReal, copy, equals, equals, get, getNonZeros, like, set, set, toArray, toString, toString, viewColumn, viewColumnFlip, viewDice, viewPart, viewRow, viewRowFlip, viewSelection, viewSelection, viewSlice, viewSliceFlip, viewStrides, zSum
-
Methods inherited from class cern.colt.matrix.AbstractMatrix3D
checkShape, checkShape, columns, columnStride, rows, rowStride, size, slices, sliceStride, toStringShort
-
Methods inherited from class cern.colt.matrix.AbstractMatrix
ensureCapacity, isView, trimToSize
-
Methods inherited from class cern.colt.PersistentObject
clone
-
-
-
-
Constructor Detail
-
SparseFComplexMatrix3D
public SparseFComplexMatrix3D(float[][][] values)
Constructs a matrix with a copy of the given values. values is required to have the form values[slice][row][column] and have exactly the same number of rows in in every slice and exactly the same number of columns in in every row.The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.
- Parameters:
values- The values to be filled into the new matrix.- Throws:
java.lang.IllegalArgumentException- if for any 1 <= slice < values.length: values[slice].length != values[slice-1].length .java.lang.IllegalArgumentException- if for any 1 <= row < values[0].length: values[slice][row].length != values[slice][row-1].length .
-
SparseFComplexMatrix3D
public SparseFComplexMatrix3D(int slices, int rows, int columns)Constructs a matrix with a given number of slices, rows and columns and default memory usage.- Parameters:
slices- the number of slices the matrix shall have.rows- the number of rows the matrix shall have.columns- the number of columns the matrix shall have.- Throws:
java.lang.IllegalArgumentException- if (float)slices*columns*rows > Integer.MAX_VALUE.java.lang.IllegalArgumentException- if slices<0 || rows<0 || columns<0.
-
-
Method Detail
-
assign
public FComplexMatrix3D assign(float[] value)
Description copied from class:FComplexMatrix3DSets all cells to the state specified by values. values is required to have the form re = values[slice*silceStride+row*rowStride+2*column], im = values[slice*silceStride+row*rowStride+2*column+1] and have exactly the same number of slices, rows and columns as the receiver.The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.
- Overrides:
assignin classFComplexMatrix3D- Parameters:
value- the values to be filled into the cells.- Returns:
- this (for convenience only).
-
cardinality
public int cardinality()
Description copied from class:FComplexMatrix3DReturns the number of cells having non-zero values; ignores tolerance.- Overrides:
cardinalityin classFComplexMatrix3D- Returns:
- the number of cells having non-zero values.
-
getQuick
public float[] getQuick(int slice, int row, int column)Description copied from class:FComplexMatrix3DReturns the matrix cell value at coordinate [slice,row,column].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): slice<0 || slice>=slices() || row<0 || row>=rows() || column<0 || column>=column().
- Specified by:
getQuickin classFComplexMatrix3D- Parameters:
slice- the index of the slice-coordinate.row- the index of the row-coordinate.column- the index of the column-coordinate.- Returns:
- the value at the specified coordinate.
-
elements
public java.util.concurrent.ConcurrentHashMap<java.lang.Long,float[]> elements()
Description copied from class:FComplexMatrix3DReturns the elements of this matrix.- Specified by:
elementsin classFComplexMatrix3D- Returns:
- the elements
-
index
public long index(int slice, int row, int column)Description copied from class:AbstractMatrix3DReturns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array.- Overrides:
indexin classAbstractMatrix3D- Parameters:
slice- the index of the slice-coordinate.row- the index of the row-coordinate.column- the index of the third-coordinate.
-
like
public FComplexMatrix3D like(int slices, int rows, int columns)
Description copied from class:FComplexMatrix3DConstruct and returns a new empty matrix of the same dynamic type as the receiver, having the specified number of slices, rows and columns. For example, if the receiver is an instance of type DenseComplexMatrix3D the new matrix must also be of type DenseComplexMatrix3D. In general, the new matrix should have internal parametrization as similar as possible.- Specified by:
likein classFComplexMatrix3D- Parameters:
slices- the number of slices the matrix shall have.rows- the number of rows the matrix shall have.columns- the number of columns the matrix shall have.- Returns:
- a new empty matrix of the same dynamic type.
-
like2D
public FComplexMatrix2D like2D(int rows, int columns)
Description copied from class:FComplexMatrix3DConstruct and returns a new 2-d matrix of the corresponding dynamic type, sharing the same cells. For example, if the receiver is an instance of type DenseFComplexMatrix3D the new matrix must also be of type DenseFComplexMatrix2D, if the receiver is an instance of type SparseFComplexMatrix3D the new matrix must also be of type SparseFComplexMatrix2D, etc.- Specified by:
like2Din classFComplexMatrix3D- Parameters:
rows- the number of rows the matrix shall have.columns- the number of columns the matrix shall have.- Returns:
- a new matrix of the corresponding dynamic type.
-
setQuick
public void setQuick(int slice, int row, int column, float[] value)Description copied from class:FComplexMatrix3DSets the matrix cell at coordinate [slice,row,column] to the specified 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): slice<0 || slice>=slices() || row<0 || row>=rows() || column<0 || column>=column().
- Specified by:
setQuickin classFComplexMatrix3D- Parameters:
slice- the index of the slice-coordinate.row- the index of the row-coordinate.column- the index of the column-coordinate.value- the value to be filled into the specified cell.
-
setQuick
public void setQuick(int slice, int row, int column, float re, float im)Description copied from class:FComplexMatrix3DSets the matrix cell at coordinate [slice,row,column] to the specified 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): slice<0 || slice>=slices() || row<0 || row>=rows() || column<0 || column>=column().
- Specified by:
setQuickin classFComplexMatrix3D- Parameters:
slice- the index of the slice-coordinate.row- the index of the row-coordinate.column- the index of the column-coordinate.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.
-
vectorize
public FComplexMatrix1D vectorize()
Description copied from class:FComplexMatrix3DReturns a vector obtained by stacking the columns of each slice of the matrix on top of one another.- Specified by:
vectorizein classFComplexMatrix3D- Returns:
- a vector obtained by stacking the columns of each slice of the matrix on top of one another.
-
getImaginaryPart
public FloatMatrix3D getImaginaryPart()
Description copied from class:FComplexMatrix3DReturns the imaginary part of this matrix- Specified by:
getImaginaryPartin classFComplexMatrix3D- Returns:
- the imaginary part
-
getRealPart
public FloatMatrix3D getRealPart()
Description copied from class:FComplexMatrix3DReturns the real part of this matrix- Specified by:
getRealPartin classFComplexMatrix3D- Returns:
- the real part
-
-
DMelt 3.0 © DataMelt by jWork.ORG