46 #ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
47 #define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
50 #include "Xpetra_TpetraCrsGraph.hpp"
55 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
58 size_t maxNumEntriesPerRow,
59 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
60 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
64 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
68 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
69 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
73 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
77 size_t maxNumEntriesPerRow,
78 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
79 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
83 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
87 const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
88 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
89 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
93 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
96 const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
100 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
104 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
107 const LocalOrdinal blockSize)
108 : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), blockSize))) {}
111 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
116 const LocalOrdinal blockSize)
117 : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), *
toTpetra(pointDomainMap), *
toTpetra(pointRangeMap), blockSize))) {}
120 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
122 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
126 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
127 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
131 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
133 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
137 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
138 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
142 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
144 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
149 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
150 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
154 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
156 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
161 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
162 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
166 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
173 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
176 const ArrayView<const GlobalOrdinal> &cols,
177 const ArrayView<const Scalar> &vals) {
178 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
182 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
185 const ArrayView<const LocalOrdinal> &cols,
186 const ArrayView<const Scalar> &vals) {
187 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
191 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
194 const ArrayView<const GlobalOrdinal> &cols,
195 const ArrayView<const Scalar> &vals) {
196 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) +
":" + std::to_string(__LINE__));
200 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
202 replaceLocalValues(LocalOrdinal localRow,
const ArrayView<const LocalOrdinal> &cols,
const ArrayView<const Scalar> &vals) {
204 mtx_->replaceLocalValues(localRow, cols.getRawPtr(), vals.getRawPtr(), cols.size());
208 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
212 mtx_->setAllToScalar(alpha);
216 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
219 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
224 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
226 allocateAllValues(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {
227 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
231 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
233 setAllValues(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind,
const ArrayRCP<Scalar> &values) {
234 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
238 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
241 ArrayRCP<const LocalOrdinal> &colind,
242 ArrayRCP<const Scalar> &values)
const {
243 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
247 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
250 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
258 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
264 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
268 const RCP<ParameterList> ¶ms) {
272 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
278 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
282 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
285 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
291 const RCP<ParameterList> ¶ms) {
292 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
299 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
300 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
307 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
308 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
315 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
316 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
320 using G_t = Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>;
322 RCP<G_t> t_graph = Teuchos::rcp_const_cast<G_t>(Teuchos::rcpFromRef(mtx_->getCrsGraph()));
323 RCP<const G_x> x_graph = rcp(
new G_x(t_graph));
327 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
332 return mtx_->getGlobalNumRows();
335 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
340 return mtx_->getGlobalNumCols();
343 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
348 return mtx_->getLocalNumRows();
351 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
356 return mtx_->getLocalNumCols();
359 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
364 return mtx_->getGlobalNumEntries();
367 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
372 return mtx_->getLocalNumEntries();
375 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
380 return mtx_->getNumEntriesInLocalRow(localRow);
383 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
388 return mtx_->getNumEntriesInGlobalRow(globalRow);
391 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
393 XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
394 return mtx_->getGlobalMaxNumRowEntries();
397 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
400 return mtx_->getLocalMaxNumRowEntries();
403 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
406 return mtx_->isLocallyIndexed();
409 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
412 return mtx_->isGloballyIndexed();
415 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
418 return mtx_->isFillComplete();
421 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
427 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
430 return mtx_->getFrobeniusNorm();
433 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
436 return mtx_->supportsRowViews();
439 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
442 const ArrayView<LocalOrdinal> &Indices,
443 const ArrayView<Scalar> &Values,
444 size_t &NumEntries)
const {
446 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_local_inds_host_view_type indices(
"indices", Indices.size());
447 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values(
"values", Values.size());
449 mtx_->getLocalRowCopy(LocalRow, indices, values, NumEntries);
450 for (
size_t i = 0; i < NumEntries; ++i) {
451 Indices[i] = indices(i);
452 Values[i] = values(i);
455 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
458 ArrayView<const Scalar> &Values)
const {
460 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::local_inds_host_view_type indices;
461 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
463 mtx_->getLocalRowView(LocalRow, indices, values);
464 Indices = ArrayView<const LocalOrdinal>(indices.data(), indices.extent(0));
465 Values = ArrayView<const Scalar>(
reinterpret_cast<const Scalar *
>(values.data()), values.extent(0));
468 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
471 ArrayView<const GlobalOrdinal> &Indices,
472 ArrayView<const Scalar> &Values)
const {
474 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::global_inds_host_view_type indices;
475 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
477 mtx_->getGlobalRowView(GlobalRow, indices, values);
478 Indices = ArrayView<const GlobalOrdinal>(indices.data(), indices.extent(0));
479 Values = ArrayView<const Scalar>(
reinterpret_cast<const Scalar *
>(values.data()), values.extent(0));
482 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
485 const ArrayView<GlobalOrdinal> &Indices,
486 const ArrayView<Scalar> &Values,
487 size_t &NumEntries)
const {
489 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_global_inds_host_view_type indices(
"indices", Indices.size());
490 typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values(
"values", Values.size());
492 mtx_->getGlobalRowCopy(GlobalRow, indices, values, NumEntries);
493 for (
size_t i = 0; i < NumEntries; ++i) {
494 Indices[i] = indices(i);
495 Values[i] = values(i);
499 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
503 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
507 Teuchos::ETransp mode,
514 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
518 Teuchos::ETransp mode,
521 bool sumInterfaceValues,
523 const Teuchos::ArrayRCP<LocalOrdinal> ®ionInterfaceLIDs)
const {}
525 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
526 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
530 return toXpetra(mtx_->getDomainMap());
533 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
534 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
538 return toXpetra(mtx_->getRangeMap());
541 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
546 return mtx_->description();
549 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
552 const Teuchos::EVerbosityLevel verbLevel)
const {
554 mtx_->describe(out, verbLevel);
557 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
561 Teuchos::LabeledObject::setObjectLabel(objectLabel);
562 mtx_->setObjectLabel(objectLabel);
565 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
572 "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
573 mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
577 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
580 const Teuchos::ArrayView<const size_t> &offsets)
const {
581 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
585 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
588 const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets)
const {
589 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
592 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
597 const size_t lclNumRows = mtx_->getGraph()->getLocalNumRows();
598 if (static_cast<size_t>(offsets.size()) < lclNumRows) {
599 offsets.resize(lclNumRows);
605 typedef typename Node::device_type device_type;
606 typedef typename device_type::memory_space memory_space;
607 if (std::is_same<memory_space, Kokkos::HostSpace>::value) {
611 typedef Kokkos::View<size_t *, device_type, Kokkos::MemoryUnmanaged> output_type;
612 output_type offsetsOut(offsets.getRawPtr(), offsets.size());
613 mtx_->getLocalDiagOffsets(offsetsOut);
615 Kokkos::View<size_t *, device_type> offsetsTmp(
"diagOffsets", offsets.size());
616 mtx_->getLocalDiagOffsets(offsetsTmp);
617 typedef Kokkos::View<size_t *, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
618 output_type offsetsOut(offsets.getRawPtr(), offsets.size());
619 Kokkos::deep_copy(offsetsOut, offsetsTmp);
623 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
626 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
629 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
632 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
635 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
638 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
641 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
642 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
650 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
654 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
658 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
662 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
666 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
670 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
674 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
678 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
681 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
684 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
687 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
690 return !mtx_.is_null();
693 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
695 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx)
698 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
699 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
706 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
707 RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
713 #ifdef HAVE_XPETRA_TPETRA
718 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
722 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__));
728 TEUCHOS_UNREACHABLE_RETURN(ret);
731 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
735 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__));
738 typename local_matrix_type::HostMirror ret;
741 TEUCHOS_UNREACHABLE_RETURN(ret);
744 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
747 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
748 const typename local_matrix_type::values_type &val) {
749 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__));
752 #endif // HAVE_XPETRA_TPETRA
754 #ifdef HAVE_XPETRA_EPETRA
756 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
757 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
760 template <
class Scalar>
762 :
public CrsMatrix<Scalar, int, int, EpetraNode>
807 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
814 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
821 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
829 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
834 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
863 void allocateAllValues(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
866 void setAllValues(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind,
const ArrayRCP<Scalar> &values) {}
869 void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values)
const {}
896 const RCP<ParameterList> ¶ms = Teuchos::null) {}
901 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRowMap()
const {
return Teuchos::null; }
904 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getColMap()
const {
return Teuchos::null; }
907 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
getCrsGraph()
const {
return Teuchos::null; }
952 typename ScalarTraits<Scalar>::magnitudeType
getFrobeniusNorm()
const {
return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
975 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 {}
978 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
return Teuchos::null; }
981 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
return Teuchos::null; }
989 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
1014 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getMap()
const {
return Teuchos::null; }
1040 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1045 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_BlockCrsMatrix()
const {
return Teuchos::null; }
1050 #ifdef HAVE_XPETRA_TPETRA
1054 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__));
1060 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1061 const typename local_matrix_type::values_type &val) {
1062 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__));
1064 #endif // HAVE_XPETRA_TPETRA
1068 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
1070 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1071 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1074 template <
class Scalar>
1076 :
public CrsMatrix<Scalar, int, long long, EpetraNode>
1091 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()); }
1094 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()); }
1097 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()); }
1100 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()); }
1103 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()); }
1106 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()); }
1109 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1116 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1123 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1131 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1163 void allocateAllValues(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
1166 void setAllValues(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind,
const ArrayRCP<Scalar> &values) {}
1169 void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values)
const {}
1196 const RCP<ParameterList> ¶ms = Teuchos::null) {}
1201 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRowMap()
const {
return Teuchos::null; }
1204 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getColMap()
const {
return Teuchos::null; }
1207 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
getCrsGraph()
const {
return Teuchos::null; }
1252 typename ScalarTraits<Scalar>::magnitudeType
getFrobeniusNorm()
const {
return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
1275 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 {}
1278 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
return Teuchos::null; }
1281 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
return Teuchos::null; }
1289 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
1314 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getMap()
const {
return Teuchos::null; }
1340 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1345 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_BlockCrsMatrix()
const {
return Teuchos::null; }
1350 #ifdef HAVE_XPETRA_TPETRA
1354 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__));
1356 TEUCHOS_UNREACHABLE_RETURN(ret);
1360 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1361 const typename local_matrix_type::values_type &val) {
1362 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__));
1364 #endif // HAVE_XPETRA_TPETRA
1368 #endif // IF ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
1370 #endif // HAVE_XPETRA_EPETRA
1374 #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)