|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectbaseCode.io.reader.AbstractNamedMatrixReader
baseCode.io.reader.SparseDoubleMatrixReader
Copyright (c) 2004 Columbia University
| Field Summary |
| Fields inherited from class baseCode.io.reader.AbstractNamedMatrixReader |
log |
| Constructor Summary | |
SparseDoubleMatrixReader()
|
|
| Method Summary | |
NamedMatrix |
read(java.io.InputStream stream)
|
NamedMatrix |
read(java.io.InputStream stream,
java.util.Set wantedRowNames)
Read a sparse matrix that is expressed as an adjacency list in a tab-delimited file: |
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 |
readJW(java.io.InputStream stream)
Read a sparse matrix in "JW" (Jason Weston) format. |
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 |
public SparseDoubleMatrixReader()
| Method Detail |
public NamedMatrix read(java.lang.String filename)
throws java.io.IOException
read in class AbstractNamedMatrixReaderfilename - data file to read from
java.io.IOException
public NamedMatrix read(java.io.InputStream stream)
throws java.io.IOException
read in class AbstractNamedMatrixReaderstream - InputStream stream to read from
java.io.IOException
public NamedMatrix read(java.lang.String filename,
java.util.Set wantedRowNames)
throws java.io.IOException
filename - data file to read fromwantedRowNames - contains names of rows we want to get
java.io.IOException
public NamedMatrix readJW(java.io.InputStream stream)
throws java.io.IOException,
java.lang.IllegalAccessException,
java.lang.NoSuchFieldException
2 <--- number of items - the first line of the file only. NOTE - this line is often blank or not present.
1 2 <--- items 1 has 2 edges
1 2 <--- edge indices are to items 1 & 2
0.1 100 <--- with the following weights
2 2 <--- items 2 also has 2 edges
1 2 <--- edge indices are also to items 1 & 2 (fully connected)
100 0.1 <--- with the following weights
Note that the item numbering starts at 1. This is a requirement.
Note that this cannot handle very large matrices - the limit to rows x columns is the number Integer.MAX_VALUE. This is an implementation problem for colt's sparse matrix.
stream -
java.io.IOException
java.lang.IllegalAccessException
java.lang.NoSuchFieldException
public NamedMatrix read(java.io.InputStream stream,
java.util.Set wantedRowNames)
throws java.io.IOException
item1 item2 weight
item1 item5 weight
By definition the resulting matrix is square and symmetric.
Note that the ordering of the items will be as they are encountered in the file.
stream - InputStreamwantedRowNames - Set
java.io.IOException
public NamedMatrix readOneRow(java.io.BufferedReader dis)
throws java.io.IOException
readOneRow in class AbstractNamedMatrixReaderjava.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||