|
||||||||||
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>
R
- the row type.C
- the column type.public class DoubleMatrixWrap<R,C>
This class is used to wrap mutable matrices as an immutable
DoubleMatrix
. 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 | |
---|---|
DoubleMatrixWrap(DoubleMatrix<R,C> m)
Constructs a new wrapper around the provided matrix. |
Method Summary | |
---|---|
DoubleMatrix<R,C> |
getColumn(java.lang.Object columnIndex)
Returns the column corresponding to the provided column index. |
java.lang.Double |
getElement(java.lang.Object rowIndex,
java.lang.Object columnIndex)
Returns the element of this matrix at the provided row and column indices. |
DoubleMatrix<R,C> |
getRow(java.lang.Object rowIndex)
Returns the row corresponding to the provided row index. |
java.util.List<LinearComb<C>> |
toLinearCombs()
Returns this matrix as a list of linear combinations. |
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.Matrix |
---|
columns, equals, getColumnIndices, getRowIndices, hashCode, isColumnIndex, isEmpty, isRowIndex, rows, toString |
Constructor Detail |
---|
public DoubleMatrixWrap(DoubleMatrix<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.lang.Double getElement(java.lang.Object rowIndex, java.lang.Object columnIndex)
getElement
in interface DoubleMatrix<R,C>
getElement
in interface Matrix<R,C,java.lang.Double>
getElement
in class MatrixWrap<R,C,java.lang.Double>
rowIndex
- the row index.columnIndex
- the column index.
public DoubleMatrix<R,C> getRow(java.lang.Object rowIndex)
getRow
in interface DoubleMatrix<R,C>
getRow
in interface Matrix<R,C,java.lang.Double>
getRow
in class MatrixWrap<R,C,java.lang.Double>
rowIndex
- the index of the row to be returned.
public DoubleMatrix<R,C> getColumn(java.lang.Object columnIndex)
getColumn
in interface DoubleMatrix<R,C>
getColumn
in interface Matrix<R,C,java.lang.Double>
getColumn
in class MatrixWrap<R,C,java.lang.Double>
columnIndex
- the index of the column to be returned.
public java.util.List<LinearComb<C>> toLinearCombs()
toLinearCombs
in interface DoubleMatrix<R,C>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |