|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.multicorebsp.util.MMfile
public class MMfile
Models, and parses, a matrix-market file. Also has support for the Extended Matrix-Market format.
Nested Class Summary | |
---|---|
static class |
MMfile.VERSION
Used to differentiate between original matrix-market and extended matrix market. |
Field Summary | |
---|---|
static MMfile.VERSION |
OVERRIDE
Set to a version type to ignore banner errors and try to read with default values of MMmatrix. |
Constructor Summary | |
---|---|
MMfile(java.lang.String fn)
Reads in a matrix market object from file. |
|
MMfile(java.lang.String fn,
java.util.Collection<java.lang.String> skip)
Reads in a matrix market object from file. |
Method Summary | |
---|---|
java.lang.String |
getFilename()
|
MMobject |
getFileObject()
|
MMobject |
getFileObject(java.lang.String name)
Scans read-in objects for one with a given name, and returns this object. |
java.util.ArrayList<MMobject> |
getFileObjects()
|
MMfile.VERSION |
getVersion()
|
boolean |
isSuccessfully_read()
|
protected void |
mm_read_banner(java.util.Scanner s,
MMobject matrix,
MMfile.VERSION force_compatibility,
boolean main)
Interprets the very first line of a matrix-market input file. |
protected void |
mm_read_mtx_crd_entry(java.util.Scanner s,
int at,
MMobject matrix)
Reads in a single value from a matrix market file. |
protected void |
mm_read_mtx_crd_size(java.util.Scanner s,
MMobject matrix)
Reads in the matrix dimensions and number of nonzeroes. |
protected void |
mm_read_mtx_pstart_entry(java.util.Scanner s,
int i,
MMobject matrix)
Reads in an element from the Pstart vector. |
protected boolean |
mm_read_object(java.util.Scanner s,
boolean first,
java.util.Collection<java.lang.String> skip)
Reads in a matrix-market object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static MMfile.VERSION OVERRIDE
MMobject
Constructor Detail |
---|
public MMfile(java.lang.String fn) throws java.io.IOException
fn
- Name of file to read.
java.io.IOException
public MMfile(java.lang.String fn, java.util.Collection<java.lang.String> skip) throws java.io.IOException
fn
- Name of file to read.skip
- Names of objects in the file to skip.
java.io.IOException
Method Detail |
---|
protected void mm_read_banner(java.util.Scanner s, MMobject matrix, MMfile.VERSION force_compatibility, boolean main) throws java.io.IOException
s
- A handle to the scanner reading the input filematrix
- Where to store the matrixforce_compatibility
- Used to force a certain MatrixMarket version, null will infer from file.main
- If this is the main object read in
java.io.IOException
protected void mm_read_mtx_crd_size(java.util.Scanner s, MMobject matrix)
s
- Handle to the file scannermatrix
- Where to store the matrix dataprotected void mm_read_mtx_crd_entry(java.util.Scanner s, int at, MMobject matrix) throws java.io.IOException
s
- Handle to the file scannerat
- Which nonzero number is being read inmatrix
- Handle to where to store the matrix
java.io.IOException
protected void mm_read_mtx_pstart_entry(java.util.Scanner s, int i, MMobject matrix)
s
- Handle to the file scanneri
- Current element nr. being processedmatrix
- Where to store the matrixprotected boolean mm_read_object(java.util.Scanner s, boolean first, java.util.Collection<java.lang.String> skip) throws java.io.IOException
s
- Handle to the file scannerfirst
- If this is the first object to be read inskip
- Collection of object names to skip reading in
java.io.IOException
public java.lang.String getFilename()
public boolean isSuccessfully_read()
public MMfile.VERSION getVersion()
public MMobject getFileObject(java.lang.String name)
name
- Object name to search for.
public java.util.ArrayList<MMobject> getFileObjects()
public MMobject getFileObject()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |