Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Teuchos::MatrixMarket::Banner Class Reference

Parse a Matrix Market banner line. More...

#include <Teuchos_MatrixMarket_Banner.hpp>

Public Member Functions

 Banner (const std::string &line, const bool tolerant=false)
 
const std::string & objectType () const
 The object type. More...
 
const std::string & matrixType () const
 Storage type of the matrix. More...
 
const std::string & dataType () const
 Data type of matrix entries. More...
 
const std::string & symmType () const
 Symmetric storage type. More...
 

Private Member Functions

void setDefaults (const int howMany)
 Set the last howMany member data to default values. More...
 

Static Private Member Functions

static std::string validateObjectType (const std::string &objectType, const bool tolerant=false)
 
static std::string validateMatrixType (const std::string &matrixType, const bool tolerant=false)
 
static std::string validateDataType (const std::string &dataType, const bool tolerant=false)
 
static std::string validateSymmType (const std::string &symmType, const bool tolerant=false)
 

Private Attributes

std::string objectType_
 
std::string matrixType_
 
std::string dataType_
 
std::string symmType_
 

Detailed Description

Parse a Matrix Market banner line.

Author
Mark Hoemmen The "Matrix Market" (NIST) defines a standard human-readable ASCII file format of the same name. Matrix Market files may store dense or sparse matrices, with entries of types real, complex, integer, or pattern (no values, just the graph).

The first line of a Matrix Market - format file, the "banner line," contains information for interpreting the rest of the file. This class parses the first line, canonicalizes the information therein, and stores it for later use.

Definition at line 35 of file Teuchos_MatrixMarket_Banner.hpp.

Constructor & Destructor Documentation

Teuchos::MatrixMarket::Banner::Banner ( const std::string &  line,
const bool  tolerant = false 
)

Constructor

Parameters
line[in] The banner line to parse
tolerant[in] Whether to parse tolerantly. If false, we adhere strictly to the Matrix Market standard. If true, we allow all kinds of divergence therefrom (including an entirely empty banner line, for which we fill in some sensible defaults).

Definition at line 122 of file Teuchos_MatrixMarket_Banner.cpp.

Member Function Documentation

const std::string& Teuchos::MatrixMarket::Banner::objectType ( ) const
inline

The object type.

The Matrix Market format specifies the "type of object" stored in the file. In the current version of the standard, the object type is always "matrix" (without the quotes). The standard leaves open the possibility of other types in future versions of the standard.

Definition at line 54 of file Teuchos_MatrixMarket_Banner.hpp.

const std::string& Teuchos::MatrixMarket::Banner::matrixType ( ) const
inline

Storage type of the matrix.

"coordinate" means a sparse matrix, stored as (i,j,Aij) triples with one-based indices i and j. "array" means a dense matrix, stored in column-major order with one entry per line.

Definition at line 61 of file Teuchos_MatrixMarket_Banner.hpp.

const std::string& Teuchos::MatrixMarket::Banner::dataType ( ) const
inline

Data type of matrix entries.

Data type of the matrix entries: "real", "complex", "integer", or "pattern".

Definition at line 67 of file Teuchos_MatrixMarket_Banner.hpp.

const std::string& Teuchos::MatrixMarket::Banner::symmType ( ) const
inline

Symmetric storage type.

Describes whether and how symmetry is exploited when storing the matrix. "general" means nonsymmetric: all the matrix entries are stored. "symmetric", "skew-symmetric", and "hermitian" have their usual mathematical meaning, and also mean that only the upper or lower triangle (including the diagonal) of the matrix is stored. There's no way to tell from the banner whether the upper or lower triangle is stored; you have to examine the matrix entries.

Note
An error condition is possible for sparse matrices (matrixType() == "coordinate"): If only the upper or lower triangle is supposed to be there, and entries from both the upper and lower triangle are stored, the resulting matrix is undefined. Users of this class may choose to interpret this case as they wish. Besides simply reporting an error, one reasonable possibility is to treat every A(i,j) value as an indication to add that value (or its conjugate in the Hermitian case, or its negative in the skew-symmetric case) to the current value of A(j,i).

Definition at line 90 of file Teuchos_MatrixMarket_Banner.hpp.

std::string Teuchos::MatrixMarket::Banner::validateObjectType ( const std::string &  objectType,
const bool  tolerant = false 
)
staticprivate

Definition at line 26 of file Teuchos_MatrixMarket_Banner.cpp.

std::string Teuchos::MatrixMarket::Banner::validateMatrixType ( const std::string &  matrixType,
const bool  tolerant = false 
)
staticprivate

Definition at line 46 of file Teuchos_MatrixMarket_Banner.cpp.

std::string Teuchos::MatrixMarket::Banner::validateDataType ( const std::string &  dataType,
const bool  tolerant = false 
)
staticprivate

Definition at line 60 of file Teuchos_MatrixMarket_Banner.cpp.

std::string Teuchos::MatrixMarket::Banner::validateSymmType ( const std::string &  symmType,
const bool  tolerant = false 
)
staticprivate

Definition at line 74 of file Teuchos_MatrixMarket_Banner.cpp.

void Teuchos::MatrixMarket::Banner::setDefaults ( const int  howMany)
private

Set the last howMany member data to default values.

Definition at line 110 of file Teuchos_MatrixMarket_Banner.cpp.

Member Data Documentation

std::string Teuchos::MatrixMarket::Banner::objectType_
private

Definition at line 101 of file Teuchos_MatrixMarket_Banner.hpp.

std::string Teuchos::MatrixMarket::Banner::matrixType_
private

Definition at line 101 of file Teuchos_MatrixMarket_Banner.hpp.

std::string Teuchos::MatrixMarket::Banner::dataType_
private

Definition at line 101 of file Teuchos_MatrixMarket_Banner.hpp.

std::string Teuchos::MatrixMarket::Banner::symmType_
private

Definition at line 101 of file Teuchos_MatrixMarket_Banner.hpp.


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