com.tagtraum.perf.datastructures
Class CRSMatrix

java.lang.Object
  |
  +--com.tagtraum.perf.datastructures.AbstractMatrix
        |
        +--com.tagtraum.perf.datastructures.CRSMatrix
All Implemented Interfaces:
Matrix, java.io.Serializable

public class CRSMatrix
extends AbstractMatrix
implements java.io.Serializable

Compressed Row Storage Matrix. Suitable for sparse matrices.

Version:
$Id: $
Author:
Hendrik Schreiber
See Also:
Serialized Form

Constructor Summary
CRSMatrix(int cols, int rows)
           
 
Method Summary
 java.lang.Object get(int col, int row)
          Returns an Object from a given position.
 java.lang.Object remove(int col, int row)
          Removes an Object from a given position.
 java.lang.Object set(int col, int row, java.lang.Object object)
          Sets an Object at a given position.
 
Methods inherited from class com.tagtraum.perf.datastructures.AbstractMatrix
addPropertyChangeListener, columns, equals, hashCode, isGrowable, rangeCheck, removePropertyChangeListener, rows, setColumns, setGrowable, setRows, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CRSMatrix

public CRSMatrix(int cols,
                 int rows)
Method Detail

set

public java.lang.Object set(int col,
                            int row,
                            java.lang.Object object)
Description copied from interface: Matrix
Sets an Object at a given position.

Specified by:
set in interface Matrix
Parameters:
col - column
row - row
object - Object to set
Returns:
the object that was replaced or null if there was none

get

public java.lang.Object get(int col,
                            int row)
Description copied from interface: Matrix
Returns an Object from a given position.

Specified by:
get in interface Matrix
Parameters:
col - column
row - row
Returns:
the object that is at the given position or null if there is none

remove

public java.lang.Object remove(int col,
                               int row)
Description copied from interface: Matrix
Removes an Object from a given position.

Specified by:
remove in interface Matrix
Parameters:
col - column
row - row
Returns:
the object that was at the given position or null if there was none


Copyright © 2002 Hendrik Schreiber
http://www.tagtraum.com/performance/
This software can be distributed under LGPL