|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.datatype.SymmetricMatrix<T>
T
- the type of the matrix entriespublic class SymmetricMatrix<T>
Class for storing dense matrices. The data is stored in row-major mode. Indexes are zero-based.
Field Summary | |
---|---|
protected java.lang.Object[][] |
data
Data array: data is stored in columns.. |
int |
dim
Dimension, the number of rows and columns. |
Constructor Summary | |
---|---|
SymmetricMatrix(int dim,
T d)
Initializes a new instance of the SymmetricMatrix class. |
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 i,
int j)
Get the value at (i,j) |
void |
grow(int num_rows,
int num_columns)
Grows the matrix to the requested size, if necessary. |
void |
init(T d)
Initialize the matrix with a default value |
boolean |
isSymmetric()
True if the matrix is symmetric, false otherwise. |
int |
numberOfColumns()
Get the number of columns of the matrix. |
int |
numberOfRows()
Get the number of rows of the matrix. |
void |
set(int i,
int j,
T value)
Set the value at (i,j) |
IMatrix<T> |
transpose()
Get the transpose of the matrix, i.e. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object[][] data
public int dim
Constructor Detail |
---|
public SymmetricMatrix(int dim, T d)
dim
- the number of rows and columnsd
- the default value for elements, or nullMethod Detail |
---|
public boolean isSymmetric()
IMatrix
isSymmetric
in interface IMatrix<T>
public int numberOfRows()
IMatrix
numberOfRows
in interface IMatrix<T>
public int numberOfColumns()
IMatrix
numberOfColumns
in interface IMatrix<T>
public IMatrix<T> createMatrix(int num_rows, int num_columns)
IMatrix
createMatrix
in interface IMatrix<T>
num_rows
- the number of rowsnum_columns
- the number of columns
public void init(T d)
d
- the default valuepublic IMatrix<T> transpose()
IMatrix
transpose
in interface IMatrix<T>
public T get(int i, int j)
IMatrix
get
in interface IMatrix<T>
i
- the row IDj
- the column ID
public void set(int i, int j, T value)
IMatrix
set
in interface IMatrix<T>
i
- the row IDj
- the column IDvalue
- the valuepublic void grow(int num_rows, int num_columns)
IMatrix
grow
in interface IMatrix<T>
num_rows
- the minimum number of rowsnum_columns
- the minimum number of columns
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |