|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.datatype.SparseMatrix<T>
org.mymedialite.datatype.SymmetricSparseMatrix<T>
public class SymmetricSparseMatrix<T>
A symmetric sparse matrix; consumes less memory. Be careful when accessing the matrix via the NonEmptyRows property: this contains only the entries with x > y, but not their symmetric counterparts.
Field Summary |
---|
Fields inherited from class org.mymedialite.datatype.SparseMatrix |
---|
row_list |
Constructor Summary | |
---|---|
SymmetricSparseMatrix(int dimension,
T d)
Create a symmetric sparse matrix with a given dimension. |
Method Summary | |
---|---|
IMatrix<T> |
createMatrix(int num_rows,
int num_columns)
Create a matrix with a given number of rows and columns. |
T |
get(int x,
int y)
Access the elements of the sparse matrix. |
boolean |
isSymmetric()
Always true because the data type is symmetric. |
java.util.List<Pair<java.lang.Integer,java.lang.Integer>> |
nonEmptyEntryIDs()
The row and column IDs of non-empty entries in the matrix. |
int |
numberOfNonEmptyEntries()
The number of non-empty entries in the matrix. |
void |
set(int x,
int y,
T value)
Set the value at (i,j) |
Methods inherited from class org.mymedialite.datatype.SparseMatrix |
---|
get, grow, nonEmptyRows, numberOfColumns, numberOfRows, transpose |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SymmetricSparseMatrix(int dimension, T d)
dimension
- the dimension (number of rows/columns)d
- the default value for elements, or nullMethod Detail |
---|
public T get(int x, int y)
get
in interface IMatrix<T>
get
in class SparseMatrix<T>
x
- the row IDy
- the column ID
public void set(int x, int y, T value)
IMatrix
set
in interface IMatrix<T>
set
in class SparseMatrix<T>
x
- the row IDy
- the column IDvalue
- the valuepublic boolean isSymmetric()
isSymmetric
in interface IMatrix<T>
isSymmetric
in class SparseMatrix<T>
public IMatrix<T> createMatrix(int num_rows, int num_columns)
IMatrix
createMatrix
in interface IMatrix<T>
createMatrix
in class SparseMatrix<T>
num_rows
- the number of rowsnum_columns
- the number of columns
public java.util.List<Pair<java.lang.Integer,java.lang.Integer>> nonEmptyEntryIDs()
SparseMatrix
nonEmptyEntryIDs
in class SparseMatrix<T>
public int numberOfNonEmptyEntries()
SparseMatrix
numberOfNonEmptyEntries
in class SparseMatrix<T>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |