org.mymedialite.datatype
Class SkewSymmetricSparseMatrix

java.lang.Object
  extended by org.mymedialite.datatype.SparseMatrix<T>
      extended by org.mymedialite.datatype.SymmetricSparseMatrix<java.lang.Float>
          extended by org.mymedialite.datatype.SkewSymmetricSparseMatrix
All Implemented Interfaces:
IMatrix<java.lang.Float>

public class SkewSymmetricSparseMatrix
extends SymmetricSparseMatrix<java.lang.Float>

A skew symmetric (anti-symmetric) sparse matrix; consumes less memory. Be careful when accessing the matrix via the NonEmptyEntryIDs and NonEmptyRows properties: these contain only the entries with x > y, but not their antisymmetric counterparts. * @version 2.03


Field Summary
 
Fields inherited from class org.mymedialite.datatype.SparseMatrix
row_list
 
Constructor Summary
SkewSymmetricSparseMatrix(int dimension)
          Create a skew symmetric sparse matrix with a given dimension.
 
Method Summary
 IMatrix<java.lang.Float> createMatrix(int num_rows, int num_columns)
          Create a matrix with a given number of rows and columns.
 java.lang.Float get(int x, int y)
          Get an element of the sparse matrix.
 boolean isSymmetric()
          Only true if all entries are zero.
 void set(int x, int y, java.lang.Float value)
          Set an element of the sparse matrix.
 
Methods inherited from class org.mymedialite.datatype.SymmetricSparseMatrix
nonEmptyEntryIDs, numberOfNonEmptyEntries
 
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

SkewSymmetricSparseMatrix

public SkewSymmetricSparseMatrix(int dimension)
Create a skew symmetric sparse matrix with a given dimension.

Parameters:
dimension - the dimension (number of rows/columns)
Method Detail

get

public java.lang.Float get(int x,
                           int y)
Get an element of the sparse matrix.

Specified by:
get in interface IMatrix<java.lang.Float>
Overrides:
get in class SymmetricSparseMatrix<java.lang.Float>
Parameters:
x - the row ID
y - the column ID
Returns:
the value

set

public void set(int x,
                int y,
                java.lang.Float value)
Set an element of the sparse matrix.

Specified by:
set in interface IMatrix<java.lang.Float>
Overrides:
set in class SymmetricSparseMatrix<java.lang.Float>
Parameters:
x - the row ID
y - the column ID
value - the value to set

isSymmetric

public boolean isSymmetric()
Only true if all entries are zero.

Specified by:
isSymmetric in interface IMatrix<java.lang.Float>
Overrides:
isSymmetric in class SymmetricSparseMatrix<java.lang.Float>
Returns:
true only if all entries are zero

createMatrix

public IMatrix<java.lang.Float> createMatrix(int num_rows,
                                             int num_columns)
Description copied from interface: IMatrix
Create a matrix with a given number of rows and columns.

Specified by:
createMatrix in interface IMatrix<java.lang.Float>
Overrides:
createMatrix in class SymmetricSparseMatrix<java.lang.Float>
Parameters:
num_rows - the number of rows
num_columns - the number of columns
Returns:
a matrix with num_rows rows and num_column columns