public class ZMatrixRMaj extends ZMatrixD1
Constructor and Description |
---|
ZMatrixRMaj(double[][] data)
Creates a matrix with the values and shape defined by the 2D array 'data'.
|
ZMatrixRMaj(int numRows,
int numCols)
Creates a new matrix with the specified number of rows and columns
|
ZMatrixRMaj(int numRows,
int numCols,
boolean rowMajor,
double... data) |
ZMatrixRMaj(ZMatrixRMaj original)
Creates a new
ZMatrixRMaj which is a copy of the passed in matrix. |
Modifier and Type | Method and Description |
---|---|
ZMatrixRMaj |
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_F64 output)
Returns the complex value of the matrix's element
|
int |
getDataLength()
Returns the number of elements in the internal data array
|
double |
getImag(int element) |
double |
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.
|
double |
getReal(int element) |
double |
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(int numRows,
int numCols,
boolean rowMajor,
double... data)
Sets this matrix equal to the matrix encoded in the array.
|
void |
set(int row,
int col,
double real,
double 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 |
set(ZMatrixRMaj original) |
void |
setImag(int row,
int col,
double val)
Sets the imaginary component of the matrix's element.
|
void |
setReal(int row,
int col,
double 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 ZMatrixRMaj(double[][] 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 ZMatrixRMaj(int numRows, int numCols, boolean rowMajor, double... data)
public ZMatrixRMaj(ZMatrixRMaj original)
ZMatrixRMaj
which is a copy of the passed in matrix.original
- Matrix which is to be copiedpublic ZMatrixRMaj(int numRows, int numCols)
numRows
- number of rowsnumCols
- number of columnspublic int getIndex(int row, int col)
ZMatrixD1
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_F64 output)
ZMatrix
row
- Matrix element's row index..col
- Matrix element's column index.output
- Storage for the complex numberpublic void set(int row, int col, double real, double imaginary)
ZMatrix
row
- Matrix element's row index..col
- Matrix element's column index.real
- The real componentimaginary
- The imaginary componentpublic double getReal(int element)
public double getImag(int element)
public double getReal(int row, int col)
ZMatrix
row
- Matrix element's row index..col
- Matrix element's column index.public void setReal(int row, int col, double val)
ZMatrix
row
- Matrix element's row index..col
- Matrix element's column index.val
- The element's new value.public double getImag(int row, int col)
ZMatrix
row
- Matrix element's row index..col
- Matrix element's column index.public void setImag(int row, int col, double val)
ZMatrix
row
- Matrix element's row index..col
- Matrix element's column index.val
- The element's new value.public int getDataLength()
ZMatrix
public void set(ZMatrixRMaj original)
public ZMatrixRMaj copy()
Matrix
public void set(Matrix original)
Matrix
public void print()
Matrix
public int getRowStride()
public void set(int numRows, int numCols, boolean rowMajor, double... 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