info.jonclark.lang
Class SparseMatrix<T>
java.lang.Object
info.jonclark.lang.SparseMatrix<T>
- All Implemented Interfaces:
- Serializable
public class SparseMatrix<T>
- extends Object
- implements Serializable
A matrix composed of SparseArray objects that
minimizes memory consumption for very large matrices when
not all elements must be set
Created on January 30, 2006
- See Also:
- Serialized Form
|
Method Summary |
T |
get(long nRow,
long nCol)
Get an element of this SparseMatrix |
void |
set(long nRow,
long nCol,
T obj)
Sets an element of this SparseMatrix
If the element at the given ID does not already exist,
it will be created. |
SparseMatrix
public SparseMatrix()
set
public void set(long nRow,
long nCol,
T obj)
- Sets an element of this
SparseMatrix
If the element at the given ID does not already exist,
it will be created.
- Parameters:
nRow - The row that will be set or creatednCol - The column that will be set or createdobj - The element that will be put at the specified location
get
public T get(long nRow,
long nCol)
- Get an element of this SparseMatrix
- Parameters:
nRow - The row at which the object is locatednCol - The column at which the object is located
- Returns:
- The object at the given location or
null if the
location has not previously been set