baseCode.dataStructure.matrix
Class SparseRaggedDoubleMatrix2DNamed

java.lang.Object
  extended bybaseCode.dataStructure.matrix.AbstractNamedMatrix
      extended bybaseCode.dataStructure.matrix.AbstractNamedDoubleMatrix
          extended bybaseCode.dataStructure.matrix.SparseRaggedDoubleMatrix2DNamed
All Implemented Interfaces:
NamedMatrix

public class SparseRaggedDoubleMatrix2DNamed
extends AbstractNamedDoubleMatrix

A sparse matrix class where the rows are ragged and compressed.


Copyright (c) 2004 Columbia University

Version:
$Id: SparseRaggedDoubleMatrix2DNamed.java,v 1.13 2004/08/18 23:44:10 pavlidis Exp $
Author:
pavlidis

Constructor Summary
SparseRaggedDoubleMatrix2DNamed()
           
 
Method Summary
 void addRow(java.lang.String name, cern.colt.matrix.DoubleMatrix1D matrix1D)
           
 void addRow(java.lang.String name, cern.colt.list.IntArrayList indexes, cern.colt.list.DoubleArrayList values)
           
 int columns()
          Get the number of columns the matrix has.
 double get(int i, int j)
           
 java.lang.Object[] getColObj(int i)
           
 double getQuick(int i, int j)
           
 double[] getRow(int i)
           
 cern.colt.list.DoubleArrayList getRowArrayList(int row)
          This gives just the list of values in the row - make sure this is what you want.
 java.lang.Object[] getRowObj(int i)
          Get a row in the matrix as a generic Object[].
 boolean isMissing(int i, int j)
          (non-Javadoc) Note that in a sparse matrix, zero values are considered "missing"!
 int rows()
          Get the number of rows the matrix has
 void set(int i, int j, double d)
           
 void set(int i, int j, java.lang.Object val)
          Set a value in the matrix.
 java.lang.String toString()
           
 cern.colt.matrix.DoubleMatrix1D viewRow(int i)
           
 
Methods inherited from class baseCode.dataStructure.matrix.AbstractNamedDoubleMatrix
getRowByName
 
Methods inherited from class baseCode.dataStructure.matrix.AbstractNamedMatrix
addColumnName, addColumnName, addRowName, addRowName, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasRow, hasRowNames, numMissing, setColumnNames, setRowNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SparseRaggedDoubleMatrix2DNamed

public SparseRaggedDoubleMatrix2DNamed()
Method Detail

rows

public int rows()
Description copied from interface: NamedMatrix
Get the number of rows the matrix has

Specified by:
rows in interface NamedMatrix
Specified by:
rows in class AbstractNamedDoubleMatrix

columns

public int columns()
Description copied from interface: NamedMatrix
Get the number of columns the matrix has.

Specified by:
columns in interface NamedMatrix
Specified by:
columns in class AbstractNamedDoubleMatrix

set

public void set(int i,
                int j,
                java.lang.Object val)
Description copied from interface: NamedMatrix
Set a value in the matrix.

Specified by:
set in interface NamedMatrix
Specified by:
set in class AbstractNamedDoubleMatrix

set

public void set(int i,
                int j,
                double d)
Specified by:
set in class AbstractNamedDoubleMatrix
Parameters:
i - row
j - column
d - value

getRowObj

public java.lang.Object[] getRowObj(int i)
Description copied from interface: NamedMatrix
Get a row in the matrix as a generic Object[]. This exists so NamedMatrices can be used more generically.

Specified by:
getRowObj in interface NamedMatrix
Specified by:
getRowObj in class AbstractNamedDoubleMatrix

getColObj

public java.lang.Object[] getColObj(int i)
Specified by:
getColObj in interface NamedMatrix
Specified by:
getColObj in class AbstractNamedDoubleMatrix

isMissing

public boolean isMissing(int i,
                         int j)
(non-Javadoc) Note that in a sparse matrix, zero values are considered "missing"!

Specified by:
isMissing in interface NamedMatrix
Specified by:
isMissing in class AbstractNamedDoubleMatrix
See Also:
NamedMatrix.isMissing(int, int)

toString

public java.lang.String toString()
Returns:
java.lang.String

get

public double get(int i,
                  int j)
Specified by:
get in class AbstractNamedDoubleMatrix
Returns:

getRowArrayList

public cern.colt.list.DoubleArrayList getRowArrayList(int row)
This gives just the list of values in the row - make sure this is what you want. It does not include the zero values.

Specified by:
getRowArrayList in class AbstractNamedDoubleMatrix
Parameters:
row -
Returns:

viewRow

public cern.colt.matrix.DoubleMatrix1D viewRow(int i)
Specified by:
viewRow in class AbstractNamedDoubleMatrix
Parameters:
i -
Returns:

getRow

public double[] getRow(int i)
Specified by:
getRow in class AbstractNamedDoubleMatrix

addRow

public void addRow(java.lang.String name,
                   cern.colt.list.IntArrayList indexes,
                   cern.colt.list.DoubleArrayList values)
Parameters:
name -
indexes -
values -

addRow

public void addRow(java.lang.String name,
                   cern.colt.matrix.DoubleMatrix1D matrix1D)
Parameters:
matrix1D -

getQuick

public double getQuick(int i,
                       int j)
Specified by:
getQuick in class AbstractNamedDoubleMatrix
Parameters:
i -
j -
Returns:


Copyright © 2003-2005 Columbia University. All Rights Reserved.