jsci.util.array
Class SparseDoubleArray2D

java.lang.Object
  extended by jsci.util.array.AbstractDoubleArray2D
      extended by jsci.util.array.SparseDoubleArray2D
All Implemented Interfaces:
Array2D<java.lang.Double>, DoubleArray2D
Direct Known Subclasses:
AlgorithmsSparseDoubleArray2D

public class SparseDoubleArray2D
extends AbstractDoubleArray2D


Field Summary
protected  int capacityIncrement
          Amount by which to increase the capacity.
protected  int[] colPos
          Sparse indexing data.
protected  double[] elements
          Matrix elements.
protected  int numCols
           
protected  int numRows
           
protected  int[] rows
          Sparse indexing data.
protected  double zeroTol
           
 
Constructor Summary
SparseDoubleArray2D(double[][] array)
           
SparseDoubleArray2D(double[][] array, double zeroTol, int capacityIncrement)
           
SparseDoubleArray2D(int rowCount, int colCount)
           
SparseDoubleArray2D(int rowCount, int colCount, double zeroTol, int capacityIncrement)
           
 
Method Summary
 void addTo(int i, int j, double delta)
           
 int columns()
           
 SparseDoubleArray2D create(int rows, int cols)
           
 double getDouble(int i, int j)
           
 int getElementCount()
           
 int rows()
           
 void setDouble(int i, int j, double x)
           
 
Methods inherited from class jsci.util.array.AbstractDoubleArray2D
contentEquals, contentEquals, contentEquals, contentEqualsOp, contentEqualsOp, get, set, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numRows

protected final int numRows

numCols

protected final int numCols

zeroTol

protected final double zeroTol

elements

protected double[] elements
Matrix elements.


colPos

protected int[] colPos
Sparse indexing data. Contains the column positions of each element, e.g. colPos[n] is the column position of the nth element.


rows

protected final int[] rows
Sparse indexing data. Contains the indices of the start of each row, e.g. rows[i] is the index where the ith row starts.


capacityIncrement

protected final int capacityIncrement
Amount by which to increase the capacity.

Constructor Detail

SparseDoubleArray2D

public SparseDoubleArray2D(int rowCount,
                           int colCount)

SparseDoubleArray2D

public SparseDoubleArray2D(int rowCount,
                           int colCount,
                           double zeroTol,
                           int capacityIncrement)

SparseDoubleArray2D

public SparseDoubleArray2D(double[][] array)

SparseDoubleArray2D

public SparseDoubleArray2D(double[][] array,
                           double zeroTol,
                           int capacityIncrement)
Method Detail

create

public SparseDoubleArray2D create(int rows,
                                  int cols)

getDouble

public double getDouble(int i,
                        int j)

setDouble

public void setDouble(int i,
                      int j,
                      double x)

addTo

public void addTo(int i,
                  int j,
                  double delta)

rows

public int rows()

columns

public int columns()

getElementCount

public int getElementCount()