baseCode.io.reader
Class DoubleMatrixReader

java.lang.Object
  extended bybaseCode.io.reader.AbstractNamedMatrixReader
      extended bybaseCode.io.reader.DoubleMatrixReader

public class DoubleMatrixReader
extends AbstractNamedMatrixReader

Reader for DenseDoubleMatrix2DNamed.

Copyright (c) 2004

Institution: Columbia University

Version:
$Id: DoubleMatrixReader.java,v 1.7 2005/03/21 18:01:04 pavlidis Exp $
Author:
Paul Pavlidis

Field Summary
 
Fields inherited from class baseCode.io.reader.AbstractNamedMatrixReader
log
 
Constructor Summary
DoubleMatrixReader()
           
 
Method Summary
protected  cern.colt.list.DoubleArrayList createEmptyRow(int numColumns)
           
protected  DenseDoubleMatrix2DNamed createMatrix(java.util.List MTemp, int rowCount, int colCount, java.util.List rowNames, java.util.List colNames)
           
 NamedMatrix read(java.io.InputStream stream)
           
 NamedMatrix read(java.io.InputStream stream, java.util.Set wantedRowNames)
           
 NamedMatrix read(java.io.InputStream stream, java.util.Set wantedRowNames, boolean createEmptyRows)
           
 NamedMatrix read(java.lang.String filename)
           
 NamedMatrix read(java.lang.String filename, java.util.Set wantedRowNames)
          Read a matrix from a file, subject to filtering criteria.
 NamedMatrix readOneRow(java.io.BufferedReader dis)
           
 
Methods inherited from class baseCode.io.reader.AbstractNamedMatrixReader
readHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleMatrixReader

public DoubleMatrixReader()
Method Detail

read

public NamedMatrix read(java.lang.String filename)
                 throws java.io.IOException
Specified by:
read in class AbstractNamedMatrixReader
Parameters:
filename - data file to read from
Returns:
NamedMatrix object constructed from the data file
Throws:
java.io.IOException

read

public NamedMatrix read(java.io.InputStream stream)
                 throws java.io.IOException
Specified by:
read in class AbstractNamedMatrixReader
Parameters:
stream - InputStream stream to read from
Returns:
NamedMatrix object constructed from the data file
Throws:
java.io.IOException

read

public NamedMatrix read(java.io.InputStream stream,
                        java.util.Set wantedRowNames)
                 throws java.io.IOException
Parameters:
stream - InputStream
wantedRowNames - Set
Returns:
read( stream, wantedRowNames, createEmptyRows ) with createEmptyRows set to true.
Throws:
java.io.IOException

read

public NamedMatrix read(java.io.InputStream stream,
                        java.util.Set wantedRowNames,
                        boolean createEmptyRows)
                 throws java.io.IOException
Parameters:
stream - InputStream
wantedRowNames - Set
createEmptyRows - if a row contained in wantedRowNames is not found in the file, create an empty row filled with Double.NaN iff this param is true.
Returns:
matrix
Throws:
java.io.IOException

readOneRow

public NamedMatrix readOneRow(java.io.BufferedReader dis)
                       throws java.io.IOException
Specified by:
readOneRow in class AbstractNamedMatrixReader
Throws:
java.io.IOException

read

public NamedMatrix read(java.lang.String filename,
                        java.util.Set wantedRowNames)
                 throws java.io.IOException
Read a matrix from a file, subject to filtering criteria.

Parameters:
filename - data file to read from
wantedRowNames - contains names of rows we want to get
Returns:
NamedMatrix object constructed from the data file
Throws:
java.io.IOException

createMatrix

protected DenseDoubleMatrix2DNamed createMatrix(java.util.List MTemp,
                                                int rowCount,
                                                int colCount,
                                                java.util.List rowNames,
                                                java.util.List colNames)

createEmptyRow

protected cern.colt.list.DoubleArrayList createEmptyRow(int numColumns)


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