Teuchos - Trilinos Tools Package
Version of the Day
|
Read a sparse matrix from a Matrix Market file into raw CSR (compressed sparse row) storage. More...
#include <Teuchos_MatrixMarket_Raw_Reader.hpp>
Public Member Functions | |
Reader (const bool tolerant, const bool debug) | |
Constructor that takes Boolean parameters. More... | |
Reader () | |
Constructor that sets default Boolean parameters. More... | |
Reader (const RCP< ParameterList > ¶ms) | |
Constructor that takes a ParameterList of parameters. More... | |
void | setParameters (const RCP< ParameterList > ¶ms) |
Set parameters from the given ParameterList. More... | |
RCP< const ParameterList > | getValidParameters () const |
Get a list of valid default parameters, with documentation. More... | |
bool | readFile (ArrayRCP< Ordinal > &rowptr, ArrayRCP< Ordinal > &colind, ArrayRCP< Scalar > &values, Ordinal &numRows, Ordinal &numCols, const std::string &filename) |
Read the sparse matrix from the given file into CSR storage. More... | |
bool | read (ArrayRCP< Ordinal > &rowptr, ArrayRCP< Ordinal > &colind, ArrayRCP< Scalar > &values, Ordinal &numRows, Ordinal &numCols, std::istream &in) |
Read the sparse matrix from the given input stream into CSR storage. More... | |
Read a sparse matrix from a Matrix Market file into raw CSR (compressed sparse row) storage.
Scalar | The type of entries of the sparse matrix. |
Ordinal | The type of indices of the sparse matrix. |
This class is useful for benchmarking local sparse kernels. It should only be called by one MPI process at a time and is not aware of parallel communication. Use Tpetra::MatrixMarket::Reader if you want to read a Tpetra::CrsMatrix from a Matrix Market file.
Definition at line 69 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Constructor that takes Boolean parameters.
tolerant | [in] Whether to parse the Matrix Market files tolerantly. |
debug | [in] Whether to print (possibly copious) debugging output to stderr. |
Definition at line 77 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Constructor that sets default Boolean parameters.
Definition at line 84 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Constructor that takes a ParameterList of parameters.
Parameters (all of them have type bool, all default to false):
Definition at line 97 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Set parameters from the given ParameterList.
See constructor documentation for the accepted parameters.
Definition at line 108 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Get a list of valid default parameters, with documentation.
Definition at line 126 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Read the sparse matrix from the given file into CSR storage.
The outputs rowptr, colind, values together form the common three-arrays representation of compressed sparse row (CSR) storage.
rowptr | [out] Array of numRows+1 offsets, where numRows is the number of rows in the sparse matrix. For row i (zero-based indexing), the entries of that row are in indices rowptr[i] .. rowptr[i+1]-1 of colind and values. |
colind | [out] Column indices of the matrix. Same number of entries as values. colind[k] is the column index of values[k]. |
values | [out] Values stored in the matrix. |
numRows | [out] Number of rows in the sparse matrix. This is redundant, because rowptr.size() == numRows on output. |
numCols | [out] Number of columns in the sparse matrix. |
filename | [in] Name of the Matrix Market file from which to read the sparse matrix. |
Definition at line 168 of file Teuchos_MatrixMarket_Raw_Reader.hpp.
|
inline |
Read the sparse matrix from the given input stream into CSR storage.
The outputs rowptr, colind, values together form the common three-arrays representation of compressed sparse row (CSR) storage.
rowptr | [out] Array of numRows+1 offsets, where numRows is the number of rows in the sparse matrix. For row i (zero-based indexing), the entries of that row are in indices rowptr[i] .. rowptr[i+1]-1 of colind and values. |
colind | [out] Column indices of the matrix. Same number of entries as values. colind[k] is the column index of values[k]. |
values | [out] Values stored in the matrix. |
numRows | [out] Number of rows in the sparse matrix. This is redundant, because rowptr.size() == numRows on output. |
numCols | [out] Number of columns in the sparse matrix. |
in | [in/out] Input stream from which to read the sparse matrix. |
Definition at line 208 of file Teuchos_MatrixMarket_Raw_Reader.hpp.