Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal > Class Template Reference

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 > &params)
 Constructor that takes a ParameterList of parameters. More...
 
void setParameters (const RCP< ParameterList > &params)
 Set parameters from the given ParameterList. More...
 
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...
 

Detailed Description

template<class Scalar, class Ordinal>
class Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >

Tool for debugging the syntax of a Matrix Market file containing a sparse matrix.

Template Parameters
ScalarThe type of entries of the sparse matrix.
OrdinalThe 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 68 of file Teuchos_MatrixMarket_Raw_Checker.hpp.

Constructor & Destructor Documentation

template<class Scalar , class Ordinal >
Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >::Checker ( const bool  echo,
const bool  tolerant,
const bool  debug 
)
inline

Constructor that takes Boolean parameters.

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 79 of file Teuchos_MatrixMarket_Raw_Checker.hpp.

template<class Scalar , class Ordinal >
Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >::Checker ( )
inline

Constructor that sets default Boolean parameters.

Definition at line 84 of file Teuchos_MatrixMarket_Raw_Checker.hpp.

template<class Scalar , class Ordinal >
Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >::Checker ( const RCP< ParameterList > &  params)
inline

Constructor that takes a ParameterList of parameters.

Parameters (all of them have type bool, all default to false):

  • "Echo to stdout": Whether to echo the sparse matrix to stdout on MPI Process 0, after reading the sparse matrix.
  • "Parse tolerantly": Whether to parse Matrix Market files tolerantly.
  • "Debug mode" 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 98 of file Teuchos_MatrixMarket_Raw_Checker.hpp.

Member Function Documentation

template<class Scalar , class Ordinal >
void Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >::setParameters ( const RCP< ParameterList > &  params)
inline

Set parameters from the given ParameterList.

See constructor documentation for the accepted parameters.

Definition at line 108 of file Teuchos_MatrixMarket_Raw_Checker.hpp.

template<class Scalar , class Ordinal >
bool Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >::readFile ( const Teuchos::Comm< int > &  comm,
const std::string &  filename 
)
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.

Note
This whole "raw" reader is meant for debugging and diagnostics of syntax errors in the Matrix Market file; it's not performance-oriented. That's why we do all the broadcasts of and checks for "success".

Definition at line 158 of file Teuchos_MatrixMarket_Raw_Checker.hpp.

template<class Scalar , class Ordinal >
bool Teuchos::MatrixMarket::Raw::Checker< Scalar, Ordinal >::read ( const Teuchos::Comm< int > &  comm,
const RCP< std::istream > &  in 
)
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.

Note
This whole "raw" reader is meant for debugging and diagnostics of syntax errors in the Matrix Market file; it's not performance-oriented. That's why we do all the broadcasts of and checks for "success".

Definition at line 208 of file Teuchos_MatrixMarket_Raw_Checker.hpp.


The documentation for this class was generated from the following file: