|
|||||||||||
| 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.SparseRaggedDouble2DNamedMatrixReader
Best data structure for reading really big, really sparse matrices when a matrix represetation is needed. *
The standard format looks like this:
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
Copyright (c) 2004 Columbia University
| Field Summary |
| Fields inherited from class baseCode.io.reader.AbstractNamedMatrixReader |
log |
| Constructor Summary | |
SparseRaggedDouble2DNamedMatrixReader()
|
|
| Method Summary | |
NamedMatrix |
read(java.io.InputStream stream)
Read an entire sparse matrix from a stream (JW format). |
NamedMatrix |
read(java.io.InputStream stream,
int offset)
Read an entire sparse matrix from a stream (JW format). |
NamedMatrix |
read(java.lang.String fileName)
|
NamedMatrix |
readFromAdjList(java.io.InputStream stream)
|
NamedMatrix |
readFromAdjList(java.lang.String fileName)
Read a sparse symmetric square matrix that is expressed as an adjacency list in a tab-delimited file: |
NamedMatrix |
readOneRow(java.io.BufferedReader dis)
|
NamedMatrix |
readOneRow(java.io.BufferedReader dis,
int offset)
Use this to read one row from a matrix (JW format). |
| 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 SparseRaggedDouble2DNamedMatrixReader()
| Method Detail |
public NamedMatrix readFromAdjList(java.lang.String fileName)
throws java.io.IOException
item1 item2 weight
item1 item5 weight
IMPORTANT: By definition the resulting matrix is square and symmetric, even if the symmetric edges are not explicitly listed.
java.io.IOException
public NamedMatrix readFromAdjList(java.io.InputStream stream)
throws java.lang.NumberFormatException,
java.io.IOException
stream -
java.io.IOException
java.lang.NumberFormatException - Read a sparse symmetric square matrix that is expressed as an adjacency list in a
tab-delimited file:
item1 item2 weight
item1 item5 weight
IMPORTANT: By definition the resulting matrix is square and symmetric, even if the symmetric edges are not explicitly listed.
public NamedMatrix read(java.lang.String fileName)
throws java.io.IOException
read in class AbstractNamedMatrixReaderjava.io.IOException
public NamedMatrix readOneRow(java.io.BufferedReader dis)
throws java.io.IOException
readOneRow in class AbstractNamedMatrixReaderjava.io.IOException
public NamedMatrix readOneRow(java.io.BufferedReader dis,
int offset)
throws java.io.IOException
offset - A value indicating the lowest value for the indexes listed. This is here in case the indexes in the
stream are numbered starting from 1 instead of zero.
java.io.IOException
public NamedMatrix read(java.io.InputStream stream)
throws java.io.IOException
read in class AbstractNamedMatrixReaderstream -
java.io.IOException
public NamedMatrix read(java.io.InputStream stream,
int offset)
throws java.io.IOException
stream - offset - A value indicating the lowest value for the indexes listed. This is here in case the indexes in the
stream are numbered starting from 1 instead of zero.
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||