public class ArrayMatrix extends AbstractMatrix implements Matrix
Matrix-interface based on arrays.| Constructor and Description |
|---|
ArrayMatrix(Matrix matrix)
Create a copy of the given matrix.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
createIdentityMatrix(int rows,
int columns)
Create an identity matrix with the given dimensions.
|
int |
get(int row,
int column)
Get an entry of the matrix.
|
int |
getColumns()
Get the number of columns in the matrix.
|
int |
getRows()
Get the number of rows in the matrix.
|
void |
set(int row,
int column,
int value)
Set an entry in the matrix.
|
equals, hashCode, toStringpublic ArrayMatrix(Matrix matrix)
matrix - The matrix to copy.public int getColumns()
MatrixgetColumns in interface Matrixpublic int getRows()
Matrixpublic int get(int row,
int column)
Matrixpublic void set(int row,
int column,
int value)
Matrixpublic static Matrix createIdentityMatrix(int rows, int columns)
rows - The number of rows that should be created.columns - The number of columns that should be created.