public class SparseMatrixEx2 extends Object
SparseMatrix Example 2: Converts a matrix in market format to a sparse matrix format.
The matrix market exchange format is an ASCII file format that represents sparse matrices in coordinate format. It consists of three sections: The header section is the first line in the file and contains general information about the matrix, e.g. data type and symmetry properties. This line is followed by the comments section which consists of zero or more lines of comments. The remainder of the file is the data section. The first line of the data section contains the row number, column number, and number of nonzeros of the matrix. The following lines contain the location and value of all nonzero entries of the matrix, usually one per line. A file in Matrix Market format is read and converted to a JMSL SparseMatrix in this example. Matrix information and the one norm of the matrix are printed.Modifier and Type | Class and Description |
---|---|
static class |
SparseMatrixEx2.MTXReader
Reads a file containing Market format data.
|
Constructor and Description |
---|
SparseMatrixEx2() |
Copyright © 2020 Rogue Wave Software. All rights reserved.