43#ifndef IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP
44#define IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP
48#include <Ifpack2_Details_OverlappingRowGraph.hpp>
49#include <Tpetra_CrsMatrix.hpp>
50#include <Tpetra_Import.hpp>
51#include "Tpetra_Map.hpp"
52#include <Teuchos_CommHelpers.hpp>
53#include <unordered_set>
57template<
class MatrixType>
60 const int overlapLevel) :
61 A_ (Teuchos::rcp_dynamic_cast<const crs_matrix_type> (A, true)),
62 OverlapLevel_ (overlapLevel)
67 using Teuchos::outArg;
68 using Teuchos::REDUCE_SUM;
69 using Teuchos::reduceAll;
70 typedef Tpetra::global_size_t GST;
71 typedef Tpetra::CrsGraph<local_ordinal_type,
72 global_ordinal_type, node_type> crs_graph_type;
73 TEUCHOS_TEST_FOR_EXCEPTION(
74 OverlapLevel_ <= 0, std::runtime_error,
75 "Ifpack2::OverlappingRowMatrix: OverlapLevel must be > 0.");
76 TEUCHOS_TEST_FOR_EXCEPTION
77 (A_.is_null (), std::runtime_error,
78 "Ifpack2::OverlappingRowMatrix: The input matrix must be a "
79 "Tpetra::CrsMatrix with the same scalar_type, local_ordinal_type, "
80 "global_ordinal_type, and device_type typedefs as MatrixType.");
81 TEUCHOS_TEST_FOR_EXCEPTION(
82 A_->getComm()->getSize() == 1, std::runtime_error,
83 "Ifpack2::OverlappingRowMatrix: Matrix must be "
84 "distributed over more than one MPI process.");
87 RCP<const crs_graph_type> A_crsGraph = A_->getCrsGraph ();
88 const size_t numMyRowsA = A_->getLocalNumRows ();
89 const global_ordinal_type global_invalid =
90 Teuchos::OrdinalTraits<global_ordinal_type>::invalid ();
93 Array<global_ordinal_type> ExtElements;
97 std::unordered_set<global_ordinal_type> ExtElementSet;
99 RCP<crs_graph_type> TmpGraph;
100 RCP<import_type> TmpImporter;
101 RCP<const map_type> RowMap, ColMap;
102 Kokkos::resize(ExtHaloStarts_, OverlapLevel_+1);
103 ExtHaloStarts_h = Kokkos::create_mirror_view(ExtHaloStarts_);
106 for (
int overlap = 0 ; overlap < OverlapLevel_ ; ++overlap) {
107 ExtHaloStarts_h(overlap) = (size_t) ExtElements.size();
111 RowMap = A_->getRowMap ();
112 ColMap = A_->getColMap ();
115 RowMap = TmpGraph->getRowMap ();
116 ColMap = TmpGraph->getColMap ();
119 const size_t size = ColMap->getLocalNumElements () - RowMap->getLocalNumElements ();
120 Array<global_ordinal_type> mylist (size);
124 for (local_ordinal_type i = 0 ; (size_t) i < ColMap->getLocalNumElements() ; ++i) {
125 const global_ordinal_type GID = ColMap->getGlobalElement (i);
126 if (A_->getRowMap ()->getLocalElement (GID) == global_invalid) {
129 if(ExtElementSet.insert(GID).second)
131 ExtElements.push_back (GID);
140 if (overlap + 1 < OverlapLevel_) {
142 TmpMap = rcp (
new map_type (global_invalid, mylist (0, count),
143 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
146 TmpGraph = rcp (
new crs_graph_type (TmpMap, 0));
147 TmpImporter = rcp (
new import_type (A_->getRowMap (), TmpMap));
150 TmpGraph->doImport (*A_crsGraph, *TmpImporter, Tpetra::INSERT);
151 TmpGraph->fillComplete (A_->getDomainMap (), TmpMap);
154 ExtHaloStarts_h[OverlapLevel_] = (size_t) ExtElements.size();
155 Kokkos::deep_copy(ExtHaloStarts_,ExtHaloStarts_h);
159 Array<global_ordinal_type> mylist (numMyRowsA + ExtElements.size ());
160 for (local_ordinal_type i = 0; (size_t)i < numMyRowsA; ++i) {
161 mylist[i] = A_->getRowMap ()->getGlobalElement (i);
163 for (local_ordinal_type i = 0; i < ExtElements.size (); ++i) {
164 mylist[i + numMyRowsA] = ExtElements[i];
168 RowMap_ = rcp (
new map_type (global_invalid, mylist (),
169 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
171 Importer_ = rcp (
new import_type (A_->getRowMap (), RowMap_));
176 ExtMap_ = rcp (
new map_type (global_invalid, ExtElements (),
177 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
179 ExtImporter_ = rcp (
new import_type (A_->getRowMap (), ExtMap_));
182 ExtMatrix_ = rcp (
new crs_matrix_type (ExtMap_, ColMap_, 0));
183 ExtMatrix_->doImport (*A_, *ExtImporter_, Tpetra::INSERT);
184 ExtMatrix_->fillComplete (A_->getDomainMap (), RowMap_);
188 const size_t numMyRowsB = ExtMatrix_->getLocalNumRows ();
190 GST NumMyNonzeros_tmp = A_->getLocalNumEntries () + ExtMatrix_->getLocalNumEntries ();
191 GST NumMyRows_tmp = numMyRowsA + numMyRowsB;
193 GST inArray[2], outArray[2];
194 inArray[0] = NumMyNonzeros_tmp;
195 inArray[1] = NumMyRows_tmp;
198 reduceAll<int, GST> (* (A_->getComm ()), REDUCE_SUM, 2, inArray, outArray);
199 NumGlobalNonzeros_ = outArray[0];
200 NumGlobalRows_ = outArray[1];
207 MaxNumEntries_ = A_->getLocalMaxNumRowEntries ();
209 MaxNumEntries_ = ExtMatrix_->getLocalMaxNumRowEntries ();
214 RCP<row_graph_impl_type> graph =
215 rcp (
new row_graph_impl_type (A_->getGraph (),
216 ExtMatrix_->getGraph (),
225 graph_ = Teuchos::rcp_const_cast<const row_graph_type>
226 (Teuchos::rcp_implicit_cast<row_graph_type> (graph));
228 Kokkos::resize(Indices_,MaxNumEntries_);
229 Kokkos::resize(Values_,MaxNumEntries_);
233template<
class MatrixType>
234Teuchos::RCP<const Teuchos::Comm<int> >
237 return A_->getComm ();
243template<
class MatrixType>
244Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
252template<
class MatrixType>
253Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
261template<
class MatrixType>
262Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
277template<
class MatrixType>
278Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
285template<
class MatrixType>
286Teuchos::RCP<const Tpetra::RowGraph<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
293template<
class MatrixType>
296 return NumGlobalRows_;
300template<
class MatrixType>
303 return NumGlobalRows_;
307template<
class MatrixType>
310 return A_->getLocalNumRows () + ExtMatrix_->getLocalNumRows ();
314template<
class MatrixType>
317 return this->getLocalNumRows ();
321template<
class MatrixType>
322typename MatrixType::global_ordinal_type
325 return A_->getIndexBase();
329template<
class MatrixType>
332 return NumGlobalNonzeros_;
336template<
class MatrixType>
339 return A_->getLocalNumEntries () + ExtMatrix_->getLocalNumEntries ();
343template<
class MatrixType>
348 const local_ordinal_type localRow = RowMap_->getLocalElement (globalRow);
349 if (localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
350 return Teuchos::OrdinalTraits<size_t>::invalid();
352 return getNumEntriesInLocalRow (localRow);
357template<
class MatrixType>
363 const size_t numMyRowsA = A_->getLocalNumRows ();
364 if (as<size_t> (localRow) < numMyRowsA) {
365 return A_->getNumEntriesInLocalRow (localRow);
367 return ExtMatrix_->getNumEntriesInLocalRow (as<local_ordinal_type> (localRow - numMyRowsA));
372template<
class MatrixType>
375 return std::max<size_t>(A_->getGlobalMaxNumRowEntries(), ExtMatrix_->getGlobalMaxNumRowEntries());
379template<
class MatrixType>
382 return MaxNumEntries_;
386template<
class MatrixType>
393template<
class MatrixType>
400template<
class MatrixType>
407template<
class MatrixType>
414template<
class MatrixType>
418 nonconst_global_inds_host_view_type &Indices,
419 nonconst_values_host_view_type &Values,
420 size_t& NumEntries)
const
422 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix::getGlobalRowCopy() not supported.");
425template<
class MatrixType>
429 nonconst_local_inds_host_view_type &Indices,
430 nonconst_values_host_view_type &Values,
431 size_t& NumEntries)
const
434 const size_t numMyRowsA = A_->getLocalNumRows ();
435 if (as<size_t> (LocalRow) < numMyRowsA) {
436 A_->getLocalRowCopy (LocalRow, Indices, Values, NumEntries);
438 ExtMatrix_->getLocalRowCopy (LocalRow - as<local_ordinal_type> (numMyRowsA),
439 Indices, Values, NumEntries);
443template<
class MatrixType>
447 global_inds_host_view_type &indices,
448 values_host_view_type &values)
const {
449 const local_ordinal_type LocalRow = RowMap_->getLocalElement (GlobalRow);
450 if (LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid()) {
451 indices = global_inds_host_view_type();
452 values = values_host_view_type();
454 if (Teuchos::as<size_t> (LocalRow) < A_->getLocalNumRows ()) {
455 A_->getGlobalRowView (GlobalRow, indices, values);
457 ExtMatrix_->getGlobalRowView (GlobalRow, indices, values);
462template<
class MatrixType>
466 local_inds_host_view_type & indices,
467 values_host_view_type & values)
const {
469 const size_t numMyRowsA = A_->getLocalNumRows ();
470 if (as<size_t> (LocalRow) < numMyRowsA) {
471 A_->getLocalRowView (LocalRow, indices, values);
473 ExtMatrix_->getLocalRowView (LocalRow - as<local_ordinal_type> (numMyRowsA),
479template<
class MatrixType>
482getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const
484 using Teuchos::Array;
487 vector_type baseDiag(A_->getRowMap());
488 A_->getLocalDiagCopy(baseDiag);
489 Array<scalar_type> baseDiagVals(baseDiag.getLocalLength());
490 baseDiag.get1dCopy(baseDiagVals());
492 vector_type extDiag(ExtMatrix_->getRowMap());
493 ExtMatrix_->getLocalDiagCopy(extDiag);
494 Array<scalar_type> extDiagVals(extDiag.getLocalLength());
495 extDiag.get1dCopy(extDiagVals());
497 Teuchos::ArrayRCP<scalar_type> allDiagVals = diag.getDataNonConst();
498 if (allDiagVals.size() != baseDiagVals.size() + extDiagVals.size()) {
499 std::ostringstream errStr;
500 errStr <<
"Ifpack2::OverlappingRowMatrix::getLocalDiagCopy : Mismatch in diagonal lengths, "
501 << allDiagVals.size() <<
" != " << baseDiagVals.size() <<
"+" << extDiagVals.size();
502 throw std::runtime_error(errStr.str());
504 for (Teuchos::Ordinal i=0; i<baseDiagVals.size(); ++i)
505 allDiagVals[i] = baseDiagVals[i];
506 Teuchos_Ordinal offset=baseDiagVals.size();
507 for (Teuchos::Ordinal i=0; i<extDiagVals.size(); ++i)
508 allDiagVals[i+offset] = extDiagVals[i];
512template<
class MatrixType>
515leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
517 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
521template<
class MatrixType>
524rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
526 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
530template<
class MatrixType>
531typename OverlappingRowMatrix<MatrixType>::mag_type
534 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support getFrobeniusNorm.");
538template<
class MatrixType>
541apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
542 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
543 Teuchos::ETransp mode,
545 scalar_type beta)
const
547 using MV = Tpetra::MultiVector<scalar_type, local_ordinal_type,
548 global_ordinal_type, node_type>;
549 TEUCHOS_TEST_FOR_EXCEPTION
550 (X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
551 "Ifpack2::OverlappingRowMatrix::apply: X.getNumVectors() = "
552 << X.getNumVectors() <<
" != Y.getNumVectors() = " << Y.getNumVectors()
555 bool aliases = X.aliases(Y);
557 MV X_copy (X, Teuchos::Copy);
558 this->apply (X_copy, Y, mode, alpha, beta);
562 const auto& rowMap0 = * (A_->getRowMap ());
563 const auto& colMap0 = * (A_->getColMap ());
564 MV X_0 (X, mode == Teuchos::NO_TRANS ? colMap0 : rowMap0, 0);
565 MV Y_0 (Y, mode == Teuchos::NO_TRANS ? rowMap0 : colMap0, 0);
566 A_->localApply (X_0, Y_0, mode, alpha, beta);
568 const auto& rowMap1 = * (ExtMatrix_->getRowMap ());
569 const auto& colMap1 = * (ExtMatrix_->getColMap ());
570 MV X_1 (X, mode == Teuchos::NO_TRANS ? colMap1 : rowMap1, 0);
571 MV Y_1 (Y, mode == Teuchos::NO_TRANS ? rowMap1 : colMap1, A_->getLocalNumRows ());
572 ExtMatrix_->localApply (X_1, Y_1, mode, alpha, beta);
576template<
class MatrixType>
579importMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
580 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
581 Tpetra::CombineMode CM)
583 OvX.doImport (X, *Importer_, CM);
587template<
class MatrixType>
589OverlappingRowMatrix<MatrixType>::
590exportMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
591 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
592 Tpetra::CombineMode CM)
594 X.doExport (OvX, *Importer_, CM);
598template<
class MatrixType>
605template<
class MatrixType>
611template<
class MatrixType>
614 std::ostringstream oss;
615 if (isFillComplete()) {
616 oss <<
"{ isFillComplete: true"
617 <<
", global rows: " << getGlobalNumRows()
618 <<
", global columns: " << getGlobalNumCols()
619 <<
", global entries: " << getGlobalNumEntries()
623 oss <<
"{ isFillComplete: false"
624 <<
", global rows: " << getGlobalNumRows()
630template<
class MatrixType>
631void OverlappingRowMatrix<MatrixType>::describe(Teuchos::FancyOStream &out,
632 const Teuchos::EVerbosityLevel verbLevel)
const
637 using Teuchos::VERB_DEFAULT;
638 using Teuchos::VERB_NONE;
639 using Teuchos::VERB_LOW;
640 using Teuchos::VERB_MEDIUM;
641 using Teuchos::VERB_HIGH;
642 using Teuchos::VERB_EXTREME;
645 using Teuchos::ArrayView;
647 Teuchos::EVerbosityLevel vl = verbLevel;
648 if (vl == VERB_DEFAULT) {
651 RCP<const Teuchos::Comm<int> > comm = this->getComm();
652 const int myRank = comm->getRank();
653 const int numProcs = comm->getSize();
655 for (
size_t dec=10; dec<getGlobalNumRows(); dec *= 10) {
658 width = std::max<size_t> (width, as<size_t> (11)) + 2;
659 Teuchos::OSTab tab(out);
667 if (vl != VERB_NONE) {
669 out << this->description() << std::endl;
676 if (vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME) {
678 out << endl <<
"Row map:" << endl;
680 getRowMap()->describe(out,vl);
682 if (getColMap() != null) {
683 if (getColMap() == getRowMap()) {
685 out << endl <<
"Column map is row map.";
690 out << endl <<
"Column map:" << endl;
692 getColMap()->describe(out,vl);
695 if (getDomainMap() != null) {
696 if (getDomainMap() == getRowMap()) {
698 out << endl <<
"Domain map is row map.";
701 else if (getDomainMap() == getColMap()) {
703 out << endl <<
"Domain map is column map.";
708 out << endl <<
"Domain map:" << endl;
710 getDomainMap()->describe(out,vl);
713 if (getRangeMap() != null) {
714 if (getRangeMap() == getDomainMap()) {
716 out << endl <<
"Range map is domain map." << endl;
719 else if (getRangeMap() == getRowMap()) {
721 out << endl <<
"Range map is row map." << endl;
726 out << endl <<
"Range map: " << endl;
728 getRangeMap()->describe(out,vl);
736 if (vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME) {
737 for (
int curRank = 0; curRank < numProcs; ++curRank) {
738 if (myRank == curRank) {
739 out <<
"Process rank: " << curRank << std::endl;
740 out <<
" Number of entries: " << getLocalNumEntries() << std::endl;
741 out <<
" Max number of entries per row: " << getLocalMaxNumRowEntries() << std::endl;
749 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
750 for (
int curRank = 0; curRank < numProcs; ++curRank) {
751 if (myRank == curRank) {
752 out << std::setw(width) <<
"Proc Rank"
753 << std::setw(width) <<
"Global Row"
754 << std::setw(width) <<
"Num Entries";
755 if (vl == VERB_EXTREME) {
756 out << std::setw(width) <<
"(Index,Value)";
759 for (
size_t r = 0; r < getLocalNumRows (); ++r) {
760 const size_t nE = getNumEntriesInLocalRow(r);
761 typename MatrixType::global_ordinal_type gid = getRowMap()->getGlobalElement(r);
762 out << std::setw(width) << myRank
763 << std::setw(width) << gid
764 << std::setw(width) << nE;
765 if (vl == VERB_EXTREME) {
766 if (isGloballyIndexed()) {
767 global_inds_host_view_type rowinds;
768 values_host_view_type rowvals;
769 getGlobalRowView (gid, rowinds, rowvals);
770 for (
size_t j = 0; j < nE; ++j) {
771 out <<
" (" << rowinds[j]
772 <<
", " << rowvals[j]
776 else if (isLocallyIndexed()) {
777 local_inds_host_view_type rowinds;
778 values_host_view_type rowvals;
779 getLocalRowView (r, rowinds, rowvals);
780 for (
size_t j=0; j < nE; ++j) {
781 out <<
" (" << getColMap()->getGlobalElement(rowinds[j])
782 <<
", " << rowvals[j]
796 out.setOutputToRootOnly(0);
797 out <<
"===========\nlocal matrix\n=================" << std::endl;
798 out.setOutputToRootOnly(-1);
799 A_->describe(out,Teuchos::VERB_EXTREME);
800 out.setOutputToRootOnly(0);
801 out <<
"===========\nend of local matrix\n=================" << std::endl;
803 out.setOutputToRootOnly(0);
804 out <<
"=================\nghost matrix\n=================" << std::endl;
805 out.setOutputToRootOnly(-1);
806 ExtMatrix_->describe(out,Teuchos::VERB_EXTREME);
807 out.setOutputToRootOnly(0);
808 out <<
"===========\nend of ghost matrix\n=================" << std::endl;
813template<
class MatrixType>
814Teuchos::RCP<const Tpetra::CrsMatrix<typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
815OverlappingRowMatrix<MatrixType>::getUnderlyingMatrix()
const
820template<
class MatrixType>
821Teuchos::RCP<const Tpetra::CrsMatrix<typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
822OverlappingRowMatrix<MatrixType>::getExtMatrix()
const
827template<
class MatrixType>
828Kokkos::View<size_t*, typename OverlappingRowMatrix<MatrixType>::device_type>
829OverlappingRowMatrix<MatrixType>::getExtHaloStarts()
const
831 return ExtHaloStarts_;
834template<
class MatrixType>
835typename Kokkos::View<size_t*, typename OverlappingRowMatrix<MatrixType>::device_type>::HostMirror
836OverlappingRowMatrix<MatrixType>::getExtHaloStartsHost()
const
838 return ExtHaloStarts_h;
841template<
class MatrixType>
842void OverlappingRowMatrix<MatrixType>::doExtImport()
847 ExtMatrix_ = rcp (
new crs_matrix_type (ExtMap_, ColMap_, 0));
848 ExtMatrix_->doImport (*A_, *ExtImporter_, Tpetra::INSERT);
849 ExtMatrix_->fillComplete (A_->getDomainMap (), RowMap_);
854#define IFPACK2_OVERLAPPINGROWMATRIX_INSTANT(S,LO,GO,N) \
855 template class Ifpack2::OverlappingRowMatrix< Tpetra::RowMatrix<S, LO, GO, N> >;
Sparse graph (Tpetra::RowGraph subclass) with ghost rows.
Definition: Ifpack2_Details_OverlappingRowGraph_decl.hpp:66
Sparse matrix (Tpetra::RowMatrix subclass) with ghost rows.
Definition: Ifpack2_OverlappingRowMatrix_decl.hpp:59
virtual void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Computes the operator-multivector application.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:541
virtual bool hasTransposeApply() const
Whether this operator's apply() method can apply the adjoint (transpose).
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:599
virtual Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRangeMap() const
The Map that describes the range of this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:279
virtual void getLocalRowCopy(local_ordinal_type LocalRow, nonconst_local_inds_host_view_type &Indices, nonconst_values_host_view_type &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the graph. Put into storage allocated by callin...
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:428
virtual bool isLocallyIndexed() const
Whether this matrix is locally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:394
virtual size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const
The number of entries in the given global row that are owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:346
virtual void getLocalRowView(local_ordinal_type LocalRow, local_inds_host_view_type &indices, values_host_view_type &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:465
virtual void getGlobalRowCopy(global_ordinal_type GlobalRow, nonconst_global_inds_host_view_type &Indices, nonconst_values_host_view_type &Values, size_t &NumEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:417
virtual Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getColMap() const
The Map that describes the distribution of columns over processes.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:254
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries in any row on any process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:373
virtual global_size_t getGlobalNumCols() const
The global number of columns in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:301
virtual bool isGloballyIndexed() const
Whether this matrix is globally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:401
virtual global_ordinal_type getIndexBase() const
The index base for global indices for this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:323
virtual size_t getLocalNumEntries() const
The number of entries in this matrix owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:337
virtual Teuchos::RCP< const Tpetra::RowGraph< local_ordinal_type, global_ordinal_type, node_type > > getGraph() const
This matrix's graph.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:287
virtual size_t getLocalNumCols() const
The number of columns owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:315
virtual size_t getLocalNumRows() const
The number of rows owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:308
virtual void getGlobalRowView(global_ordinal_type GlobalRow, global_inds_host_view_type &indices, values_host_view_type &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:446
virtual size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const
The number of entries in the given local row that are owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:360
virtual void rightScale(const Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &x)
Scales the RowMatrix on the right with the Vector x.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:524
virtual bool hasColMap() const
Whether this matrix has a column Map.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:387
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:235
virtual global_size_t getGlobalNumRows() const
The global number of rows in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:294
virtual bool supportsRowViews() const
true if row views are supported, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:606
virtual global_size_t getGlobalNumEntries() const
The global number of entries in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:330
virtual Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRowMap() const
The Map that describes the distribution of rows over processes.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:245
virtual void leftScale(const Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &x)
Scales the RowMatrix on the left with the Vector x.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:515
OverlappingRowMatrix(const Teuchos::RCP< const row_matrix_type > &A, const int overlapLevel)
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:59
virtual size_t getLocalMaxNumRowEntries() const
The maximum number of entries in any row on the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:380
virtual bool isFillComplete() const
true if fillComplete() has been called, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:408
virtual mag_type getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:532
virtual void getLocalDiagCopy(Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:482
virtual Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getDomainMap() const
The Map that describes the domain of this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:263
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:74