|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.kernel.math.algebra.AbstractMdMatrix<R,C>
sbrt.kernel.math.algebra.AbstractSmdMatrix<R,C>
sbrt.kernel.math.algebra.TreeMatrix<R,C>
R
- the row type.C
- the column type.public class TreeMatrix<R extends java.lang.Comparable<? super R>,C extends java.lang.Comparable<? super C>>
This class is a java.util.TreeMap
based implementation of SmdMatrix.
RowOrTreeMatrix
,
HashMatrix
Constructor Summary | |
---|---|
TreeMatrix()
Constructs an emtpy TreeMatrix . |
Method Summary | ||
---|---|---|
int |
columns()
Returns the number of columns in this matrix. |
|
java.util.TreeSet<C> |
getColIndNzEl(java.lang.Object rowIndex)
Returns the set of column indices whose elements are nonzero in the row corresponding to the provided index. |
|
TreeMatrix<R,C> |
getColumn(java.lang.Object columnIndex)
Returns the column corresponding to the provided column index. |
|
java.util.TreeSet<C> |
getColumnIndices()
Returns the set of column indices contained in this matrix. |
|
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. |
|
TreeMatrix<R,C> |
getRow(java.lang.Object rowIndex)
Returns the row corresponding to the provided row index. |
|
java.util.TreeSet<R> |
getRowIndices()
Returns the set of row indices contained in this matrix. |
|
java.util.TreeSet<R> |
getRowIndNzEl(java.lang.Object columnIndex)
Returns the set of row indices whose elements are nonzero in the column corresponding to the provided index. |
|
int |
hashCode()
Returns a content-based hash code for this matrix. |
|
boolean |
isColumnIndex(java.lang.Object obj)
Indicates if the provided object is a column index in this matrix. |
|
boolean |
isRowIndex(java.lang.Object obj)
Indicates if the provided object is a row index in this matrix. |
|
void |
removeColumn(java.lang.Object columnIndex)
Removes the column corresponding to the provided column index. |
|
void |
removeRow(java.lang.Object rowIndex)
Removes the row corresponding to the provided row index. |
|
int |
rows()
Returns the number of rows in this matrix. |
|
|
setElement(X rowIndex,
Y columnIndex,
Z value)
Sets the element at the provided row and column indices to the provided double precision value. |
Methods inherited from class sbrt.kernel.math.algebra.AbstractSmdMatrix |
---|
equals, setElement, setElements, setElements, setElements, toLinearCombs |
Methods inherited from class sbrt.kernel.math.algebra.AbstractMdMatrix |
---|
isEmpty, setElements, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface sbrt.kernel.math.algebra.DoubleMatrixBuilder |
---|
setElements |
Methods inherited from interface sbrt.kernel.math.algebra.Matrix |
---|
isEmpty, toString |
Constructor Detail |
---|
public TreeMatrix()
TreeMatrix
.
Method Detail |
---|
public <X extends R,Y extends C,Z extends java.lang.Double> void setElement(X rowIndex, Y columnIndex, Z value)
X
- a type extending the primary row type.Y
- a type extending the primary column type.Z
- Double.rowIndex
- the row index.columnIndex
- the column index.value
- the double precision element value.public boolean isRowIndex(java.lang.Object obj)
obj
- the potential row index.
true
if the provided object is a row
index in this matrix; false
otherwise.public boolean isColumnIndex(java.lang.Object obj)
obj
- the potential column index.
true
if the provided object is a column
index in this matrix; false
otherwise.public TreeMatrix<R,C> getRow(java.lang.Object rowIndex)
rowIndex
- the index of the row to be returned.
public TreeMatrix<R,C> getColumn(java.lang.Object columnIndex)
columnIndex
- the index of the column to be returned.
public void removeRow(java.lang.Object rowIndex)
rowIndex
- the index of the row to be removed.public void removeColumn(java.lang.Object columnIndex)
columnIndex
- the index of the column to be removed.public java.lang.Double getElement(java.lang.Object rowIndex, java.lang.Object columnIndex)
rowIndex
- the row index.columnIndex
- the column index.
public java.util.TreeSet<C> getColumnIndices()
public java.util.TreeSet<R> getRowIndices()
public java.util.TreeSet<R> getRowIndNzEl(java.lang.Object columnIndex)
columnIndex
- the column index.
public java.util.TreeSet<C> getColIndNzEl(java.lang.Object rowIndex)
rowIndex
- the row index.
public int rows()
public int columns()
public int hashCode()
hashCode
in interface Matrix<R extends java.lang.Comparable<? super R>,C extends java.lang.Comparable<? super C>,java.lang.Double>
hashCode
in class AbstractSmdMatrix<R extends java.lang.Comparable<? super R>,C extends java.lang.Comparable<? super C>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |