|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.kernel.math.algebra.MatrixWrap<R,C,java.lang.Double>
sbrt.kernel.math.algebra.DoubleMatrixWrap<R,C>
sbrt.kernel.math.algebra.SparseDoubleMatrixWrap<R,C>
R
- the row type.C
- the column type.public class SparseDoubleMatrixWrap<R,C>
This class is used to wrap mutable matrices as an immutable
SparseDoubleMatrix
. This type of wrapping eliminates the possibility
of casting a mutable matrix back to its mutable type. This ensures that a
mutable matrix can be viewed by others in a safe way, without fear of
modification.
Instances of this class are immutable.
Constructor Summary | |
---|---|
SparseDoubleMatrixWrap(SparseDoubleMatrix<R,C> m)
Constructs a new wrapper around the provided matrix. |
Method Summary | |
---|---|
java.util.Set<C> |
getColIndNzEl(java.lang.Object rowIndex)
Returns the set of column indices whose elements are nonzero in the row corresponding to the provided index. |
SparseDoubleMatrix<R,C> |
getColumn(java.lang.Object columnIndex)
Returns the column corresponding to the provided column index. |
SparseDoubleMatrix<R,C> |
getRow(java.lang.Object rowIndex)
Returns the row corresponding to the provided row index. |
java.util.Set<R> |
getRowIndNzEl(java.lang.Object columnIndex)
Returns the set of row indices whose elements are nonzero in the column corresponding to the provided index. |
Methods inherited from class sbrt.kernel.math.algebra.DoubleMatrixWrap |
---|
getElement, toLinearCombs |
Methods inherited from class sbrt.kernel.math.algebra.MatrixWrap |
---|
columns, equals, getColumnIndices, getRowIndices, hashCode, isColumnIndex, isEmpty, isRowIndex, rows, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface sbrt.kernel.math.algebra.DoubleMatrix |
---|
getElement, toLinearCombs |
Methods inherited from interface sbrt.kernel.math.algebra.Matrix |
---|
columns, equals, getColumnIndices, getRowIndices, hashCode, isColumnIndex, isEmpty, isRowIndex, rows, toString |
Constructor Detail |
---|
public SparseDoubleMatrixWrap(SparseDoubleMatrix<R,C> m)
m
- the matrix to be wrapped by this wrapper object.
java.lang.NullPointerException
- if the provided matrix is
null
.Method Detail |
---|
public java.util.Set<R> getRowIndNzEl(java.lang.Object columnIndex)
getRowIndNzEl
in interface SparseDoubleMatrix<R,C>
columnIndex
- the column index.
public java.util.Set<C> getColIndNzEl(java.lang.Object rowIndex)
getColIndNzEl
in interface SparseDoubleMatrix<R,C>
rowIndex
- the row index.
public SparseDoubleMatrix<R,C> getRow(java.lang.Object rowIndex)
getRow
in interface DoubleMatrix<R,C>
getRow
in interface Matrix<R,C,java.lang.Double>
getRow
in interface SparseDoubleMatrix<R,C>
getRow
in class DoubleMatrixWrap<R,C>
rowIndex
- the index of the row to be returned.
public SparseDoubleMatrix<R,C> getColumn(java.lang.Object columnIndex)
getColumn
in interface DoubleMatrix<R,C>
getColumn
in interface Matrix<R,C,java.lang.Double>
getColumn
in interface SparseDoubleMatrix<R,C>
getColumn
in class DoubleMatrixWrap<R,C>
columnIndex
- the index of the column to be returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |