Teuchos - Trilinos Tools Package
Version of the Day
|
Write a sparse matrix from raw CSR (compressed sparse row) storage to a Matrix Market file. More...
#include <Teuchos_MatrixMarket_Raw_Writer.hpp>
Public Member Functions | |
void | writeFile (const std::string &filename, const ArrayView< const OrdinalType > &rowptr, const ArrayView< const OrdinalType > &colind, const ArrayView< const ScalarType > &values, const OrdinalType numRows, const OrdinalType numCols) |
Write the sparse matrix to the given file. More... | |
void | write (std::ostream &out, const ArrayView< const OrdinalType > &rowptr, const ArrayView< const OrdinalType > &colind, const ArrayView< const ScalarType > &values, const OrdinalType numRows, const OrdinalType numCols) |
Write the sparse matrix to the given output stream. More... | |
Write a sparse matrix from raw CSR (compressed sparse row) storage to a Matrix Market file.
ScalarType | The type of entries of the sparse matrix. |
OrdinalType | The type of indices of the sparse matrix. |
This class is useful for testing local sparse kernels. It should only be called by one MPI process at a time and is not aware of parallel communication. Use Tpetra::MatrixMarket::Writer if you want to write a Tpetra::CrsMatrix to a Matrix Market file.
Definition at line 67 of file Teuchos_MatrixMarket_Raw_Writer.hpp.
|
inline |
Write the sparse matrix to the given file.
The input arrays rowptr, colind, values together form the common three-arrays representation of compressed sparse row (CSR) storage.
filename | [in] Name of the Matrix Market file to which to write the sparse matrix. |
rowptr | [in] Array of numRows+1 offsets, where numRows is the number of rows in the sparse matrix. For row i (zero-based indexing), the entries of that row are in indices rowptr[i] .. rowptr[i+1]-1 of colind and values. |
colind | [in] Column indices of the matrix. Same number of entries as values. colind[k] is the column index of values[k]. |
values | [in] Values stored in the matrix. |
numRows | [in] Number of rows in the sparse matrix. This is redundant, because rowptr.size() == numRows on output. |
numCols | [in] Number of columns in the sparse matrix. |
Definition at line 91 of file Teuchos_MatrixMarket_Raw_Writer.hpp.
|
inline |
Write the sparse matrix to the given output stream.
The input arrays rowptr, colind, values together form the common three-arrays representation of compressed sparse row (CSR) storage.
out | [in/out] Output stream to which to write the sparse matrix. |
rowptr | [in] Array of numRows+1 offsets, where numRows is the number of rows in the sparse matrix. For row i (zero-based indexing), the entries of that row are in indices rowptr[i] .. rowptr[i+1]-1 of colind and values. |
colind | [in] Column indices of the matrix. Same number of entries as values. colind[k] is the column index of values[k]. |
values | [in] Values stored in the matrix. |
numRows | [in] Number of rows in the sparse matrix. This is redundant, because rowptr.size() == numRows on output. |
numCols | [in] Number of columns in the sparse matrix. |
Definition at line 130 of file Teuchos_MatrixMarket_Raw_Writer.hpp.