|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.Matrix
vec_math.FileMatrix
public class FileMatrix
A class to convert an ascii file consisting of blocked data into a
matrix consisting of doubles. Any line starting with '#' is
ignored. Lines whose element number do not match the number of the
first read valid line are ignored. Although the class name
indicates that this class is mainly inended for reading a file, it
is nevertheless possible to use it also with other readers, see the
appropriate constructor section, FileMatrix(Reader).
Note that this may be an expensive class. Especially evaluating the
columns doubles the amount of storage space needed.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class vec_math.Matrix |
|---|
Matrix.CloneTest |
| Field Summary |
|---|
| Fields inherited from class vec_math.Matrix |
|---|
colValid, rowValid |
| Constructor Summary | |
|---|---|
FileMatrix(File infile)
Constructs a new matrix from a ascii-file. |
|
FileMatrix(Reader file)
Constructs a new matrix from a reader stream. |
|
| Method Summary | |
|---|---|
static void |
main(String[] arg)
Test purpose. |
static void |
setFormat(NumberFormat use)
Changes the decimal format to use when outputting the matrix data to a block data file. |
void |
toFile(File outfile)
Writes the entire matrix data into a output file. |
static void |
toFile(File outfile,
Matrix m)
Writes the entire matrix data into a output file. |
protected static void |
toStream(Writer output,
Matrix m)
Writes the entire data into the given reader. |
| Methods inherited from class vec_math.Matrix |
|---|
clone, columns, equals, evalCol, evalRow, exchangeCol, exchangeRow, getColumn, getElement, getRawColumn, getRawRow, getRow, mult, mult, multOneCol, multOneRow, rows, setCols, setElement, setOneCol, setOneRow, setRows, toString, transpose |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileMatrix(File infile)
throws IOException
IOException
public FileMatrix(Reader file)
throws IOException
LineVector class. Lines
starting with '#' are ignored. Lines whose element count does not match
the number of elements read in from the first valid line are ignored.
IOException| Method Detail |
|---|
public static void setFormat(NumberFormat use)
LineVector.setFormat(java.text.NumberFormat) method.
public void toFile(File outfile)
throws IOException
LineVector.setFormat(java.text.NumberFormat) or with this class's setFormat(java.text.NumberFormat)
method.toStream(java.io.Writer, vec_math.Matrix) method instead.
IOException
public static void toFile(File outfile,
Matrix m)
throws IOException
LineVector.setFormat(java.text.NumberFormat) or with this class's setFormat(java.text.NumberFormat)
method.toStream(java.io.Writer, vec_math.Matrix) method instead.
IOException
protected static void toStream(Writer output,
Matrix m)
throws IOException
toFile(java.io.File).
IOException
public static void main(String[] arg)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||