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>
56 template<
class MatrixType>
59 const int overlapLevel) :
60 A_ (Teuchos::rcp_dynamic_cast<const crs_matrix_type> (A, true)),
61 OverlapLevel_ (overlapLevel)
66 using Teuchos::outArg;
67 using Teuchos::REDUCE_SUM;
68 using Teuchos::reduceAll;
69 typedef Tpetra::global_size_t GST;
70 typedef Tpetra::CrsGraph<local_ordinal_type,
71 global_ordinal_type, node_type> crs_graph_type;
72 TEUCHOS_TEST_FOR_EXCEPTION(
73 OverlapLevel_ <= 0, std::runtime_error,
74 "Ifpack2::OverlappingRowMatrix: OverlapLevel must be > 0.");
75 TEUCHOS_TEST_FOR_EXCEPTION
76 (A_.is_null (), std::runtime_error,
77 "Ifpack2::OverlappingRowMatrix: The input matrix must be a "
78 "Tpetra::CrsMatrix with the same scalar_type, local_ordinal_type, "
79 "global_ordinal_type, and device_type typedefs as MatrixType.");
80 TEUCHOS_TEST_FOR_EXCEPTION(
81 A_->getComm()->getSize() == 1, std::runtime_error,
82 "Ifpack2::OverlappingRowMatrix: Matrix must be "
83 "distributed over more than one MPI process.");
85 RCP<const crs_graph_type> A_crsGraph = A_->getCrsGraph ();
86 const size_t numMyRowsA = A_->getNodeNumRows ();
87 const global_ordinal_type global_invalid =
88 Teuchos::OrdinalTraits<global_ordinal_type>::invalid ();
91 Array<global_ordinal_type> ExtElements;
93 RCP<crs_graph_type> TmpGraph;
94 RCP<import_type> TmpImporter;
95 RCP<const map_type> RowMap, ColMap;
98 for (
int overlap = 0 ; overlap < OverlapLevel_ ; ++overlap) {
101 RowMap = A_->getRowMap ();
102 ColMap = A_->getColMap ();
105 RowMap = TmpGraph->getRowMap ();
106 ColMap = TmpGraph->getColMap ();
109 const size_t size = ColMap->getNodeNumElements () - RowMap->getNodeNumElements ();
110 Array<global_ordinal_type> mylist (size);
114 for (local_ordinal_type i = 0 ; (size_t) i < ColMap->getNodeNumElements() ; ++i) {
115 const global_ordinal_type GID = ColMap->getGlobalElement (i);
116 if (A_->getRowMap ()->getLocalElement (GID) == global_invalid) {
117 typedef typename Array<global_ordinal_type>::iterator iter_type;
118 const iter_type end = ExtElements.end ();
119 const iter_type pos = std::find (ExtElements.begin (), end, GID);
121 ExtElements.push_back (GID);
131 if (overlap + 1 < OverlapLevel_) {
138 TmpMap = rcp (
new map_type (global_invalid, mylist (0, count),
139 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
141 TmpGraph = rcp (
new crs_graph_type (TmpMap, 0));
142 TmpImporter = rcp (
new import_type (A_->getRowMap (), TmpMap));
144 TmpGraph->doImport (*A_crsGraph, *TmpImporter, Tpetra::INSERT);
145 TmpGraph->fillComplete (A_->getDomainMap (), TmpMap);
151 Array<global_ordinal_type> mylist (numMyRowsA + ExtElements.size ());
152 for (local_ordinal_type i = 0; (size_t)i < numMyRowsA; ++i) {
153 mylist[i] = A_->getRowMap ()->getGlobalElement (i);
155 for (local_ordinal_type i = 0; i < ExtElements.size (); ++i) {
156 mylist[i + numMyRowsA] = ExtElements[i];
159 RowMap_ = rcp (
new map_type (global_invalid, mylist (),
160 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
162 Importer_ = rcp (
new import_type (A_->getRowMap (), RowMap_));
167 ExtMap_ = rcp (
new map_type (global_invalid, ExtElements (),
168 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
170 ExtImporter_ = rcp (
new import_type (A_->getRowMap (), ExtMap_));
173 RCP<crs_matrix_type> ExtMatrix_nc =
174 rcp (
new crs_matrix_type (ExtMap_, ColMap_, 0));
175 ExtMatrix_nc->doImport (*A_, *ExtImporter_, Tpetra::INSERT);
176 ExtMatrix_nc->fillComplete (A_->getDomainMap (), RowMap_);
177 ExtMatrix_ = ExtMatrix_nc;
181 const size_t numMyRowsB = ExtMatrix_->getNodeNumRows ();
183 GST NumMyNonzeros_tmp = A_->getNodeNumEntries () + ExtMatrix_->getNodeNumEntries ();
184 GST NumMyRows_tmp = numMyRowsA + numMyRowsB;
186 GST inArray[2], outArray[2];
187 inArray[0] = NumMyNonzeros_tmp;
188 inArray[1] = NumMyRows_tmp;
191 reduceAll<int, GST> (* (A_->getComm ()), REDUCE_SUM, 2, inArray, outArray);
192 NumGlobalNonzeros_ = outArray[0];
193 NumGlobalRows_ = outArray[1];
200 MaxNumEntries_ = A_->getNodeMaxNumRowEntries ();
202 MaxNumEntries_ = ExtMatrix_->getNodeMaxNumRowEntries ();
207 RCP<row_graph_impl_type> graph =
208 rcp (
new row_graph_impl_type (A_->getGraph (),
209 ExtMatrix_->getGraph (),
218 graph_ = Teuchos::rcp_const_cast<const row_graph_type>
219 (Teuchos::rcp_implicit_cast<row_graph_type> (graph));
221 Indices_.resize (MaxNumEntries_);
222 Values_.resize (MaxNumEntries_);
226 template<
class MatrixType>
227 Teuchos::RCP<const Teuchos::Comm<int> >
230 return A_->getComm ();
234 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
235 template<
class MatrixType>
237 Teuchos::RCP<typename MatrixType::node_type>
240 return Teuchos::null;
245 template<
class MatrixType>
246 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
254 template<
class MatrixType>
255 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
263 template<
class MatrixType>
264 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
279 template<
class MatrixType>
280 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
287 template<
class MatrixType>
288 Teuchos::RCP<const Tpetra::RowGraph<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
295 template<
class MatrixType>
298 return NumGlobalRows_;
302 template<
class MatrixType>
305 return NumGlobalRows_;
309 template<
class MatrixType>
312 return A_->getNodeNumRows () + ExtMatrix_->getNodeNumRows ();
316 template<
class MatrixType>
319 return this->getNodeNumRows ();
323 template<
class MatrixType>
324 typename MatrixType::global_ordinal_type
327 return A_->getIndexBase();
331 template<
class MatrixType>
334 return NumGlobalNonzeros_;
338 template<
class MatrixType>
341 return A_->getNodeNumEntries () + ExtMatrix_->getNodeNumEntries ();
345 template<
class MatrixType>
350 const local_ordinal_type localRow = RowMap_->getLocalElement (globalRow);
351 if (localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
352 return Teuchos::OrdinalTraits<size_t>::invalid();
354 return getNumEntriesInLocalRow (localRow);
359 template<
class MatrixType>
365 const size_t numMyRowsA = A_->getNodeNumRows ();
366 if (as<size_t> (localRow) < numMyRowsA) {
367 return A_->getNumEntriesInLocalRow (localRow);
369 return ExtMatrix_->getNumEntriesInLocalRow (as<local_ordinal_type> (localRow - numMyRowsA));
374 template<
class MatrixType>
377 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix::getGlobalMaxNumRowEntries() not supported.");
381 template<
class MatrixType>
384 return MaxNumEntries_;
388 template<
class MatrixType>
395 template<
class MatrixType>
402 template<
class MatrixType>
409 template<
class MatrixType>
416 template<
class MatrixType>
420 const Teuchos::ArrayView<global_ordinal_type> &Indices,
421 const Teuchos::ArrayView<scalar_type>& Values,
422 size_t& NumEntries)
const
424 const local_ordinal_type LocalRow = RowMap_->getLocalElement (GlobalRow);
425 if (LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
426 NumEntries = Teuchos::OrdinalTraits<size_t>::invalid ();
428 if (Teuchos::as<size_t> (LocalRow) < A_->getNodeNumRows ()) {
429 A_->getGlobalRowCopy (GlobalRow, Indices, Values, NumEntries);
431 ExtMatrix_->getGlobalRowCopy (GlobalRow, Indices, Values, NumEntries);
437 template<
class MatrixType>
441 const Teuchos::ArrayView<local_ordinal_type> &Indices,
442 const Teuchos::ArrayView<scalar_type> &Values,
443 size_t &NumEntries)
const
446 const size_t numMyRowsA = A_->getNodeNumRows ();
447 if (as<size_t> (LocalRow) < numMyRowsA) {
448 A_->getLocalRowCopy (LocalRow, Indices, Values, NumEntries);
450 ExtMatrix_->getLocalRowCopy (LocalRow - as<local_ordinal_type> (numMyRowsA),
451 Indices, Values, NumEntries);
456 template<
class MatrixType>
460 Teuchos::ArrayView<const global_ordinal_type>& indices,
461 Teuchos::ArrayView<const scalar_type>& values)
const
463 const local_ordinal_type LocalRow = RowMap_->getLocalElement (GlobalRow);
464 if (LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid()) {
465 indices = Teuchos::null;
466 values = Teuchos::null;
468 if (Teuchos::as<size_t> (LocalRow) < A_->getNodeNumRows ()) {
469 A_->getGlobalRowView (GlobalRow, indices, values);
471 ExtMatrix_->getGlobalRowView (GlobalRow, indices, values);
477 template<
class MatrixType>
481 Teuchos::ArrayView<const local_ordinal_type>& indices,
482 Teuchos::ArrayView<const scalar_type>& values)
const
485 const size_t numMyRowsA = A_->getNodeNumRows ();
486 if (as<size_t> (LocalRow) < numMyRowsA) {
487 A_->getLocalRowView (LocalRow, indices, values);
489 ExtMatrix_->getLocalRowView (LocalRow - as<local_ordinal_type> (numMyRowsA),
495 template<
class MatrixType>
498 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const
500 using Teuchos::Array;
503 vector_type baseDiag(A_->getRowMap());
504 A_->getLocalDiagCopy(baseDiag);
505 Array<scalar_type> baseDiagVals(baseDiag.getLocalLength());
506 baseDiag.get1dCopy(baseDiagVals());
508 vector_type extDiag(ExtMatrix_->getRowMap());
509 ExtMatrix_->getLocalDiagCopy(extDiag);
510 Array<scalar_type> extDiagVals(extDiag.getLocalLength());
511 extDiag.get1dCopy(extDiagVals());
513 Teuchos::ArrayRCP<scalar_type> allDiagVals = diag.getDataNonConst();
514 if (allDiagVals.size() != baseDiagVals.size() + extDiagVals.size()) {
515 std::ostringstream errStr;
516 errStr <<
"Ifpack2::OverlappingRowMatrix::getLocalDiagCopy : Mismatch in diagonal lengths, "
517 << allDiagVals.size() <<
" != " << baseDiagVals.size() <<
"+" << extDiagVals.size();
518 throw std::runtime_error(errStr.str());
520 for (Teuchos::Ordinal i=0; i<baseDiagVals.size(); ++i)
521 allDiagVals[i] = baseDiagVals[i];
522 Teuchos_Ordinal offset=baseDiagVals.size();
523 for (Teuchos::Ordinal i=0; i<extDiagVals.size(); ++i)
524 allDiagVals[i+offset] = extDiagVals[i];
528 template<
class MatrixType>
531 leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
533 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
537 template<
class MatrixType>
540 rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
542 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
546 template<
class MatrixType>
547 typename OverlappingRowMatrix<MatrixType>::mag_type
550 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support getFrobeniusNorm.");
554 template<
class MatrixType>
557 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
558 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
559 Teuchos::ETransp mode,
561 scalar_type beta)
const
563 using MV = Tpetra::MultiVector<scalar_type, local_ordinal_type,
564 global_ordinal_type, node_type>;
565 TEUCHOS_TEST_FOR_EXCEPTION
566 (X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
567 "Ifpack2::OverlappingRowMatrix::apply: X.getNumVectors() = "
568 << X.getNumVectors() <<
" != Y.getNumVectors() = " << Y.getNumVectors()
571 auto X_d = X.getLocalViewDevice ();
572 auto Y_d = Y.getLocalViewDevice ();
574 if (X_d.data () >= Y_d.data () + Y_d.span ()) {
577 else if (Y_d.data () >= X_d.data () + X_d.span ()) {
581 MV X_copy (X, Teuchos::Copy);
582 this->apply (X_copy, Y, mode, alpha, beta);
585 const auto& rowMap0 = * (A_->getRowMap ());
586 const auto& colMap0 = * (A_->getColMap ());
587 MV X_0 (X, mode == Teuchos::NO_TRANS ? colMap0 : rowMap0, 0);
588 MV Y_0 (Y, mode == Teuchos::NO_TRANS ? rowMap0 : colMap0, 0);
589 A_->localApply (X_0, Y_0, mode, alpha, beta);
591 const auto& rowMap1 = * (ExtMatrix_->getRowMap ());
592 const auto& colMap1 = * (ExtMatrix_->getColMap ());
593 MV X_1 (X, mode == Teuchos::NO_TRANS ? colMap1 : rowMap1, 0);
594 MV Y_1 (Y, mode == Teuchos::NO_TRANS ? rowMap1 : colMap1, A_->getNodeNumRows ());
595 ExtMatrix_->localApply (X_1, Y_1, mode, alpha, beta);
599 template<
class MatrixType>
602 importMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
603 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
604 Tpetra::CombineMode CM)
606 OvX.doImport (X, *Importer_, CM);
610 template<
class MatrixType>
612 OverlappingRowMatrix<MatrixType>::
613 exportMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
614 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
615 Tpetra::CombineMode CM)
617 X.doExport (OvX, *Importer_, CM);
621 template<
class MatrixType>
628 template<
class MatrixType>
634 template<
class MatrixType>
637 std::ostringstream oss;
638 if (isFillComplete()) {
639 oss <<
"{ isFillComplete: true"
640 <<
", global rows: " << getGlobalNumRows()
641 <<
", global columns: " << getGlobalNumCols()
642 <<
", global entries: " << getGlobalNumEntries()
646 oss <<
"{ isFillComplete: false"
647 <<
", global rows: " << getGlobalNumRows()
653 template<
class MatrixType>
654 void OverlappingRowMatrix<MatrixType>::describe(Teuchos::FancyOStream &out,
655 const Teuchos::EVerbosityLevel verbLevel)
const
660 using Teuchos::VERB_DEFAULT;
661 using Teuchos::VERB_NONE;
662 using Teuchos::VERB_LOW;
663 using Teuchos::VERB_MEDIUM;
664 using Teuchos::VERB_HIGH;
665 using Teuchos::VERB_EXTREME;
668 using Teuchos::ArrayView;
670 Teuchos::EVerbosityLevel vl = verbLevel;
671 if (vl == VERB_DEFAULT) {
674 RCP<const Teuchos::Comm<int> > comm = this->getComm();
675 const int myRank = comm->getRank();
676 const int numProcs = comm->getSize();
678 for (
size_t dec=10; dec<getGlobalNumRows(); dec *= 10) {
681 width = std::max<size_t> (width, as<size_t> (11)) + 2;
682 Teuchos::OSTab tab(out);
690 if (vl != VERB_NONE) {
692 out << this->description() << std::endl;
699 if (vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME) {
701 out << endl <<
"Row map:" << endl;
703 getRowMap()->describe(out,vl);
705 if (getColMap() !=
null) {
706 if (getColMap() == getRowMap()) {
708 out << endl <<
"Column map is row map.";
713 out << endl <<
"Column map:" << endl;
715 getColMap()->describe(out,vl);
718 if (getDomainMap() !=
null) {
719 if (getDomainMap() == getRowMap()) {
721 out << endl <<
"Domain map is row map.";
724 else if (getDomainMap() == getColMap()) {
726 out << endl <<
"Domain map is column map.";
731 out << endl <<
"Domain map:" << endl;
733 getDomainMap()->describe(out,vl);
736 if (getRangeMap() !=
null) {
737 if (getRangeMap() == getDomainMap()) {
739 out << endl <<
"Range map is domain map." << endl;
742 else if (getRangeMap() == getRowMap()) {
744 out << endl <<
"Range map is row map." << endl;
749 out << endl <<
"Range map: " << endl;
751 getRangeMap()->describe(out,vl);
759 if (vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME) {
760 for (
int curRank = 0; curRank < numProcs; ++curRank) {
761 if (myRank == curRank) {
762 out <<
"Process rank: " << curRank << std::endl;
763 out <<
" Number of entries: " << getNodeNumEntries() << std::endl;
764 out <<
" Max number of entries per row: " << getNodeMaxNumRowEntries() << std::endl;
772 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
773 for (
int curRank = 0; curRank < numProcs; ++curRank) {
774 if (myRank == curRank) {
775 out << std::setw(width) <<
"Proc Rank"
776 << std::setw(width) <<
"Global Row"
777 << std::setw(width) <<
"Num Entries";
778 if (vl == VERB_EXTREME) {
779 out << std::setw(width) <<
"(Index,Value)";
782 for (
size_t r = 0; r < getNodeNumRows (); ++r) {
783 const size_t nE = getNumEntriesInLocalRow(r);
784 typename MatrixType::global_ordinal_type gid = getRowMap()->getGlobalElement(r);
785 out << std::setw(width) << myRank
786 << std::setw(width) << gid
787 << std::setw(width) << nE;
788 if (vl == VERB_EXTREME) {
789 if (isGloballyIndexed()) {
790 ArrayView<const typename MatrixType::global_ordinal_type> rowinds;
791 ArrayView<const typename MatrixType::scalar_type> rowvals;
792 getGlobalRowView (gid, rowinds, rowvals);
793 for (
size_t j = 0; j < nE; ++j) {
794 out <<
" (" << rowinds[j]
795 <<
", " << rowvals[j]
799 else if (isLocallyIndexed()) {
800 ArrayView<const typename MatrixType::local_ordinal_type> rowinds;
801 ArrayView<const typename MatrixType::scalar_type> rowvals;
802 getLocalRowView (r, rowinds, rowvals);
803 for (
size_t j=0; j < nE; ++j) {
804 out <<
" (" << getColMap()->getGlobalElement(rowinds[j])
805 <<
", " << rowvals[j]
819 out.setOutputToRootOnly(0);
820 out <<
"===========\nlocal matrix\n=================" << std::endl;
821 out.setOutputToRootOnly(-1);
822 A_->describe(out,Teuchos::VERB_EXTREME);
823 out.setOutputToRootOnly(0);
824 out <<
"===========\nend of local matrix\n=================" << std::endl;
826 out.setOutputToRootOnly(0);
827 out <<
"=================\nghost matrix\n=================" << std::endl;
828 out.setOutputToRootOnly(-1);
829 ExtMatrix_->describe(out,Teuchos::VERB_EXTREME);
830 out.setOutputToRootOnly(0);
831 out <<
"===========\nend of ghost matrix\n=================" << std::endl;
836 template<
class MatrixType>
837 Teuchos::RCP<const Tpetra::RowMatrix<typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
838 OverlappingRowMatrix<MatrixType>::getUnderlyingMatrix()
const
846 #define IFPACK2_OVERLAPPINGROWMATRIX_INSTANT(S,LO,GO,N) \
847 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 getGlobalRowView(global_ordinal_type GlobalRow, Teuchos::ArrayView< const global_ordinal_type > &indices, Teuchos::ArrayView< const scalar_type > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:459
virtual size_t getNodeNumRows() const
The number of rows owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:310
virtual size_t getNodeNumEntries() const
The number of entries in this matrix owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:339
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:557
virtual bool hasTransposeApply() const
Whether this operator's apply() method can apply the adjoint (transpose).
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:622
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:281
virtual size_t getNodeMaxNumRowEntries() const
The maximum number of entries in any row on the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:382
virtual void getLocalRowView(local_ordinal_type LocalRow, Teuchos::ArrayView< const local_ordinal_type > &indices, Teuchos::ArrayView< const scalar_type > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:480
virtual bool isLocallyIndexed() const
Whether this matrix is locally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:396
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:348
virtual void getLocalRowCopy(local_ordinal_type LocalRow, const Teuchos::ArrayView< local_ordinal_type > &Indices, const Teuchos::ArrayView< scalar_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:440
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:256
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries in any row on any process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:375
virtual global_size_t getGlobalNumCols() const
The global number of columns in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:303
virtual bool isGloballyIndexed() const
Whether this matrix is globally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:403
virtual size_t getNodeNumCols() const
The number of columns owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:317
virtual global_ordinal_type getIndexBase() const
The index base for global indices for this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:325
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:289
virtual void getGlobalRowCopy(global_ordinal_type GlobalRow, const Teuchos::ArrayView< global_ordinal_type > &Indices, const Teuchos::ArrayView< scalar_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:419
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:362
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:540
virtual bool hasColMap() const
Whether this matrix has a column Map.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:389
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:228
virtual global_size_t getGlobalNumRows() const
The global number of rows in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:296
virtual bool supportsRowViews() const
true if row views are supported, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:629
virtual global_size_t getGlobalNumEntries() const
The global number of entries in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:332
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:247
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:531
OverlappingRowMatrix(const Teuchos::RCP< const row_matrix_type > &A, const int overlapLevel)
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:58
virtual bool isFillComplete() const
true if fillComplete() has been called, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:410
virtual mag_type getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:548
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:498
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:265
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:73