Class MutableMatrix<E>
java.lang.Object
dk.jonaslindstrom.ruffini.common.matrices.elements.BaseMatrix<E>
dk.jonaslindstrom.ruffini.common.matrices.elements.MutableMatrix<E>
Instances of this class represents a mutable matrix.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMutableMatrix
(int m, int n, IntBinaryFunction<E> populator) MutableMatrix
(int m, int n, E defaultValue) -
Method Summary
Modifier and TypeMethodDescriptionReturns a new larger matrix of size m x n which has this matrix in the top left corner and pads the rest using the given padding value.get
(int i, int j) getColumn
(int j) int
getRow
(int i) int
getWidth()
<F> Matrix<F>
minor
(int i, int j) rows()
void
submatrix
(int[] rows, int[] columns) Return a submatrix of this matrix with the given rows and columns.submatrix
(int r0, int r1, int c0, int c1) Return a submatrix of this matrix containing row r0,...,r1-1 and column c0,...,c1-1.view()
Returns a view of the given matrix.Methods inherited from class dk.jonaslindstrom.ruffini.common.matrices.elements.BaseMatrix
apply, columns, equals, equals, isSquare, mutable, toString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
Methods inherited from interface dk.jonaslindstrom.ruffini.common.matrices.elements.Matrix
collapseColumns, collapseRows, extendWith, get, stream
-
Field Details
-
rows
-
-
Constructor Details
-
MutableMatrix
-
MutableMatrix
-
-
Method Details
-
set
-
submatrix
Return a submatrix of this matrix containing row r0,...,r1-1 and column c0,...,c1-1. -
minor
-
transpose
-
submatrix
Return a submatrix of this matrix with the given rows and columns.- Parameters:
rows
- Rows to include in submatrix.columns
- Columns to include in submatrix.
-
get
-
getRow
- Specified by:
getRow
in interfaceMatrix<E>
- Overrides:
getRow
in classBaseMatrix<E>
-
getColumn
- Specified by:
getColumn
in interfaceMatrix<E>
- Overrides:
getColumn
in classBaseMatrix<E>
-
getHeight
public int getHeight() -
getWidth
public int getWidth() -
rows
- Specified by:
rows
in interfaceMatrix<E>
- Overrides:
rows
in classBaseMatrix<E>
-
view
Description copied from interface:Matrix
Returns a view of the given matrix. This does not store any values but instead maps operations to this matrix. -
extendTo
Description copied from interface:Matrix
Returns a new larger matrix of size m x n which has this matrix in the top left corner and pads the rest using the given padding value. -
map
-