public class SparseMatrix extends MutableAbstractMatrix
buffer, columns, rows, zeroPadded| Constructor and Description |
|---|
SparseMatrix(int rows,
int columns)
Creates a sparse matrix with the given dimensions.
|
SparseMatrix(int rows,
int columns,
boolean zeroPadded)
Creates a sparse matrix with the given dimensions.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
allocate(MatrixBackingBuffer buffer)
Calls
MatrixBackingBuffer.allocate(int) on the used buffer. |
float |
get(int row,
int column)
Gets the value from
row and column. |
void |
set(int row,
int column,
float value)
Sets the given value.
|
float |
sum()
Compute the sum of all elements.
|
String |
toString() |
copy, copy, copy, copy, fill, set, setColumn, setRowadd, checkBounds, columnSum, enlarge, equals, get, getColumn, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, hashCode, isInvalid, isValidXORZeroPadded, isZeroPadded, multiply, multiply, rowSum, subtract, toIndex, translate, transposeclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, columnSum, enlarge, getColumn, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, isZeroPadded, multiply, multiply, rowSum, subtract, translate, transposepublic SparseMatrix(int rows,
int columns,
boolean zeroPadded)
rows - number of rowscolumns - number of columnszeroPadded - zero-pad or not?public SparseMatrix(int rows,
int columns)
rows - number of rowscolumns - number of columnspublic float get(int row,
int column)
Matrixrow and column.
If the matrix supports zero-padding, this method may return
0f for undefined rows or columns.get in interface Matrixget in class AbstractMatrixrow - rowcolumn - columnpublic void set(int row,
int column,
float value)
MutableMatrixset in interface MutableMatrixset in class MutableAbstractMatrixrow - rowcolumn - columnvalue - valueprotected void allocate(MatrixBackingBuffer buffer)
MutableAbstractMatrixMatrixBackingBuffer.allocate(int) on the used buffer.allocate in class MutableAbstractMatrixbuffer - bufferpublic float sum()
Matrixsum in interface Matrixsum in class AbstractMatrixpublic String toString()
toString in class AbstractMatrixCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.