|
Tpetra Matrix/Vector Services Version of the Day
|
Coordinate-format sparse matrix data reader. More...
#include <MatrixMarket_CoordDataReader.hpp>

Public Member Functions | |
| virtual | ~CoordDataReader () |
| Virtual destructor for safety and happy compilers. | |
| void | setAdder (const RCP< Callback > &adder) |
| Set the Adder object. | |
| virtual std::pair< bool, std::vector< size_t > > | read (std::istream &in, const size_t startingLineNumber, const bool tolerant, const bool debug=false) |
| Read in all the data from the given input stream. | |
| std::pair< Tuple< Ordinal, 3 > , bool > | readDimensions (std::istream &in, size_t &lineNumber, const bool tolerant=false) |
| Read (numRows, numCols, numNonzeros). | |
Protected Member Functions | |
| bool | readLine (const std::string &theLine, const size_t lineNumber, const bool tolerant) |
| Read in the data from a single line of the input stream. | |
Protected Attributes | |
| RCP< Callback > | adder_ |
| Closure that knows how to add entries to the sparse graph or matrix. | |
Coordinate-format sparse matrix data reader.
This class completes the implementation of CoordDataReaderBase for sparse matrices. There are two concrete specializations: one for real-valued data, and the other for complex-valued data.
Definition at line 399 of file MatrixMarket_CoordDataReader.hpp.
| virtual Tpetra::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, isComplex >::~CoordDataReader | ( | ) | [virtual] |
Virtual destructor for safety and happy compilers.
| bool Tpetra::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, isComplex >::readLine | ( | const std::string & | theLine, |
| const size_t | lineNumber, | ||
| const bool | tolerant | ||
| ) | [protected, virtual] |
Read in the data from a single line of the input stream.
| theLine | [in] The line read in from the input stream. |
| adder | [in/out] The callback to invoke for adding an entry to the sparse matrix. |
| lineNumber | [in] Current line number of the file. We use this for generating informative exception messages. |
| tolerant | [in] Whether to parse tolerantly. |
adder_) in your implementations of this method to add entries to the sparse graph or matrix.Implements Tpetra::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >.
| void Tpetra::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >::setAdder | ( | const RCP< Callback > & | adder | ) | [inline, inherited] |
Set the Adder object.
Please don't call this after calling read() or readLine(). The right time to call this is right after calling the no-argument constructor, if it's not possible to supply an Adder object before calling readDimensions().
Definition at line 100 of file MatrixMarket_CoordDataReader.hpp.
| virtual std::pair<bool, std::vector<size_t> > Tpetra::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >::read | ( | std::istream & | in, |
| const size_t | startingLineNumber, | ||
| const bool | tolerant, | ||
| const bool | debug = false |
||
| ) | [inline, virtual, inherited] |
Read in all the data from the given input stream.
| in | [in/out] The input stream from which to read |
| startingLineNumber | [in] The line number of the file from which we begin reading. (This is used for informative error output, if an error is detected in the file.) |
| tolerant | [in] If true, parse tolerantly. The resulting read-in data may be incorrect, but the parser won't throw an exception if it can just let bad data through and continue. |
| debug | [in] If true, print verbose debugging output. |
Definition at line 167 of file MatrixMarket_CoordDataReader.hpp.
| std::pair<Tuple<Ordinal, 3>, bool> Tpetra::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >::readDimensions | ( | std::istream & | in, |
| size_t & | lineNumber, | ||
| const bool | tolerant = false |
||
| ) | [inline, inherited] |
Read (numRows, numCols, numNonzeros).
Read one line from the given input stream, and parse it into the number of rows, the number of columns, and the number of nonzeros in the sparse matrix. We assume that those data are in whitespace-delimited format and are read from a Matrix Market - format file.
| in | [in/out] The input stream from which to attempt to read one line. |
| lineNumber | The starting line number from which we begin reading from the input stream. Used for diagnostic error output. |
| tolerant | [in] Whether to read "tolerantly" (setting defaults and returning whether we were successful) or "intolerantly" (throwing an exception on any deviation from the expected format). |
Definition at line 227 of file MatrixMarket_CoordDataReader.hpp.
RCP<Callback> Tpetra::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >::adder_ [protected, inherited] |
Closure that knows how to add entries to the sparse graph or matrix.
Definition at line 66 of file MatrixMarket_CoordDataReader.hpp.
1.7.4