Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Teuchos::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, false > Class Template Reference

#include <Teuchos_MatrixMarket_CoordDataReader.hpp>

Inheritance diagram for Teuchos::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, false >:
Inheritance graph
[legend]

Public Member Functions

 CoordDataReader (const Teuchos::RCP< Callback > &adder)
 
 CoordDataReader ()
 
virtual ~CoordDataReader ()
 
- Public Member Functions inherited from Teuchos::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >
 CoordDataReaderBase (const Teuchos::RCP< Callback > &adder)
 Constructor with "adder" argument.
 
 CoordDataReaderBase ()
 No-argument constructor.
 
virtual ~CoordDataReaderBase ()
 Virtual destructor for safety and happy compilers.
 
void setAdder (const Teuchos::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< Teuchos::Tuple< Ordinal, 3 >, boolreadDimensions (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.
 

Additional Inherited Members

- Protected Attributes inherited from Teuchos::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >
Teuchos::RCP< Callbackadder_
 Closure that knows how to add entries to the sparse graph or matrix.
 

Detailed Description

template<class Callback, class Ordinal, class Scalar>
class Teuchos::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, false >

Definition at line 550 of file Teuchos_MatrixMarket_CoordDataReader.hpp.

Constructor & Destructor Documentation

◆ CoordDataReader() [1/2]

template<class Callback , class Ordinal , class Scalar >
Teuchos::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, false >::CoordDataReader ( const Teuchos::RCP< Callback > & adder)
inline

Definition at line 553 of file Teuchos_MatrixMarket_CoordDataReader.hpp.

◆ CoordDataReader() [2/2]

template<class Callback , class Ordinal , class Scalar >
Teuchos::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, false >::CoordDataReader ( )
inline

Definition at line 557 of file Teuchos_MatrixMarket_CoordDataReader.hpp.

◆ ~CoordDataReader()

Definition at line 561 of file Teuchos_MatrixMarket_CoordDataReader.hpp.

Member Function Documentation

◆ readLine()

template<class Callback , class Ordinal , class Scalar >
bool Teuchos::MatrixMarket::CoordDataReader< Callback, Ordinal, Scalar, false >::readLine ( const std::string & theLine,
const size_t lineNumber,
const bool tolerant )
inlineprotectedvirtual

Read in the data from a single line of the input stream.

Parameters
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.
Returns
In tolerant parsing mode (tolerant==true), then this method returns true if parsing the current line succeeded, else false. Otherwise, this method throws an exception (and does not invoke the adder) if parsing the current line did not succeed.

Subclasses must implement this method in order to read one entry of the sparse graph or matrix. Implementations should use the callback (adder_) to add the entry.

Note
To implementers: We defer implementation of this method to subclasses, because the callback for a graph will take different arguments than the callback for a matrix. Abstracting around that using templates isn't worth the trouble. (Remember you're reading from a file and parsing strings. Virtual method call overhead isn't significant by comparison.)

Implements Teuchos::MatrixMarket::CoordDataReaderBase< Callback, Ordinal >.

Definition at line 565 of file Teuchos_MatrixMarket_CoordDataReader.hpp.


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