10#ifndef __MatrixMarket_Tpetra_hpp
11#define __MatrixMarket_Tpetra_hpp
25#include "Tpetra_CrsMatrix.hpp"
26#include "Tpetra_Operator.hpp"
27#include "Tpetra_Vector.hpp"
29#include "Teuchos_MatrixMarket_Raw_Adder.hpp"
30#include "Teuchos_MatrixMarket_Raw_Graph_Adder.hpp"
31#include "Teuchos_MatrixMarket_SymmetrizingAdder.hpp"
32#include "Teuchos_MatrixMarket_SymmetrizingGraphAdder.hpp"
33#include "Teuchos_MatrixMarket_assignScalar.hpp"
34#include "Teuchos_MatrixMarket_Banner.hpp"
35#include "Teuchos_MatrixMarket_CoordDataReader.hpp"
36#include "Teuchos_SetScientific.hpp"
37#include "Teuchos_TimeMonitor.hpp"
40#include "mmio_Tpetra.h"
42#include "Tpetra_Distribution.hpp"
109template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
115 typedef Teuchos::RCP<sparse_matrix_type> sparse_matrix_ptr;
166 typedef Teuchos::ArrayRCP<int>::size_type size_type;
178 static Teuchos::RCP<const map_type>
209 static Teuchos::RCP<const map_type>
210 makeRowMap(
const Teuchos::RCP<const map_type>&
pRowMap,
228 static Teuchos::RCP<const map_type>
229 makeDomainMap(
const Teuchos::RCP<const map_type>&
pRangeMap,
307 Teuchos::ArrayRCP<size_t>&
myRowPtr,
308 Teuchos::ArrayRCP<global_ordinal_type>&
myColInd,
309 Teuchos::ArrayRCP<scalar_type>&
myValues,
310 const Teuchos::RCP<const map_type>&
pRowMap,
312 Teuchos::ArrayRCP<size_t>&
rowPtr,
313 Teuchos::ArrayRCP<global_ordinal_type>&
colInd,
314 Teuchos::ArrayRCP<scalar_type>&
values,
315 const bool debug =
false);
330 static Teuchos::RCP<sparse_matrix_type>
332 Teuchos::ArrayRCP<size_t>&
myRowPtr,
333 Teuchos::ArrayRCP<global_ordinal_type>&
myColInd,
334 Teuchos::ArrayRCP<scalar_type>&
myValues,
335 const Teuchos::RCP<const map_type>&
pRowMap,
336 const Teuchos::RCP<const map_type>&
pRangeMap,
337 const Teuchos::RCP<const map_type>&
pDomainMap,
345 static Teuchos::RCP<sparse_matrix_type>
347 Teuchos::ArrayRCP<size_t>&
myRowPtr,
348 Teuchos::ArrayRCP<global_ordinal_type>&
myColInd,
349 Teuchos::ArrayRCP<scalar_type>&
myValues,
350 const Teuchos::RCP<const map_type>&
pRowMap,
351 const Teuchos::RCP<const map_type>&
pRangeMap,
352 const Teuchos::RCP<const map_type>&
pDomainMap,
360 static Teuchos::RCP<sparse_matrix_type>
362 Teuchos::ArrayRCP<size_t>&
myRowPtr,
363 Teuchos::ArrayRCP<global_ordinal_type>&
myColInd,
364 Teuchos::ArrayRCP<scalar_type>&
myValues,
365 const Teuchos::RCP<const map_type>& rowMap,
366 Teuchos::RCP<const map_type>& colMap,
367 const Teuchos::RCP<const map_type>& domainMap,
368 const Teuchos::RCP<const map_type>&
rangeMap,
388 static Teuchos::RCP<const Teuchos::MatrixMarket::Banner>
389 readBanner(std::istream&
in,
417 static Teuchos::Tuple<global_ordinal_type, 3>
418 readCoordDims(std::istream&
in,
420 const Teuchos::RCP<const Teuchos::MatrixMarket::Banner>&
pBanner,
435 typedef Teuchos::MatrixMarket::SymmetrizingAdder<Teuchos::MatrixMarket::Raw::Adder<scalar_type, global_ordinal_type>> adder_type;
437 typedef Teuchos::MatrixMarket::SymmetrizingGraphAdder<Teuchos::MatrixMarket::Raw::GraphAdder<global_ordinal_type>> graph_adder_type;
464 static Teuchos::RCP<adder_type>
465 makeAdder(
const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
466 Teuchos::RCP<const Teuchos::MatrixMarket::Banner>&
pBanner,
467 const Teuchos::Tuple<global_ordinal_type, 3>&
dims,
469 const bool debug =
false);
496 static Teuchos::RCP<graph_adder_type>
497 makeGraphAdder(
const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
498 Teuchos::RCP<const Teuchos::MatrixMarket::Banner>&
pBanner,
499 const Teuchos::Tuple<global_ordinal_type, 3>&
dims,
501 const bool debug =
false);
504 static Teuchos::RCP<sparse_graph_type>
505 readSparseGraphHelper(std::istream&
in,
506 const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
507 const Teuchos::RCP<const map_type>& rowMap,
508 Teuchos::RCP<const map_type>& colMap,
537 static Teuchos::RCP<sparse_graph_type>
542 const bool debug =
false);
572 static Teuchos::RCP<sparse_graph_type>
574 const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
578 const bool debug =
false);
617 static Teuchos::RCP<sparse_graph_type>
619 const Teuchos::RCP<const map_type>& rowMap,
620 Teuchos::RCP<const map_type>& colMap,
621 const Teuchos::RCP<const map_type>& domainMap,
622 const Teuchos::RCP<const map_type>&
rangeMap,
625 const bool debug =
false);
652 static Teuchos::RCP<sparse_graph_type>
654 const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
657 const bool debug =
false);
688 static Teuchos::RCP<sparse_graph_type>
690 const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
694 const bool debug =
false);
736 static Teuchos::RCP<sparse_graph_type>
738 const Teuchos::RCP<const map_type>& rowMap,
739 Teuchos::RCP<const map_type>& colMap,
740 const Teuchos::RCP<const map_type>& domainMap,
741 const Teuchos::RCP<const map_type>&
rangeMap,
744 const bool debug =
false);
746#include "MatrixMarket_TpetraNew.hpp"
771 static Teuchos::RCP<sparse_matrix_type>
776 const bool debug =
false);
806 static Teuchos::RCP<sparse_matrix_type>
812 const bool debug =
false);
851 static Teuchos::RCP<sparse_matrix_type>
853 const Teuchos::RCP<const map_type>& rowMap,
854 Teuchos::RCP<const map_type>& colMap,
855 const Teuchos::RCP<const map_type>& domainMap,
856 const Teuchos::RCP<const map_type>&
rangeMap,
859 const bool debug =
false);
886 static Teuchos::RCP<sparse_matrix_type>
888 const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
891 const bool debug =
false);
921 static Teuchos::RCP<sparse_matrix_type>
923 const Teuchos::RCP<
const Teuchos::Comm<int>>&
pComm,
927 const bool debug =
false);
969 static Teuchos::RCP<sparse_matrix_type>
971 const Teuchos::RCP<const map_type>& rowMap,
972 Teuchos::RCP<const map_type>& colMap,
973 const Teuchos::RCP<const map_type>& domainMap,
974 const Teuchos::RCP<const map_type>&
rangeMap,
977 const bool debug =
false);
1008 static Teuchos::RCP<multivector_type>
1011 Teuchos::RCP<const map_type>&
map,
1013 const bool debug =
false,
1014 const bool binary =
false);
1029 std::ios_base::openmode
mode = std::ios_base::in);
1060 static Teuchos::RCP<vector_type>
1063 Teuchos::RCP<const map_type>&
map,
1065 const bool debug =
false);
1135 static Teuchos::RCP<multivector_type>
1138 Teuchos::RCP<const map_type>&
map,
1140 const bool debug =
false,
1141 const bool binary =
false);
1144 static Teuchos::RCP<vector_type>
1147 Teuchos::RCP<const map_type>&
map,
1149 const bool debug =
false);
1172 static Teuchos::RCP<const map_type>
1176 const bool debug =
false,
1177 const bool binary =
false);
1180 template <
class MultiVectorScalarType>
1185 readDenseImpl(std::istream&
in,
1187 Teuchos::RCP<const map_type>&
map,
1188 const Teuchos::RCP<Teuchos::FancyOStream>&
err,
1190 const bool debug =
false,
1191 const bool binary =
false);
1193 template <
class VectorScalarType>
1198 readVectorImpl(std::istream&
in,
1200 Teuchos::RCP<const map_type>&
map,
1201 const Teuchos::RCP<Teuchos::FancyOStream>&
err,
1203 const bool debug =
false);
1226 static Teuchos::RCP<const map_type>
1230 const bool debug =
false,
1231 const bool binary =
false);
1259 static Teuchos::RCP<const map_type>
1262 const Teuchos::RCP<Teuchos::FancyOStream>&
err,
1264 const bool debug =
false,
1265 const bool binary =
false);
1279 encodeDataType(
const std::string&
dataType);
1312 static Teuchos::RCP<sparse_matrix_type>
1315 const Teuchos::RCP<const map_type>& rowMap,
1316 Teuchos::RCP<const map_type>& colMap,
1317 const Teuchos::RCP<const map_type>& domainMap,
1318 const Teuchos::RCP<const map_type>&
rangeMap,
1322 const bool debug =
false);
1354template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1360 typedef Teuchos::RCP<sparse_matrix_type> sparse_matrix_ptr;
1428 const bool debug =
false);
1433 const Teuchos::RCP<const sparse_matrix_type>&
pMatrix,
1436 const bool debug =
false);
1460 const bool debug =
false);
1465 const Teuchos::RCP<const sparse_matrix_type>&
pMatrix,
1466 const bool debug =
false);
1503 const bool debug =
false);
1508 const Teuchos::RCP<const sparse_matrix_type>&
pMatrix,
1511 const bool debug =
false);
1548 const bool debug =
false);
1558 const bool debug =
false);
1599 const bool debug =
false);
1608 const bool debug =
false);
1620 const Teuchos::RCP<const crs_graph_type>&
pGraph,
1623 const bool debug =
false);
1636 const Teuchos::RCP<const crs_graph_type>&
pGraph,
1637 const bool debug =
false);
1664 const bool debug =
false);
1669 const Teuchos::RCP<const sparse_matrix_type>&
pMatrix,
1670 const bool debug =
false);
1705 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1706 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1715 const Teuchos::RCP<const multivector_type>&
X,
1718 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1719 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1729 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1730 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1739 const Teuchos::RCP<const multivector_type>&
X,
1740 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1741 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1778 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1779 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1787 static std::ofstream openOutFileOnRankZero(
1790 const std::ios_base::openmode
mode = std::ios_base::out);
1818 writeDenseHeader(std::ostream&
out,
1822 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1823 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1843 writeDenseColumn(std::ostream&
out,
1845 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1846 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1856 const Teuchos::RCP<const multivector_type>&
X,
1859 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1860 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1870 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1871 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1880 const Teuchos::RCP<const multivector_type>&
X,
1881 const Teuchos::RCP<Teuchos::FancyOStream>&
err = Teuchos::null,
1882 const Teuchos::RCP<Teuchos::FancyOStream>&
dbg = Teuchos::null);
1917 const Teuchos::RCP<Teuchos::FancyOStream>&
err,
1918 const bool debug =
false);
1950 printAsComment(std::ostream&
out,
const std::string&
str);
2036 const Teuchos::ParameterList&
params);
2079 const Teuchos::ParameterList&
params);
2090 writeOperatorImpl(std::ostream&
os,
2092 const Teuchos::ParameterList&
params);
2095 writeColumns(std::ostream&
os,
mv_type const&
colsA,
size_t const& numCols,
2096 Teuchos::ArrayView<const global_ordinal_type>
const&
rowGids,
2097 Teuchos::Array<global_ordinal_type>
const&
colsArray,
2115 const bool debug =
false);
2118 template <
typename T>
2157template <
class SparseMatrixType>
2159 typename SparseMatrixType::local_ordinal_type,
2160 typename SparseMatrixType::global_ordinal_type,
2161 typename SparseMatrixType::node_type>;
2163template <
class SparseMatrixType>
2165 typename SparseMatrixType::local_ordinal_type,
2166 typename SparseMatrixType::global_ordinal_type,
2167 typename SparseMatrixType::node_type>;
From a distributed map build a map with all GIDs on the root node.
Declaration of a function that prints strings from each process.
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
Node node_type
This class' Kokkos Node type.
GlobalOrdinal global_ordinal_type
The type of each global index in the matrix.
Scalar scalar_type
The type of each entry in the matrix.
Struct that holds views of the contents of a CrsMatrix.
A parallel distribution of indices over processes.
Matrix Market file reader for CrsMatrix and MultiVector.
SparseMatrixType::local_ordinal_type local_ordinal_type
static Teuchos::RCP< sparse_matrix_type > readSparsePerRank(const std::string &filename_prefix, const std::string &filename_suffix, const Teuchos::RCP< const map_type > &rowMap, Teuchos::RCP< const map_type > &colMap, const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const bool callFillComplete=true, const bool tolerant=false, const int ranksToReadAtOnce=8, const bool debug=false)
Read a Tpetra::CrsMatrix from a file per rank setup.
static Teuchos::RCP< sparse_matrix_type > readSparseFile(const std::string &filename, const trcp_tcomm_t &comm, const bool callFillComplete=true, const bool tolerant=false, const bool debug=false)
Read sparse matrix from the given Matrix Market file.
Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > SparseMatrixType
This class' template parameter; a specialization of CrsMatrix.
SparseMatrixType::scalar_type scalar_type
static Teuchos::RCP< multivector_type > readDense(std::istream &in, const trcp_tcomm_t &comm, Teuchos::RCP< const map_type > &map, const bool tolerant=false, const bool debug=false, const bool binary=false)
Read dense matrix (as a MultiVector) from the given Matrix Market input stream.
static Teuchos::RCP< multivector_type > readDenseFile(const std::string &filename, const trcp_tcomm_t &comm, Teuchos::RCP< const map_type > &map, const bool tolerant=false, const bool debug=false, const bool binary=false)
Read dense matrix (as a MultiVector) from the given Matrix Market file.
static std::ifstream openInFileOnRankZero(const trcp_tcomm_t &comm, const std::string &filename, const bool safe=true, std::ios_base::openmode mode=std::ios_base::in)
Open an input file stream safely on rank zero.
static Teuchos::RCP< sparse_graph_type > readSparseGraphFile(const std::string &filename, const trcp_tcomm_t &comm, const bool callFillComplete=true, const bool tolerant=false, const bool debug=false)
Read sparse graph from the given Matrix Market file.
static Teuchos::RCP< sparse_matrix_type > readSparse(std::istream &in, const Teuchos::RCP< const Teuchos::Comm< int > > &pComm, const bool callFillComplete=true, const bool tolerant=false, const bool debug=false)
Read sparse matrix from the given Matrix Market input stream.
static Teuchos::RCP< const map_type > readMapFile(const std::string &filename, const trcp_tcomm_t &comm, const bool tolerant=false, const bool debug=false, const bool binary=false)
Read Map (as a MultiVector) from the given Matrix Market file.
static Teuchos::RCP< vector_type > readVector(std::istream &in, const trcp_tcomm_t &comm, Teuchos::RCP< const map_type > &map, const bool tolerant=false, const bool debug=false)
Read Vector from the given Matrix Market input stream.
Teuchos::RCP< const Teuchos::Comm< int > > trcp_tcomm_t
Type of the MPI communicator.
static Teuchos::RCP< sparse_graph_type > readSparseGraph(std::istream &in, const Teuchos::RCP< const Teuchos::Comm< int > > &pComm, const bool callFillComplete=true, const bool tolerant=false, const bool debug=false)
Read sparse graph from the given Matrix Market input stream.
static Teuchos::RCP< const map_type > readMap(std::istream &in, const trcp_tcomm_t &comm, const bool tolerant=false, const bool debug=false, const bool binary=false)
Read Map (as a MultiVector) from the given input stream.
SparseMatrixType::node_type node_type
The fourth template parameter of CrsMatrix and MultiVector.
CrsGraph< local_ordinal_type, global_ordinal_type, node_type > sparse_graph_type
The CrsGraph specialization associated with SparseMatrixType.
static Teuchos::RCP< vector_type > readVectorFile(const std::string &filename, const trcp_tcomm_t &comm, Teuchos::RCP< const map_type > &map, const bool tolerant=false, const bool debug=false)
Read a Vector from the given Matrix Market file.
MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > multivector_type
The MultiVector specialization associated with SparseMatrixType.
Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > vector_type
The Vector specialization associated with SparseMatrixType.
static Teuchos::RCP< const map_type > readMap(std::istream &in, const trcp_tcomm_t &comm, const Teuchos::RCP< Teuchos::FancyOStream > &err, const bool tolerant=false, const bool debug=false, const bool binary=false)
Read Map (as a MultiVector) from the given input stream, with optional debugging output stream.
SparseMatrixType::global_ordinal_type global_ordinal_type
Matrix Market file writer for CrsMatrix and MultiVector.
Teuchos::RCP< const Teuchos::Comm< int > > trcp_tcomm_t
Type of the MPI communicator.
static trcp_tcomm_t getComm(const Teuchos::RCP< T > &obj)
Return obj MPI communicator or Teuchos::null.
static void writeDenseFile(const std::string &filename, const Teuchos::RCP< const multivector_type > &X, const std::string &matrixName, const std::string &matrixDescription, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with matrix name and description.
static void writeSparsePerRank(const std::string &filename_prefix, const std::string &filename_suffix, const sparse_matrix_type &matrix, const std::string &matrixName, const std::string &matrixDescription, const int ranksToWriteAtOnce=8, const bool debug=false)
Write a Tpetra::CrsMatrix to a file per rank.
Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > SparseMatrixType
Template parameter of this class; specialization of CrsMatrix.
static void writeSparseGraph(std::ostream &out, const crs_graph_type &graph, const std::string &graphName, const std::string &graphDescription, const bool debug=false)
Print the sparse graph in Matrix Market format to the given output stream.
static void writeOperator(const std::string &fileName, const operator_type &A, const Teuchos::ParameterList ¶ms)
Write a Tpetra::Operator to a file, with options.
static void writeOperator(const std::string &fileName, operator_type const &A)
Write a Tpetra::Operator to a file.
Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Specialization of Tpetra::Map that matches SparseMatrixType.
static void writeSparseGraphFile(const std::string &filename, const crs_graph_type &graph, const std::string &graphName, const std::string &graphDescription, const bool debug=false)
Print the sparse graph in Matrix Market format to the given file (by filename).
static void writeDenseFile(const std::string &filename, const multivector_type &X, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with no matrix name or description.
MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > multivector_type
Specialization of Tpetra::MultiVector that matches SparseMatrixType.
static void writeSparseFile(const std::string &filename, const sparse_matrix_type &matrix, const std::string &matrixName, const std::string &matrixDescription, const bool debug=false)
Print the sparse matrix in Matrix Market format, with comments.
SparseMatrixType::node_type node_type
The Kokkos Node type; fourth template parameter of Tpetra::CrsMatrix.
static int getRank(const trcp_tcomm_t &comm)
Return MPI rank or 0.
static void writeMap(std::ostream &out, const map_type &map, const bool debug=false)
Print the Map to the given output stream.
SparseMatrixType::global_ordinal_type global_ordinal_type
Type of indices as read from the Matrix Market file.
static void writeDense(std::ostream &out, const multivector_type &X, const std::string &matrixName, const std::string &matrixDescription, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with matrix name and description.
static void writeOperator(std::ostream &out, const operator_type &A)
Write a Tpetra::Operator to an output stream.
static void writeDense(std::ostream &out, const Teuchos::RCP< const multivector_type > &X, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with no matrix name or description.
static void writeOperator(std::ostream &out, const operator_type &A, const Teuchos::ParameterList ¶ms)
Write a Tpetra::Operator to an output stream, with options.
static void writeMap(std::ostream &out, const map_type &map, const Teuchos::RCP< Teuchos::FancyOStream > &err, const bool debug=false)
Print the Map to the given output stream out.
static void writeDense(std::ostream &out, const Teuchos::RCP< const multivector_type > &X, const std::string &matrixName, const std::string &matrixDescription, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with matrix name and or description.
static void writeMapFile(const std::string &filename, const map_type &map)
Write the Map to the given file.
static void writeDenseFile(const std::string &filename, const Teuchos::RCP< const multivector_type > &X, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with no matrix name or description.
SparseMatrixType::local_ordinal_type local_ordinal_type
Type of the local indices of the sparse matrix.
static void writeDense(std::ostream &out, const multivector_type &X, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with no matrix name or description.
static void writeDenseFile(const std::string &filename, const multivector_type &X, const std::string &matrixName, const std::string &matrixDescription, const Teuchos::RCP< Teuchos::FancyOStream > &err=Teuchos::null, const Teuchos::RCP< Teuchos::FancyOStream > &dbg=Teuchos::null)
Print the multivector in Matrix Market format, with matrix name and description.
CrsGraph< local_ordinal_type, global_ordinal_type, node_type > crs_graph_type
Specialization of Tpetra::CrsGraph that matches SparseMatrixType.
SparseMatrixType::scalar_type scalar_type
Type of the entries of the sparse matrix.
static void writeSparse(std::ostream &out, const sparse_matrix_type &matrix, const std::string &matrixName, const std::string &matrixDescription, const bool debug=false)
Print the sparse matrix in Matrix Market format, with comments.
One or more distributed dense vectors.
Abstract interface for operators (e.g., matrices and preconditioners).
A distributed dense vector.
Matrix Market file readers and writers for sparse and dense matrices (as CrsMatrix resp....
Namespace Tpetra contains the class and methods constituting the Tpetra library.