Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Functions
Teuchos::MatrixMarket Namespace Reference

Namespaces

 details
 
 Raw
 

Classes

class  Banner
 Parse a Matrix Market banner line. More...
 
class  CoordDataReaderBase
 Common functionality of a coordinate-format sparse matrix or graph data reader. More...
 
class  CoordDataReader
 Coordinate-format sparse matrix data reader. More...
 
class  CoordDataReader< Callback, Ordinal, Scalar, false >
 
class  CoordPatternReader
 Coordinate-format sparse graph data reader. More...
 
class  SymmetrizingAdder
 Adds entries with optional symmetry to a sparse matrix. More...
 
class  SymmetrizingGraphAdder
 Adds entries with optional symmetry to a sparse graph. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const Banner &banner)
 
int maxLineLength ()
 Maximum line length for a Matrix Market file. More...
 
bool checkCommentLine (const std::string &line, size_t &start, size_t &size, const size_t lineNumber, const bool tolerant, const bool maybeBannerLine=false)
 True if the line is a comment line, false otherwise. More...
 
template<class Ordinal >
bool readPatternData (std::istream &istr, Ordinal &rowIndex, Ordinal &colIndex, const size_t lineNumber, const bool tolerant)
 
template<class Ordinal , class Real >
bool readRealData (std::istream &istr, Ordinal &rowIndex, Ordinal &colIndex, Real &realValue, const size_t lineNumber, const bool tolerant)
 
template<class Ordinal >
bool readPatternLine (const std::string &line, Ordinal &rowIndex, Ordinal &colIndex, const size_t lineNumber, const bool tolerant)
 
template<class Ordinal , class Real >
bool readRealLine (const std::string &line, Ordinal &rowIndex, Ordinal &colIndex, Real &realValue, const size_t lineNumber, const bool tolerant)
 
template<class Ordinal , class PatternCallback >
std::pair< bool, std::vector
< size_t > > 
readPatternCoordinateData (std::istream &in, PatternCallback add, const size_t startingLineNumber, const bool tolerant)
 
template<class Ordinal >
bool readCoordinateDimensions (std::istream &in, Ordinal &numRows, Ordinal &numCols, Ordinal &numNonzeros, size_t &lineNumber, const bool tolerant)
 

Function Documentation

TEUCHOSNUMERICS_LIB_DLL_EXPORT std::ostream & Teuchos::MatrixMarket::operator<< ( std::ostream &  out,
const Banner &  banner 
)

Print out the "banner" of the Matrix Market file

This function may be used to generate Matrix Market output files, since it prints the banner (first line of the Matrix Market file) in the canonical format. However, we don't promise that it prints out in exactly the same format in which it was read in, especially (but not only) if it was read in "tolerant" mode.

Note
We don't print the endline at the end of the banner line.
Parameters
out[out] The output stream to which to print
banner[in] The Matrix Market banner to print
Returns
The output stream out

Definition at line 268 of file Teuchos_MatrixMarket_Banner.cpp.

int Teuchos::MatrixMarket::maxLineLength ( )

Maximum line length for a Matrix Market file.

Matrix Market files are only allowed to have this many ASCII characters per line. In "tolerant" parsing mode, this restriction is relaxed.

Definition at line 49 of file Teuchos_MatrixMarket_generic.cpp.

TEUCHOSNUMERICS_LIB_DLL_EXPORT bool Teuchos::MatrixMarket::checkCommentLine ( const std::string &  line,
size_t &  start,
size_t &  size,
const size_t  lineNumber,
const bool  tolerant,
const bool  maybeBannerLine = false 
)

True if the line is a comment line, false otherwise.

If this function returns false, then line.substr(start,size) is a string containing valid, possibly noncomment data. (The value of size could be std::string::npos, indicating that there is no comment character in the line. In that case, the substr() call with size==npos does the right thing.)

In tolerant mode, empty or whitespace-only lines are considered comment lines.

Parameters
line[in] The line of text to process.
start[out] Starting index of valid data in the line.
size[out] Starting index of the first comment character in the line, or std::string::npos if there is none.
lineNumber[in] The current line number in the Matrix Market file. Used to generate exception messages in case of banner syntax errors.
tolerant[in] Whether to tolerant syntax errors in the banner line. If a syntax error is detected, this function will try its best to extract useful information, but it may not be correct.
maybeBannerLine[in] Whether the line may potentially be a Matrix Market banner line. These start with "%%MatrixMarket", and since "%" is also a comment character, we have to handle them specially.
Returns
True if the line is a comment line, else false.

Definition at line 52 of file Teuchos_MatrixMarket_generic.cpp.

template<class Ordinal >
bool Teuchos::MatrixMarket::readPatternData ( std::istream &  istr,
Ordinal &  rowIndex,
Ordinal &  colIndex,
const size_t  lineNumber,
const bool  tolerant 
)

Definition at line 136 of file Teuchos_MatrixMarket_generic.hpp.

template<class Ordinal , class Real >
bool Teuchos::MatrixMarket::readRealData ( std::istream &  istr,
Ordinal &  rowIndex,
Ordinal &  colIndex,
Real realValue,
const size_t  lineNumber,
const bool  tolerant 
)

Definition at line 235 of file Teuchos_MatrixMarket_generic.hpp.

template<class Ordinal >
bool Teuchos::MatrixMarket::readPatternLine ( const std::string &  line,
Ordinal &  rowIndex,
Ordinal &  colIndex,
const size_t  lineNumber,
const bool  tolerant 
)

Definition at line 389 of file Teuchos_MatrixMarket_generic.hpp.

template<class Ordinal , class Real >
bool Teuchos::MatrixMarket::readRealLine ( const std::string &  line,
Ordinal &  rowIndex,
Ordinal &  colIndex,
Real realValue,
const size_t  lineNumber,
const bool  tolerant 
)

Definition at line 402 of file Teuchos_MatrixMarket_generic.hpp.

template<class Ordinal , class PatternCallback >
std::pair<bool, std::vector<size_t> > Teuchos::MatrixMarket::readPatternCoordinateData ( std::istream &  in,
PatternCallback  add,
const size_t  startingLineNumber,
const bool  tolerant 
)

Definition at line 473 of file Teuchos_MatrixMarket_generic.hpp.

template<class Ordinal >
bool Teuchos::MatrixMarket::readCoordinateDimensions ( std::istream &  in,
Ordinal &  numRows,
Ordinal &  numCols,
Ordinal &  numNonzeros,
size_t &  lineNumber,
const bool  tolerant 
)

Definition at line 516 of file Teuchos_MatrixMarket_generic.hpp.