public class SparseMatrixParser extends Object
The first line contains three integers, which are the number of rows, the number of columns, and the number of nonzero entries in the matrix.
Following the first line, there are m + 1 integers that are the indices of columns, where m is the number of columns. Then there are n integers that are the row indices of nonzero entries, where n is the number of nonzero entries. Finally, there are n float numbers that are the values of nonzero entries.
The second format is more complicated and powerful, called Harwell-Boeing Exchange Format. For details, see http://people.sc.fsu.edu/~jburkardt/data/hb/hb.html. Note that our implementation supports only real-valued matrix and we ignore the optional right hand side vectors.
| Constructor and Description |
|---|
SparseMatrixParser()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SparseMatrix |
parse(File file)
Parse a Harwell-Boeing column-compressed sparse matrix dataset from given file.
|
SparseMatrix |
parse(InputStream stream)
Parse a Harwell-Boeing column-compressed sparse matrix dataset from an input stream.
|
SparseMatrix |
parse(String path)
Parse a Harwell-Boeing column-compressed sparse matrix dataset from given file.
|
SparseMatrix |
parse(URI uri)
Parse a Harwell-Boeing column-compressed sparse matrix dataset from given URI.
|
public SparseMatrix parse(URI uri) throws FileNotFoundException, IOException, ParseException
public SparseMatrix parse(String path) throws FileNotFoundException, IOException, ParseException
public SparseMatrix parse(File file) throws FileNotFoundException, IOException, ParseException
public SparseMatrix parse(InputStream stream) throws IOException, ParseException
stream - the input stream of data.FileNotFoundExceptionIOExceptionParseExceptionCopyright © 2015. All rights reserved.