public class SparseColumnMatrix extends MutableAbstractMatrix
Matrix.getColumn(int)
runs much more quickly than Matrix.getRow(int).
The same is true for MutableMatrix.setColumn(int, float[]) and its column
counterpart.buffer, columns, rows, zeroPadded| Constructor and Description |
|---|
SparseColumnMatrix(int rows,
int columns)
Creates a sparse matrix with the given dimensions.
|
SparseColumnMatrix(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[] |
columnSum()
Compute the sum for each column.
|
float |
get(int row,
int column)
Gets the value from
row and column. |
float[] |
getColumn(int column)
Gets the value from
column. |
float[] |
rowSum()
Compute the sum for each row.
|
void |
set(int row,
int column,
float value)
Sets the given value.
|
void |
setColumn(int column,
float[] values)
Sets the given values.
|
float |
sum()
Compute the sum of all elements.
|
String |
toString() |
copy, copy, copy, copy, fill, set, setRowadd, checkBounds, enlarge, equals, get, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, hashCode, isInvalid, isValidXORZeroPadded, isZeroPadded, multiply, multiply, subtract, toIndex, translate, transposeclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, enlarge, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, isZeroPadded, multiply, multiply, subtract, translate, transposepublic SparseColumnMatrix(int rows,
int columns,
boolean zeroPadded)
rows - number of rowscolumns - number of columnszeroPadded - zero-pad or not?public SparseColumnMatrix(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 float[] getColumn(int column)
Matrixcolumn.
If the matrix supports zero-padding, this method may return
0f for undefined columns.getColumn in interface MatrixgetColumn in class AbstractMatrixcolumn - columnpublic void set(int row,
int column,
float value)
MutableMatrixset in interface MutableMatrixset in class MutableAbstractMatrixrow - rowcolumn - columnvalue - valuepublic void setColumn(int column,
float[] values)
MutableMatrixsetColumn in interface MutableMatrixsetColumn in class MutableAbstractMatrixcolumn - columnvalues - valuespublic float sum()
Matrixsum in interface Matrixsum in class AbstractMatrixpublic float[] columnSum()
MatrixcolumnSum in interface MatrixcolumnSum in class AbstractMatrixpublic float[] rowSum()
MatrixrowSum in interface MatrixrowSum in class AbstractMatrixprotected void allocate(MatrixBackingBuffer buffer)
MutableAbstractMatrixMatrixBackingBuffer.allocate(int) on the used buffer.allocate in class MutableAbstractMatrixbuffer - bufferpublic String toString()
toString in class AbstractMatrixCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.