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 using standard formatting.
|
void |
print(java.lang.String format)
Prints the matrix to standard out with the specified formatting.
|
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, setNumRowspublic 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)
ZMatrixD1public void reshape(int numRows,
int numCols)
ReshapeMatrixnumRows - 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)
ZMatrixrow - 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)
ZMatrixrow - 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)
ZMatrixrow - Matrix element's row index..col - Matrix element's column index.public void setReal(int row,
int col,
double val)
ZMatrixrow - Matrix element's row index..col - Matrix element's column index.val - The element's new value.public double getImag(int row,
int col)
ZMatrixrow - Matrix element's row index..col - Matrix element's column index.public void setImag(int row,
int col,
double val)
ZMatrixrow - Matrix element's row index..col - Matrix element's column index.val - The element's new value.public int getDataLength()
ZMatrixpublic void set(ZMatrixRMaj original)
public ZMatrixRMaj copy()
Matrixpublic void set(Matrix original)
Matrixpublic void print()
Matrixpublic void print(java.lang.String format)
Matrixformat - printf style formatting for a float. E.g. "%f"Formatterpublic 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()
Matrixpublic MatrixType getType()
Matrix