42#ifndef TPETRA_ROWMATRIXTRANSPOSER_DEF_HPP
43#define TPETRA_ROWMATRIXTRANSPOSER_DEF_HPP
45#include "Tpetra_CrsMatrix.hpp"
46#include "Tpetra_Export.hpp"
49#include "Teuchos_ParameterList.hpp"
50#include "Teuchos_TimeMonitor.hpp"
51#include "KokkosKernels_SparseUtils.hpp"
61 const std::string&
label)
62 : origMatrix_ (origMatrix), label_ (
label)
69Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
77#ifdef HAVE_TPETRA_MMM_TIMINGS
78 const std::string
prefix = std::string (
"Tpetra ") + label_ +
": ";
79 using Teuchos::TimeMonitor;
94#ifdef HAVE_TPETRA_MMM_TIMINGS
98 const char paramName[] =
"compute global constants";
106 Teuchos::null, Teuchos::rcpFromRef (
labelList));
119Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
123 using Teuchos::Array;
124 using Teuchos::ArrayRCP;
125 using Teuchos::ArrayView;
128 using Teuchos::rcp_dynamic_cast;
134#ifdef HAVE_TPETRA_MMM_TIMINGS
135 std::string
prefix = std::string(
"Tpetra ") + label_ +
": ";
136 using Teuchos::TimeMonitor;
140 const bool sort = [&] () {
147 const LO
lclNumRows (origMatrix_->getNodeNumRows ());
152 auto rowMap = origMatrix_->getRowMap ();
153 if (
rowMap->isOneToOne ()) {
158 auto colMap = origMatrix_->getColMap ();
166 crsMatrix_nc->fillComplete (origMatrix_->getDomainMap (),
167 origMatrix_->getRangeMap ());
184 const auto origExport = origMatrix_->getGraph ()->getExporter ();
187 const auto origImport = origMatrix_->getGraph ()->getImporter ();
198 origMatrix_->getColMap (),
199 origMatrix_->getRowMap (),
200 origMatrix_->getRangeMap (),
201 origMatrix_->getDomainMap (),
210#define TPETRA_ROWMATRIXTRANSPOSER_INSTANT(SCALAR,LO,GO,NODE) \
211 template class RowMatrixTransposer< SCALAR, LO , GO , NODE >;
Declare and define the functions Tpetra::Details::computeOffsetsFromCounts and Tpetra::computeOffsets...
Declaration and definition of functions for sorting "short" arrays of keys and corresponding values.
Struct that holds views of the contents of a CrsMatrix.
Teuchos::RCP< const map_type > colMap
Col map for the original version of the matrix.
Teuchos::RCP< const map_type > rowMap
Desired row map for "imported" version of the matrix.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
KokkosSparse::CrsMatrix< impl_scalar_type, local_ordinal_type, device_type, void, typename local_graph_device_type::size_type > local_matrix_device_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
Teuchos::RCP< crs_matrix_type > createTranspose(const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Compute and return the transpose of the matrix given to the constructor.
Teuchos::RCP< crs_matrix_type > createTransposeLocal(const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Compute and return the transpose of the matrix given to the constructor.
RowMatrixTransposer(const Teuchos::RCP< const crs_matrix_type > &origMatrix, const std::string &label=std::string())
Constructor that takes the matrix to transpose.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
void sort(View &view, const size_t &size)
Convenience wrapper for std::sort for host-accessible views.
@ REPLACE
Replace existing values with new values.