Class SparseMatrix<E>
java.lang.Object
dk.jonaslindstrom.ruffini.common.matrices.elements.BaseMatrix<E>
dk.jonaslindstrom.ruffini.common.matrices.elements.SparseMatrix<E>
This class represents a sparse matrix by only storing the non-zero entries.
-
Nested Class Summary
Nested Classes -
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) int
int
getWidth()
<F> Matrix<F>
minor
(int i, int j) submatrix
(int[] rows, int[] columns) Returns a new matrix with the given rows and columns from this matrix.submatrix
(int r0, int r1, int c0, int c1) Returns a new matrix of size (r1-r0) x (c1-c0) with rows r0, ..., r1-1 and columns c0, ..., c1-1 from this matrix.view()
Returns a view of the given matrix.Methods inherited from class dk.jonaslindstrom.ruffini.common.matrices.elements.BaseMatrix
apply, columns, equals, equals, getColumn, getRow, isSquare, mutable, rows, 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
-
Method Details
-
get
-
getHeight
public int getHeight() -
getWidth
public int getWidth() -
minor
-
transpose
-
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. -
submatrix
Description copied from interface:Matrix
Returns a new matrix with the given rows and columns from this matrix. The given arrays are assumed to be sorted. -
submatrix
Description copied from interface:Matrix
Returns a new matrix of size (r1-r0) x (c1-c0) with rows r0, ..., r1-1 and columns c0, ..., c1-1 from this matrix. -
map
-
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.
-