public class SparseRaggedMatrixReader extends DoubleMatrixReader
DoubleMatrixReaderlog| Constructor and Description |
|---|
SparseRaggedMatrixReader() |
| Modifier and Type | Method and Description |
|---|---|
DoubleMatrix<String,String> |
read(InputStream stream,
int offset)
Read an entire sparse matrix from a stream (JW format).
|
DoubleMatrix<String,String> |
readFromAdjList(InputStream stream) |
DoubleMatrix<String,String> |
readFromAdjList(String fileName)
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.
|
DoubleMatrix<String,String> |
readOneRow(BufferedReader dis,
int offset)
Use this to read one row from a matrix (JW format).
|
createEmptyRow, createMatrix, read, read, read, read, read, read, read, readreadHeaderpublic DoubleMatrix<String,String> read(InputStream stream, int offset) throws 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.IOExceptionpublic DoubleMatrix<String,String> readFromAdjList(InputStream stream) throws NumberFormatException, IOException
stream - IOExceptionNumberFormatException - 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 DoubleMatrix<String,String> readFromAdjList(String fileName) throws 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.
name - of fileIOExceptionpublic DoubleMatrix<String,String> readOneRow(BufferedReader dis, int offset) throws 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.IOExceptionCopyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.