public class RowScaledSparseMatrix extends RowScaledMatrix implements SparseMatrix
SparseMatrix
s. Each row can be scaled by some
scalar constant in O(1) time by applying the scalar value for each row during
all gets and sets to values in the row.Matrix.Type
Constructor and Description |
---|
RowScaledSparseMatrix(SparseMatrix matrix,
DoubleVector v)
Creates a
RowScaledSparseMatrix that provides scaled read only
access to the provided SparseMatrix instance. |
Modifier and Type | Method and Description |
---|---|
SparseDoubleVector |
getColumnVector(int row)
Returns the column as a vector.
|
SparseDoubleVector |
getRowVector(int row)
Returns a
DoubleVector for an entire row. |
columns, get, getColumn, getRow, rows, set, setColumn, setColumn, setRow, setRow, toDenseArray
public RowScaledSparseMatrix(SparseMatrix matrix, DoubleVector v)
RowScaledSparseMatrix
that provides scaled read only
access to the provided SparseMatrix
instance.public SparseDoubleVector getColumnVector(int row)
SparseVector
instance.getColumnVector
in interface Matrix
getColumnVector
in interface SparseMatrix
getColumnVector
in class RowScaledMatrix
row
- The column to return a DoubleVector
for.DoubleVector
representing the column at column
.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 Matrix
getRowVector
in interface SparseMatrix
getRowVector
in class RowScaledMatrix
row
- the index of the row to return.DoubleVector
representing the row at row
.Copyright © 2012. All Rights Reserved.