10 #ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
11 #define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
14 #include "Xpetra_TpetraCrsGraph.hpp"
19 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
22 size_t maxNumEntriesPerRow,
23 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
24 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
28 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
31 const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
32 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
33 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
37 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
41 size_t maxNumEntriesPerRow,
42 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
43 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
47 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
51 const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
52 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
53 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
57 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
60 const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
64 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
68 template <
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))) {}
75 template <
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))) {}
84 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
86 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
90 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
91 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
95 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
101 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
102 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
106 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
108 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
113 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
114 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
118 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
120 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
125 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
126 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
130 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
137 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
140 const ArrayView<const GlobalOrdinal> &cols,
141 const ArrayView<const Scalar> &vals) {
142 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
146 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
149 const ArrayView<const LocalOrdinal> &cols,
150 const ArrayView<const Scalar> &vals) {
151 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
155 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
158 const ArrayView<const GlobalOrdinal> &cols,
159 const ArrayView<const Scalar> &vals) {
160 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
164 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
166 replaceLocalValues(LocalOrdinal localRow,
const ArrayView<const LocalOrdinal> &cols,
const ArrayView<const Scalar> &vals) {
168 mtx_->replaceLocalValues(localRow, cols.getRawPtr(), vals.getRawPtr(), cols.size());
172 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
176 mtx_->setAllToScalar(alpha);
180 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
183 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
188 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
190 allocateAllValues(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {
191 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
195 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
197 setAllValues(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind,
const ArrayRCP<Scalar> &values) {
198 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
202 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
205 ArrayRCP<const LocalOrdinal> &colind,
206 ArrayRCP<const Scalar> &values)
const {
207 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
211 template <
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__));
222 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
228 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
232 const RCP<ParameterList> ¶ms) {
236 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
242 template <
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__));
249 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
255 const RCP<ParameterList> ¶ms) {
256 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
263 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
264 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
271 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
272 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
279 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
280 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, 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()));
287 RCP<const G_x> x_graph = rcp(
new G_x(t_graph));
291 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
296 return mtx_->getGlobalNumRows();
299 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
304 return mtx_->getGlobalNumCols();
307 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
312 return mtx_->getLocalNumRows();
315 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
320 return mtx_->getLocalNumCols();
323 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
328 return mtx_->getGlobalNumEntries();
331 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
336 return mtx_->getLocalNumEntries();
339 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
344 return mtx_->getNumEntriesInLocalRow(localRow);
347 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
352 return mtx_->getNumEntriesInGlobalRow(globalRow);
355 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
357 XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
358 return mtx_->getGlobalMaxNumRowEntries();
361 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
364 return mtx_->getLocalMaxNumRowEntries();
367 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
370 return mtx_->isLocallyIndexed();
373 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
376 return mtx_->isGloballyIndexed();
379 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
382 return mtx_->isFillComplete();
385 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
391 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
394 return mtx_->getFrobeniusNorm();
397 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
400 return mtx_->supportsRowViews();
403 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
406 const ArrayView<LocalOrdinal> &Indices,
407 const ArrayView<Scalar> &Values,
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);
419 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
422 ArrayView<const Scalar> &Values)
const {
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);
428 Indices = ArrayView<const LocalOrdinal>(indices.data(), indices.extent(0));
429 Values = ArrayView<const Scalar>(
reinterpret_cast<const Scalar *
>(values.data()), values.extent(0));
432 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
435 ArrayView<const GlobalOrdinal> &Indices,
436 ArrayView<const Scalar> &Values)
const {
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);
442 Indices = ArrayView<const GlobalOrdinal>(indices.data(), indices.extent(0));
443 Values = ArrayView<const Scalar>(
reinterpret_cast<const Scalar *
>(values.data()), values.extent(0));
446 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
449 const ArrayView<GlobalOrdinal> &Indices,
450 const ArrayView<Scalar> &Values,
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);
463 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
467 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
471 Teuchos::ETransp mode,
478 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
482 Teuchos::ETransp mode,
485 bool sumInterfaceValues,
487 const Teuchos::ArrayRCP<LocalOrdinal> ®ionInterfaceLIDs)
const {}
489 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
490 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
494 return toXpetra(mtx_->getDomainMap());
497 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
498 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
502 return toXpetra(mtx_->getRangeMap());
505 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
510 return mtx_->description();
513 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
516 const Teuchos::EVerbosityLevel verbLevel)
const {
518 mtx_->describe(out, verbLevel);
521 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
525 Teuchos::LabeledObject::setObjectLabel(objectLabel);
526 mtx_->setObjectLabel(objectLabel);
529 template <
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());
541 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
544 const Teuchos::ArrayView<const size_t> &offsets)
const {
545 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
549 template <
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__));
556 template <
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;
576 output_type offsetsOut(offsets.getRawPtr(), offsets.size());
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;
582 output_type offsetsOut(offsets.getRawPtr(), offsets.size());
583 Kokkos::deep_copy(offsetsOut, offsetsTmp);
587 template <
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__));
593 template <
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__));
599 template <
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__));
605 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
606 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
614 template <
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__));
622 template <
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__));
630 template <
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__));
638 template <
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__));
645 template <
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__));
651 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
654 return !mtx_.is_null();
657 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
659 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx)
662 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
663 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
670 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
671 RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
677 #ifdef HAVE_XPETRA_TPETRA
682 template <
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__));
692 TEUCHOS_UNREACHABLE_RETURN(ret);
695 template <
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;
713 TEUCHOS_UNREACHABLE_RETURN(ret);
716 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
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__));
724 #endif // HAVE_XPETRA_TPETRA
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))))
732 template <
class Scalar>
734 :
public CrsMatrix<Scalar, int, int, EpetraNode>
779 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
786 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
793 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
801 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
806 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
835 void allocateAllValues(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
838 void setAllValues(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind,
const ArrayRCP<Scalar> &values) {}
841 void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values)
const {}
868 const RCP<ParameterList> ¶ms = Teuchos::null) {}
873 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRowMap()
const {
return Teuchos::null; }
876 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getColMap()
const {
return Teuchos::null; }
879 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
getCrsGraph()
const {
return Teuchos::null; }
924 typename ScalarTraits<Scalar>::magnitudeType
getFrobeniusNorm()
const {
return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
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 {}
950 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
return Teuchos::null; }
953 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
return Teuchos::null; }
961 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
986 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getMap()
const {
return Teuchos::null; }
1012 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1017 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_BlockCrsMatrix()
const {
return Teuchos::null; }
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__));
1036 #endif // HAVE_XPETRA_TPETRA
1040 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
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))))
1046 template <
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()); }
1081 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1088 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1095 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1103 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1135 void allocateAllValues(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
1138 void setAllValues(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind,
const ArrayRCP<Scalar> &values) {}
1141 void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values)
const {}
1168 const RCP<ParameterList> ¶ms = Teuchos::null) {}
1173 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRowMap()
const {
return Teuchos::null; }
1176 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getColMap()
const {
return Teuchos::null; }
1179 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
getCrsGraph()
const {
return Teuchos::null; }
1224 typename ScalarTraits<Scalar>::magnitudeType
getFrobeniusNorm()
const {
return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
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 {}
1250 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
return Teuchos::null; }
1253 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
return Teuchos::null; }
1261 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
1286 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getMap()
const {
return Teuchos::null; }
1312 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1317 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_BlockCrsMatrix()
const {
return Teuchos::null; }
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__));
1328 TEUCHOS_UNREACHABLE_RETURN(ret);
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__));
1336 #endif // HAVE_XPETRA_TPETRA
1340 #endif // IF ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
1342 #endif // HAVE_XPETRA_EPETRA
1346 #endif // XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
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...
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void replaceDiag(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
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...
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
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 insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
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.
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...
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...
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
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 getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
local_matrix_type::HostMirror getLocalMatrixHost() const
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (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.
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
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...
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
local_matrix_type getLocalMatrixDevice() const
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 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.
local_matrix_type getLocalMatrix() const
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.
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale operator with given vector values.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
bool hasMatrix() const
Does this have an underlying matrix.
void resumeFill(const RCP< ParameterList > ¶ms=null)
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
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 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 )
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 leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
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.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
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 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 setObjectLabel(const std::string &objectLabel)
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
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.
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...
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
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.
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.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
std::string description() const
A simple one-line description of this object.
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 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.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph & blocksize.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
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.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
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 replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
virtual bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
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< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
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) ...
void resumeFill(const RCP< ParameterList > ¶ms=null)
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
~TpetraBlockCrsMatrix()
Destructor.
bool hasMatrix() const
Does this have an underlying matrix.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this 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 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.
local_matrix_type getLocalMatrix() const
std::string description() const
A simple one-line description of this object.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
std::string description() const
A simple one-line description of this object.
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)
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this 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(.
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::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
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 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 getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the 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.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
global_size_t getGlobalNumCols() const
Number of global columns in the 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.
bool isFillActive() const
Returns true if the matrix is in edit mode.
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.
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(.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
~TpetraBlockCrsMatrix()
Destructor.
size_t global_size_t
Global size_t object.
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
virtual ~TpetraBlockCrsMatrix()
Destructor.
size_t getLocalNumEntries() const
Returns the local number of entries in this 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)
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) ...
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 isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
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 )
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
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...
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 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 > &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 doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
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)
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
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.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra 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 replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
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 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)
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
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 doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
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 getGlobalNumEntries() const
Returns the global number of entries in 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...
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
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 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 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)
CombineMode
Xpetra::Combine Mode enumerable type.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
#define XPETRA_MONITOR(funcName)
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.
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.
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)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution 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.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
size_t getLocalNumEntries() const
Returns the local number of entries in this 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)
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.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
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...
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
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 insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
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< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (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.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row 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)
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.
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 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 resumeFill(const RCP< ParameterList > ¶ms=null)
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) ...
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)