public class CellMaskedSparseMatrix extends CellMaskedMatrix implements SparseMatrix
SparseMatrix decorator allows every row and column index to be
remapped to new indices. The size of this matrix will depend on the number
of mapped rows and columns. Write-through access is allowed for each cell in
the underlying matrix through the set method. Array based accessors
and getters are disabled when using this decorator.Matrix.Type| Constructor and Description |
|---|
CellMaskedSparseMatrix(SparseMatrix matrix,
int[] rowMaskMap,
int[] colMaskMap)
Creates a new
CellMaskedSparseMatrix from a given SparseMatrix and maps, one for the row indices and one for the column
indices. |
| Modifier and Type | Method and Description |
|---|---|
SparseDoubleVector |
getColumnVector(int col)
Returns the column as a vector.
|
SparseDoubleVector |
getRowVector(int row)
Returns a
DoubleVector for an entire row. |
columns, get, getColumn, getIndexFromMap, getRow, rows, set, setColumn, setColumn, setRow, setRow, toDenseArraypublic CellMaskedSparseMatrix(SparseMatrix matrix, int[] rowMaskMap, int[] colMaskMap)
CellMaskedSparseMatrix from a given SparseMatrix and maps, one for the row indices and one for the column
indices. Only valid mappings should be included.matrix - The underlying matrix to decoraterowMaskMap - A mapping from new indices to old indices in the
original map for rows.colMaskMap - A mapping from new indices to old indices in the
original map for columns.public SparseDoubleVector getRowVector(int row)
DoubleVector for an entire row. Implementations should
return an approriately typed DoubleVector. Whether updates to the vector
are written through to the backing matrix is left open to the specific
implementation. Implementations that maintain their data in a sparse
format are encouraged to return a SparseVector instance.getRowVector in interface MatrixgetRowVector in interface SparseMatrixgetRowVector in class CellMaskedMatrixrow - the index of the row to return.DoubleVector representing the row at row.public SparseDoubleVector getColumnVector(int col)
SparseVector instance.getColumnVector in interface MatrixgetColumnVector in interface SparseMatrixgetColumnVector in class CellMaskedMatrixcol - The column to return a DoubleVector for.DoubleVector representing the column at column.Copyright © 2012. All Rights Reserved.