public class CMatrixRMaj extends CMatrixD1
Constructor and Description |
---|
CMatrixRMaj(CMatrixRMaj original)
Creates a new
CMatrixRMaj which is a copy of the passed in matrix. |
CMatrixRMaj(float[][] data)
Creates a matrix with the values and shape defined by the 2D array 'data'.
|
CMatrixRMaj(int numRows,
int numCols)
Creates a new matrix with the specified number of rows and columns
|
CMatrixRMaj(int numRows,
int numCols,
boolean rowMajor,
float... data) |
Modifier and Type | Method and Description |
---|---|
CMatrixRMaj |
copy()
Creates an exact copy of the matrix
|
<T extends Matrix> |
createLike()
Creates a new matrix with the same shape as this matrix
|
void |
get(int row,
int col,
Complex_F32 output)
Returns the complex value of the matrix's element
|
int |
getDataLength()
Returns the number of elements in the internal data array
|
float |
getImag(int element) |
float |
getImag(int row,
int col)
Returns the imaginary component of the matrix's element.
|
int |
getIndex(int row,
int col)
Returns the internal array index for the specified row and column.
|
float |
getReal(int element) |
float |
getReal(int row,
int col)
Returns the real component of the matrix's element.
|
int |
getRowStride()
Number of array elements in the matrix's row.
|
MatrixType |
getType()
Returns the type of matrix
|
void |
print()
Prints the matrix to standard out.
|
void |
reshape(int numRows,
int numCols)
Equivalent to invoking reshape(numRows,numCols,false);
|
void |
set(CMatrixRMaj original) |
void |
set(int numRows,
int numCols,
boolean rowMajor,
float... data)
Sets this matrix equal to the matrix encoded in the array.
|
void |
set(int row,
int col,
float real,
float imaginary)
Set's the complex value of the matrix's element
|
void |
set(Matrix original)
Sets this matrix to be identical to the 'original' matrix passed in.
|
void |
setImag(int row,
int col,
float val)
Sets the imaginary component of the matrix's element.
|
void |
setReal(int row,
int col,
float val)
Sets the real component of the matrix's element.
|
void |
zero()
Sets all the elements in the matrix to zero
|
getData, getNumCols, getNumElements, getNumRows, set, setData, setNumCols, setNumRows
public CMatrixRMaj(float[][] data)
Creates a matrix with the values and shape defined by the 2D array 'data'.
It is assumed that 'data' has a row-major formatting:
data[ row ][ column ]
data
- 2D array representation of the matrix. Not modified.public CMatrixRMaj(int numRows, int numCols, boolean rowMajor, float... data)
public CMatrixRMaj(CMatrixRMaj original)
CMatrixRMaj
which is a copy of the passed in matrix.original
- Matrix which is to be copiedpublic CMatrixRMaj(int numRows, int numCols)
numRows
- number of rowsnumCols
- number of columnspublic int getIndex(int row, int col)
CMatrixD1
public void reshape(int numRows, int numCols)
ReshapeMatrix
numRows
- The new number of rows in the matrix.numCols
- The new number of columns in the matrix.public void get(int row, int col, Complex_F32 output)
CMatrix
row
- Matrix element's row index..col
- Matrix element's column index.output
- Storage for the complex numberpublic void set(int row, int col, float real, float imaginary)
CMatrix
row
- Matrix element's row index..col
- Matrix element's column index.real
- The real componentimaginary
- The imaginary componentpublic float getReal(int element)
public float getImag(int element)
public float getReal(int row, int col)
CMatrix
row
- Matrix element's row index..col
- Matrix element's column index.public void setReal(int row, int col, float val)
CMatrix
row
- Matrix element's row index..col
- Matrix element's column index.val
- The element's new value.public float getImag(int row, int col)
CMatrix
row
- Matrix element's row index..col
- Matrix element's column index.public void setImag(int row, int col, float val)
CMatrix
row
- Matrix element's row index..col
- Matrix element's column index.val
- The element's new value.public int getDataLength()
CMatrix
public void set(CMatrixRMaj original)
public CMatrixRMaj copy()
Matrix
public void set(Matrix original)
Matrix
public void print()
Matrix
public int getRowStride()
public void set(int numRows, int numCols, boolean rowMajor, float... data)
numRows
- The number of rows.numCols
- The number of columns.rowMajor
- If the array is encoded in a row-major or a column-major format.data
- The formatted 1D array. Not modified.public void zero()
public <T extends Matrix> T createLike()
Matrix
public MatrixType getType()
Matrix