com.multicorebsp.util
Class SparseMatrix<DataType extends MatrixData<DataType>,MatrixType extends SparseMatrix<DataType,MatrixType>>

java.lang.Object
  extended by com.multicorebsp.util.Matrix<DataType>
      extended by com.multicorebsp.util.SparseMatrix<DataType,MatrixType>
All Implemented Interfaces:
com.multicorebsp.core.CompulsaryCloneable<MatrixType>, java.lang.Cloneable
Direct Known Subclasses:
CRS, ICRS, TS

public abstract class SparseMatrix<DataType extends MatrixData<DataType>,MatrixType extends SparseMatrix<DataType,MatrixType>>
extends Matrix<DataType>
implements com.multicorebsp.core.CompulsaryCloneable<MatrixType>

General sparse matrix representation.


Field Summary
 DataType data
          Holds the nonzero values
 int n
          Matrix column size (always constant in a sparse matrix)
 
Fields inherited from class com.multicorebsp.util.Matrix
m, nz
 
Constructor Summary
  SparseMatrix(DataType _data)
          Base constructor.
protected SparseMatrix(DataType _data, int _m, int _n, int _nz)
          Deep copy constructor.
 
Method Summary
 java.lang.Object clone()
           
abstract  CRS<DataType> toCRS()
          Warning: returns current matrix if this matrix already is CRS.
abstract  ICRS<DataType> toICRS()
          Warning: returns current matrix if this matrix already is CRS.
abstract  TS<DataType> toTS()
          Warning: returns current matrix if this matrix already is TS.
 
Methods inherited from class com.multicorebsp.util.Matrix
removeAndAddDuplicates
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.multicorebsp.core.CompulsaryCloneable
safeClone
 

Field Detail

n

public int n
Matrix column size (always constant in a sparse matrix)


data

public DataType extends MatrixData<DataType> data
Holds the nonzero values

Constructor Detail

SparseMatrix

public SparseMatrix(DataType _data)
Base constructor.


SparseMatrix

protected SparseMatrix(DataType _data,
                       int _m,
                       int _n,
                       int _nz)
Deep copy constructor.

Method Detail

toICRS

public abstract ICRS<DataType> toICRS()
Warning: returns current matrix if this matrix already is CRS.

Returns:
CRS version of the current matrix.

toCRS

public abstract CRS<DataType> toCRS()
Warning: returns current matrix if this matrix already is CRS.

Returns:
CRS version of the current matrix.

toTS

public abstract TS<DataType> toTS()
Warning: returns current matrix if this matrix already is TS.

Returns:
TS version of the current matrix.

clone

public java.lang.Object clone()
Specified by:
clone in interface com.multicorebsp.core.CompulsaryCloneable<MatrixType extends SparseMatrix<DataType,MatrixType>>
Overrides:
clone in class java.lang.Object