10#ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
11#define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
14#include "Xpetra_TpetraCrsGraph.hpp"
19template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
22 size_t maxNumEntriesPerRow,
24 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
28template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
33 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
37template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
41 size_t maxNumEntriesPerRow,
43 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
47template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
53 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
57template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
68template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
71 const LocalOrdinal blockSize)
72 : mtx_(
Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), blockSize))) {}
75template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 const LocalOrdinal blockSize)
81 : mtx_(
Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), *
toTpetra(pointDomainMap), *
toTpetra(pointRangeMap), blockSize))) {}
84template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
91 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
95template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
102 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
106template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
114 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
118template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
126 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
130template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
137template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
142 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
146template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
151 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
155template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
160 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
164template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
172template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
176 mtx_->setAllToScalar(alpha);
180template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
182 scale(
const Scalar &alpha) {
183 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
188template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
191 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
195template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
198 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
202template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
207 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
211template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
214 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
222template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
228template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
236template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
242template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
246 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
249template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
256 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
263template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
271template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
279template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
284 using G_t = Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>;
286 RCP<G_t> t_graph = Teuchos::rcp_const_cast<G_t>(Teuchos::rcpFromRef(mtx_->getCrsGraph()));
291template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
296 return mtx_->getGlobalNumRows();
299template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
304 return mtx_->getGlobalNumCols();
307template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
312 return mtx_->getLocalNumRows();
315template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
320 return mtx_->getLocalNumCols();
323template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
328 return mtx_->getGlobalNumEntries();
331template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
336 return mtx_->getLocalNumEntries();
339template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
344 return mtx_->getNumEntriesInLocalRow(localRow);
347template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
352 return mtx_->getNumEntriesInGlobalRow(globalRow);
355template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
357 XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
358 return mtx_->getGlobalMaxNumRowEntries();
361template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
364 return mtx_->getLocalMaxNumRowEntries();
367template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
370 return mtx_->isLocallyIndexed();
373template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
376 return mtx_->isGloballyIndexed();
379template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
382 return mtx_->isFillComplete();
385template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
391template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
394 return mtx_->getFrobeniusNorm();
397template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
400 return mtx_->supportsRowViews();
403template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
408 size_t &NumEntries)
const {
410 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_local_inds_host_view_type indices(
"indices", Indices.
size());
411 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values(
"values", Values.
size());
413 mtx_->getLocalRowCopy(LocalRow, indices, values, NumEntries);
414 for (
size_t i = 0; i < NumEntries; ++i) {
415 Indices[i] = indices(i);
416 Values[i] = values(i);
419template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
424 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::local_inds_host_view_type indices;
425 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
427 mtx_->getLocalRowView(LocalRow, indices, values);
432template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
438 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::global_inds_host_view_type indices;
439 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
441 mtx_->getGlobalRowView(GlobalRow, indices, values);
446template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
451 size_t &NumEntries)
const {
453 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_global_inds_host_view_type indices(
"indices", Indices.
size());
454 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values(
"values", Values.
size());
456 mtx_->getGlobalRowCopy(GlobalRow, indices, values, NumEntries);
457 for (
size_t i = 0; i < NumEntries; ++i) {
458 Indices[i] = indices(i);
459 Values[i] = values(i);
463template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
467template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
478template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
485 bool sumInterfaceValues,
489template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
494 return toXpetra(mtx_->getDomainMap());
497template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
502 return toXpetra(mtx_->getRangeMap());
505template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
510 return mtx_->description();
513template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
518 mtx_->describe(out, verbLevel);
521template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
526 mtx_->setObjectLabel(objectLabel);
529template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
536 "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
537 mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
541template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
545 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
549template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
552 const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets)
const {
553 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
556template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
561 const size_t lclNumRows = mtx_->getGraph()->getLocalNumRows();
562 if (
static_cast<size_t>(offsets.
size()) < lclNumRows) {
563 offsets.
resize(lclNumRows);
569 typedef typename Node::device_type device_type;
570 typedef typename device_type::memory_space memory_space;
571 if (std::is_same<memory_space, Kokkos::HostSpace>::value) {
575 typedef Kokkos::View<size_t *, device_type, Kokkos::MemoryUnmanaged> output_type;
577 mtx_->getLocalDiagOffsets(offsetsOut);
579 Kokkos::View<size_t *, device_type> offsetsTmp(
"diagOffsets", offsets.
size());
580 mtx_->getLocalDiagOffsets(offsetsTmp);
581 typedef Kokkos::View<size_t *, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
583 Kokkos::deep_copy(offsetsOut, offsetsTmp);
587template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
590 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
593template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
596 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
599template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
602 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
605template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
614template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
618 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
622template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
626 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
630template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
634 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
638template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
642 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
645template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
648 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
651template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
654 return !mtx_.is_null();
657template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
662template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
670template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
677#ifdef HAVE_XPETRA_TPETRA
682template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
686 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
695template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
696#if KOKKOS_VERSION >= 40799
703 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
706#if KOKKOS_VERSION >= 40799
707 typename local_matrix_type::host_mirror_type ret;
709 typename local_matrix_type::HostMirror ret;
716template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
718 setAllValues(
const typename local_matrix_type::row_map_type &ptr,
719 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
720 const typename local_matrix_type::values_type &val) {
721 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
726#ifdef HAVE_XPETRA_EPETRA
728#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
729 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
732template <
class Scalar>
734 :
public CrsMatrix<Scalar, int, int, EpetraNode>
947 void apply(
const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &X,
MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &Y,
Teuchos::ETransp mode =
Teuchos::NO_TRANS, Scalar alpha =
ScalarTraits<Scalar>::one(), Scalar beta =
ScalarTraits<Scalar>::zero())
const {}
1022#ifdef HAVE_XPETRA_TPETRA
1026 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1032 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1033 const typename local_matrix_type::values_type &val) {
1034 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1042#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1043 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1046template <
class Scalar>
1048 :
public CrsMatrix<Scalar, int, long long, EpetraNode>
1063 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap,
size_t maxNumEntriesPerRow,
const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
XPETRA_TPETRA_ETI_EXCEPTION(
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
"long long",
typeid(
EpetraNode).name()); }
1066 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap,
const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
XPETRA_TPETRA_ETI_EXCEPTION(
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
"long long",
typeid(
EpetraNode).name()); }
1069 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap,
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap,
size_t maxNumEntriesPerRow,
const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
XPETRA_TPETRA_ETI_EXCEPTION(
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
"long long",
typeid(
EpetraNode).name()); }
1072 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap,
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap,
const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
XPETRA_TPETRA_ETI_EXCEPTION(
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
"long long",
typeid(
EpetraNode).name()); }
1075 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph,
const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
XPETRA_TPETRA_ETI_EXCEPTION(
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
"long long",
typeid(
EpetraNode).name()); }
1078 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph,
const LocalOrdinal blockSize) {
XPETRA_TPETRA_ETI_EXCEPTION(
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
typeid(
TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(),
"long long",
typeid(
EpetraNode).name()); }
1247 void apply(
const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &X,
MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &Y,
Teuchos::ETransp mode =
Teuchos::NO_TRANS, Scalar alpha =
ScalarTraits<Scalar>::one(), Scalar beta =
ScalarTraits<Scalar>::zero())
const {}
1322#ifdef HAVE_XPETRA_TPETRA
1326 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1332 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1333 const typename local_matrix_type::values_type &val) {
1334 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void resize(const size_type n, const T &val=T())
static const EVerbosityLevel verbLevel_default
virtual void setObjectLabel(const std::string &objectLabel)
KokkosSparse::CrsMatrix< impl_scalar_type, LocalOrdinal, execution_space, void, typename local_graph_type::size_type > local_matrix_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
void setAllValues(const typename local_matrix_type::row_map_type &ptr, const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind, const typename local_matrix_type::values_type &val)
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
bool isFillActive() const
Returns true if the matrix is in edit mode.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph & blocksize.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused export (not implemented(.
bool hasMatrix() const
Does this have an underlying matrix.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Kokkos::View< const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused import ( not implemented )
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
std::string description() const
A simple one-line description of this object.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > ¶ms=Teuchos::null)
Expert static fill complete.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor for a fused import ( not implemented )
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented)
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented)
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
~TpetraBlockCrsMatrix()
Destructor.
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
local_matrix_type getLocalMatrix() const
void resumeFill(const RCP< ParameterList > ¶ms=null)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor for a fused export (not implemented(.
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
~TpetraBlockCrsMatrix()
Destructor.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void setAllValues(const typename local_matrix_type::row_map_type &ptr, const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind, const typename local_matrix_type::values_type &val)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor for a fused import (not implemented)
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused import (not implemented)
bool hasMatrix() const
Does this have an underlying matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor for a fused export (not implemented)
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor for a fused export (not implemented)
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
void resumeFill(const RCP< ParameterList > ¶ms=null)
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > ¶ms=Teuchos::null)
Expert static fill complete.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
bool isFillActive() const
Returns true if the matrix is in edit mode.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented)
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceDiag(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Kokkos::View< const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph & blocksize.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
std::string description() const
A simple one-line description of this object.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
local_matrix_type getLocalMatrix() const
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented)
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
local_matrix_type getLocalMatrixDevice() const
void setObjectLabel(const std::string &objectLabel)
local_matrix_type::HostMirror getLocalMatrixHost() const
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
std::string description() const
A simple one-line description of this object.
virtual bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale operator with given vector values.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
bool hasMatrix() const
Does this have an underlying matrix.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale operator with given vector values.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
typename CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
virtual ~TpetraBlockCrsMatrix()
Destructor.
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
void resumeFill(const RCP< ParameterList > ¶ms=null)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > ¶ms=Teuchos::null)
Expert static fill complete.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
bool isFillActive() const
Returns true if the matrix is in edit mode.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
size_t global_size_t
Global size_t object.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
CombineMode
Xpetra::Combine Mode enumerable type.
static magnitudeType magnitude(T a)