Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Tool for debugging the syntax of a Matrix Market file containing a sparse matrix. More...
#include <Teuchos_MatrixMarket_Raw_Checker.hpp>
Public Member Functions | |
Checker (const bool echo, const bool tolerant, const bool debug) | |
Constructor that takes Boolean parameters. More... | |
Checker () | |
Constructor that sets default Boolean parameters. More... | |
Checker (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 |
bool | readFile (const Teuchos::Comm< int > &comm, const std::string &filename) |
Read the sparse matrix from the given file. More... | |
bool | read (const Teuchos::Comm< int > &comm, const RCP< std::istream > &in) |
Read the sparse matrix from the given input stream. More... | |
Private Member Functions | |
RCP< const Teuchos::MatrixMarket::Banner > | readBanner (std::istream &in, size_t &lineNumber) |
Read in the Banner line from the given input stream. More... | |
std::pair< bool, std::string > | readOnRank0 (std::istream &in) |
Read the sparse matrix on MPI Rank 0. More... | |
void | reportBadness (std::ostream &out, const std::pair< bool, std::vector< size_t > > &results) |
To be called only on MPI Rank 0. More... | |
Private Attributes | |
bool | echo_ |
Whether to echo the sparse matrix to stdout after reading it. More... | |
bool | tolerant_ |
Whether to parse the Matrix Market file tolerantly. More... | |
bool | debug_ |
Whether to print debugging output to stderr. More... | |
Tool for debugging the syntax of a Matrix Market file containing a sparse matrix.
Scalar | The type of entries of the sparse matrix. |
Ordinal | The type of indices of the sparse matrix. |
This class is useful for checking the integrity of a Matrix Market sparse matrix file and printing its contents. For reading a sparse matrix from a Matrix Market file into raw compressed sparse row (CSR) arrays on a single (MPI) process, use the Reader class. For reading in a Tpetra::CrsMatrix, use the Tpetra::MatrixMarket::Reader class.
Definition at line 36 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Constructor that takes Boolean parameters.
echo | [in] Whether to echo the sparse matrix to stdout on MPI Process 0, after reading the sparse matrix. |
tolerant | [in] Whether to parse the Matrix Market files tolerantly. |
debug | [in] Whether to print debugging output to stderr. This will happen on all MPI processes, so it could be a lot of output. |
Definition at line 47 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Constructor that sets default Boolean parameters.
Definition at line 52 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Constructor that takes a ParameterList of parameters.
Parameters (all of them have type bool, all default to false):
Definition at line 66 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Set parameters from the given ParameterList.
See constructor documentation for the accepted parameters.
Definition at line 76 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Definition at line 96 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Read the sparse matrix from the given file.
This is a collective operation. Only MPI Process 0 opens the file and reads data from it, but all ranks participate and wait for the final result.
Definition at line 126 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inline |
Read the sparse matrix from the given input stream.
This is a collective operation. Only MPI Process 0 reads from the given input stream, but all MPI processes participate and wait for the final result.
Definition at line 176 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inlineprivate |
Read in the Banner line from the given input stream.
in | [in/out] Input stream from which to read the Banner line. This must be valid on the calling process. |
lineNumber | [in/out] On input: Current line number of the input stream. On output: if any line(s) were successfully read from the input stream, this is incremented by the number of line(s) read. (This includes comment lines.) |
Definition at line 270 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inlineprivate |
Read the sparse matrix on MPI Rank 0.
in | [in/out] The input stream from which to read. This must be valid on the calling process. |
Definition at line 333 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
inlineprivate |
To be called only on MPI Rank 0.
Definition at line 477 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
private |
Whether to echo the sparse matrix to stdout after reading it.
Definition at line 249 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
private |
Whether to parse the Matrix Market file tolerantly.
Definition at line 251 of file Teuchos_MatrixMarket_Raw_Checker.hpp.
|
private |
Whether to print debugging output to stderr.
Definition at line 253 of file Teuchos_MatrixMarket_Raw_Checker.hpp.