baseCode.io.reader
Class DoubleMatrixReader
java.lang.Object
baseCode.io.reader.AbstractNamedMatrixReader
baseCode.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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleMatrixReader
public DoubleMatrixReader()
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 - InputStreamwantedRowNames - 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 - InputStreamwantedRowNames - SetcreateEmptyRows - 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 fromwantedRowNames - 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.