43 #ifndef IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP 44 #define IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP 48 #include <Ifpack2_OverlappingRowMatrix_decl.hpp> 49 #include <Ifpack2_Details_OverlappingRowGraph.hpp> 50 #include <Tpetra_CrsMatrix.hpp> 51 #include <Teuchos_CommHelpers.hpp> 55 template<
class MatrixType>
58 const int overlapLevel) :
60 OverlapLevel_ (overlapLevel)
65 using Teuchos::outArg;
66 using Teuchos::rcp_const_cast;
67 using Teuchos::rcp_dynamic_cast;
68 using Teuchos::rcp_implicit_cast;
69 using Teuchos::REDUCE_SUM;
70 using Teuchos::reduceAll;
71 typedef Tpetra::global_size_t GST;
72 typedef Tpetra::CrsGraph<local_ordinal_type,
73 global_ordinal_type, node_type> crs_graph_type;
74 TEUCHOS_TEST_FOR_EXCEPTION(
75 OverlapLevel_ <= 0, std::runtime_error,
76 "Ifpack2::OverlappingRowMatrix: OverlapLevel must be > 0.");
77 TEUCHOS_TEST_FOR_EXCEPTION(
78 A_->getComm()->getSize() == 1, std::runtime_error,
79 "Ifpack2::OverlappingRowMatrix: Matrix must be " 80 "distributed over more than one MPI process.");
82 RCP<const crs_matrix_type> ACRS =
83 rcp_dynamic_cast<
const crs_matrix_type,
const row_matrix_type> (A_);
84 TEUCHOS_TEST_FOR_EXCEPTION(
85 ACRS.is_null (), std::runtime_error,
86 "Ifpack2::OverlappingRowMatrix: The input matrix must be a Tpetra::" 87 "CrsMatrix with matching template parameters. This class currently " 88 "requires that CrsMatrix's fifth template parameter be the default.");
89 RCP<const crs_graph_type> A_crsGraph = ACRS->getCrsGraph ();
91 const size_t numMyRowsA = A_->getNodeNumRows ();
92 const global_ordinal_type global_invalid =
93 Teuchos::OrdinalTraits<global_ordinal_type>::invalid ();
96 Array<global_ordinal_type> ExtElements;
98 RCP<crs_graph_type> TmpGraph;
99 RCP<import_type> TmpImporter;
100 RCP<const map_type> RowMap, ColMap;
103 for (
int overlap = 0 ; overlap < OverlapLevel_ ; ++overlap) {
106 RowMap = A_->getRowMap ();
107 ColMap = A_->getColMap ();
110 RowMap = TmpGraph->getRowMap ();
111 ColMap = TmpGraph->getColMap ();
114 const size_t size = ColMap->getNodeNumElements () - RowMap->getNodeNumElements ();
115 Array<global_ordinal_type> mylist (size);
119 for (local_ordinal_type i = 0 ; (size_t) i < ColMap->getNodeNumElements() ; ++i) {
120 const global_ordinal_type GID = ColMap->getGlobalElement (i);
121 if (A_->getRowMap ()->getLocalElement (GID) == global_invalid) {
122 typedef typename Array<global_ordinal_type>::iterator iter_type;
123 const iter_type end = ExtElements.end ();
124 const iter_type pos = std::find (ExtElements.begin (), end, GID);
126 ExtElements.push_back (GID);
136 if (overlap + 1 < OverlapLevel_) {
143 TmpMap = rcp (
new map_type (global_invalid, mylist (0, count),
144 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
145 A_->getComm (), A_->getNode ()));
146 TmpGraph = rcp (
new crs_graph_type (TmpMap, 0));
147 TmpImporter = rcp (
new import_type (A_->getRowMap (), TmpMap));
149 TmpGraph->doImport (*A_crsGraph, *TmpImporter, Tpetra::INSERT);
150 TmpGraph->fillComplete (A_->getDomainMap (), TmpMap);
156 Array<global_ordinal_type> mylist (numMyRowsA + ExtElements.size ());
157 for (local_ordinal_type i = 0; (size_t)i < numMyRowsA; ++i) {
158 mylist[i] = A_->getRowMap ()->getGlobalElement (i);
160 for (local_ordinal_type i = 0; i < ExtElements.size (); ++i) {
161 mylist[i + numMyRowsA] = ExtElements[i];
164 RowMap_ = rcp (
new map_type (global_invalid, mylist (),
165 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
166 A_->getComm (), A_->getNode ()));
171 ExtMap_ = rcp (
new map_type (global_invalid, ExtElements (),
172 Teuchos::OrdinalTraits<global_ordinal_type>::zero (),
173 A_->getComm (), A_->getNode ()));
174 ExtMatrix_ = rcp (
new crs_matrix_type (ExtMap_, ColMap_, 0));
175 ExtImporter_ = rcp (
new import_type (A_->getRowMap (), ExtMap_));
177 RCP<crs_matrix_type> ExtMatrixCRS =
178 rcp_dynamic_cast<crs_matrix_type, row_matrix_type> (ExtMatrix_);
179 ExtMatrixCRS->doImport (*ACRS, *ExtImporter_, Tpetra::INSERT);
180 ExtMatrixCRS->fillComplete (A_->getDomainMap (), RowMap_);
182 Importer_ = rcp (
new import_type (A_->getRowMap (), RowMap_));
185 const size_t numMyRowsB = ExtMatrix_->getNodeNumRows ();
187 GST NumMyNonzeros_tmp = A_->getNodeNumEntries () + ExtMatrix_->getNodeNumEntries ();
188 GST NumMyRows_tmp = numMyRowsA + numMyRowsB;
190 GST inArray[2], outArray[2];
191 inArray[0] = NumMyNonzeros_tmp;
192 inArray[1] = NumMyRows_tmp;
195 reduceAll<int, GST> (* (A_->getComm ()), REDUCE_SUM, 2, inArray, outArray);
196 NumGlobalNonzeros_ = outArray[0];
197 NumGlobalRows_ = outArray[1];
204 MaxNumEntries_ = A_->getNodeMaxNumRowEntries ();
206 MaxNumEntries_ = ExtMatrix_->getNodeMaxNumRowEntries ();
211 RCP<row_graph_impl_type> graph =
212 rcp (
new row_graph_impl_type (A_->getGraph (),
213 ExtMatrix_->getGraph (),
220 rcp_const_cast<
const import_type> (Importer_),
221 rcp_const_cast<const import_type> (ExtImporter_)));
222 graph_ = rcp_const_cast<
const row_graph_type> (rcp_implicit_cast<row_graph_type> (graph));
224 Indices_.resize (MaxNumEntries_);
225 Values_.resize (MaxNumEntries_);
229 template<
class MatrixType>
233 template<
class MatrixType>
234 Teuchos::RCP<const Teuchos::Comm<int> >
237 return A_->getComm ();
241 template<
class MatrixType>
242 Teuchos::RCP<typename MatrixType::node_type>
245 return A_->getNode();
249 template<
class MatrixType>
250 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
258 template<
class MatrixType>
259 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
267 template<
class MatrixType>
268 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
283 template<
class MatrixType>
284 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
291 template<
class MatrixType>
292 Teuchos::RCP<const Tpetra::RowGraph<typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
299 template<
class MatrixType>
302 return NumGlobalRows_;
306 template<
class MatrixType>
309 return NumGlobalRows_;
313 template<
class MatrixType>
316 return A_->getNodeNumRows () + ExtMatrix_->getNodeNumRows ();
320 template<
class MatrixType>
327 template<
class MatrixType>
328 typename MatrixType::global_ordinal_type
331 return A_->getIndexBase();
335 template<
class MatrixType>
338 return NumGlobalNonzeros_;
342 template<
class MatrixType>
345 return A_->getNodeNumEntries () + ExtMatrix_->getNodeNumEntries ();
349 template<
class MatrixType>
354 const local_ordinal_type localRow = RowMap_->getLocalElement (globalRow);
355 if (localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
356 return Teuchos::OrdinalTraits<size_t>::invalid();
363 template<
class MatrixType>
369 const size_t numMyRowsA = A_->getNodeNumRows ();
370 if (as<size_t> (localRow) < numMyRowsA) {
371 return A_->getNumEntriesInLocalRow (localRow);
373 return ExtMatrix_->getNumEntriesInLocalRow (as<local_ordinal_type> (localRow - numMyRowsA));
378 template<
class MatrixType>
381 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix::getGlobalNumDiags() not supported.");
385 template<
class MatrixType>
388 return A_->getNodeNumDiags();
392 template<
class MatrixType>
395 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix::getGlobalMaxNumRowEntries() not supported.");
399 template<
class MatrixType>
402 return MaxNumEntries_;
406 template<
class MatrixType>
413 template<
class MatrixType>
416 return A_->isLowerTriangular();
420 template<
class MatrixType>
423 return A_->isUpperTriangular();
427 template<
class MatrixType>
434 template<
class MatrixType>
441 template<
class MatrixType>
448 template<
class MatrixType>
452 const Teuchos::ArrayView<global_ordinal_type> &Indices,
453 const Teuchos::ArrayView<scalar_type>& Values,
454 size_t& NumEntries)
const 456 const local_ordinal_type LocalRow = RowMap_->getLocalElement (GlobalRow);
457 if (LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
458 NumEntries = Teuchos::OrdinalTraits<size_t>::invalid ();
460 if (Teuchos::as<size_t> (LocalRow) < A_->getNodeNumRows ()) {
461 A_->getGlobalRowCopy (GlobalRow, Indices, Values, NumEntries);
463 ExtMatrix_->getGlobalRowCopy (GlobalRow, Indices, Values, NumEntries);
469 template<
class MatrixType>
473 const Teuchos::ArrayView<local_ordinal_type> &Indices,
474 const Teuchos::ArrayView<scalar_type> &Values,
475 size_t &NumEntries)
const 478 const size_t numMyRowsA = A_->getNodeNumRows ();
479 if (as<size_t> (LocalRow) < numMyRowsA) {
480 A_->getLocalRowCopy (LocalRow, Indices, Values, NumEntries);
482 ExtMatrix_->getLocalRowCopy (LocalRow - as<local_ordinal_type> (numMyRowsA),
483 Indices, Values, NumEntries);
488 template<
class MatrixType>
492 Teuchos::ArrayView<const global_ordinal_type>& indices,
493 Teuchos::ArrayView<const scalar_type>& values)
const 495 const local_ordinal_type LocalRow = RowMap_->getLocalElement (GlobalRow);
496 if (LocalRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid()) {
497 indices = Teuchos::null;
498 values = Teuchos::null;
500 if (Teuchos::as<size_t> (LocalRow) < A_->getNodeNumRows ()) {
501 A_->getGlobalRowView (GlobalRow, indices, values);
503 ExtMatrix_->getGlobalRowView (GlobalRow, indices, values);
509 template<
class MatrixType>
513 Teuchos::ArrayView<const local_ordinal_type>& indices,
514 Teuchos::ArrayView<const scalar_type>& values)
const 517 const size_t numMyRowsA = A_->getNodeNumRows ();
518 if (as<size_t> (LocalRow) < numMyRowsA) {
519 A_->getLocalRowView (LocalRow, indices, values);
521 ExtMatrix_->getLocalRowView (LocalRow - as<local_ordinal_type> (numMyRowsA),
527 template<
class MatrixType>
530 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const 532 using Teuchos::Array;
535 vector_type baseDiag(A_->getRowMap());
536 A_->getLocalDiagCopy(baseDiag);
537 Array<scalar_type> baseDiagVals(baseDiag.getLocalLength());
538 baseDiag.get1dCopy(baseDiagVals());
540 vector_type extDiag(ExtMatrix_->getRowMap());
541 ExtMatrix_->getLocalDiagCopy(extDiag);
542 Array<scalar_type> extDiagVals(extDiag.getLocalLength());
543 extDiag.get1dCopy(extDiagVals());
545 Teuchos::ArrayRCP<scalar_type> allDiagVals = diag.getDataNonConst();
546 if (allDiagVals.size() != baseDiagVals.size() + extDiagVals.size()) {
547 std::ostringstream errStr;
548 errStr <<
"Ifpack2::OverlappingRowMatrix::getLocalDiagCopy : Mismatch in diagonal lengths, " 549 << allDiagVals.size() <<
" != " << baseDiagVals.size() <<
"+" << extDiagVals.size();
550 throw std::runtime_error(errStr.str());
552 for (Teuchos::Ordinal i=0; i<baseDiagVals.size(); ++i)
553 allDiagVals[i] = baseDiagVals[i];
554 Teuchos_Ordinal offset=baseDiagVals.size();
555 for (Teuchos::Ordinal i=0; i<extDiagVals.size(); ++i)
556 allDiagVals[i+offset] = extDiagVals[i];
560 template<
class MatrixType>
563 leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x)
565 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
569 template<
class MatrixType>
572 rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x)
574 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
578 template<
class MatrixType>
579 typename OverlappingRowMatrix<MatrixType>::mag_type
582 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support getFrobeniusNorm.");
586 template<
class MatrixType>
589 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
590 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
591 Teuchos::ETransp mode,
593 scalar_type beta)
const 595 using Teuchos::ArrayRCP;
597 typedef scalar_type RangeScalar;
598 typedef scalar_type DomainScalar;
599 typedef Teuchos::ScalarTraits<RangeScalar> STRS;
601 TEUCHOS_TEST_FOR_EXCEPTION(
602 alpha != Teuchos::ScalarTraits<scalar_type>::one () ||
603 beta != Teuchos::ScalarTraits<scalar_type>::zero (), std::logic_error,
604 "Ifpack2::ReorderFilter::apply is only implemented for alpha = 1 and " 605 "beta = 0. You set alpha = " << alpha <<
" and beta = " << beta <<
".");
606 TEUCHOS_TEST_FOR_EXCEPTION(
607 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
608 "Ifpack2::OverlappingRowMatrix::apply: The input X and the output Y must " 609 "have the same number of columns. X.getNumVectors() = " 610 << X.getNumVectors() <<
" != Y.getNumVectors() = " << Y.getNumVectors()
618 const RangeScalar zero = STRS::zero ();
619 ArrayRCP<ArrayRCP<const DomainScalar> > x_ptr = X.get2dView();
620 ArrayRCP<ArrayRCP<RangeScalar> > y_ptr = Y.get2dViewNonConst();
622 size_t NumVectors = Y.getNumVectors();
624 const size_t numMyRowsA = A_->getNodeNumRows ();
625 for (
size_t i = 0; i < numMyRowsA; ++i) {
628 A_->getLocalRowCopy (i, Indices_ (),Values_ (), Nnz);
629 if (mode == Teuchos::NO_TRANS) {
630 for (
size_t j = 0; j < Nnz; ++j)
631 for (
size_t k = 0; k < NumVectors; ++k)
632 y_ptr[k][i] += as<RangeScalar> (Values_[j]) *
633 as<RangeScalar> (x_ptr[k][Indices_[j]]);
635 else if (mode == Teuchos::TRANS){
636 for (
size_t j = 0; j < Nnz; ++j)
637 for (
size_t k = 0; k < NumVectors; ++k)
638 y_ptr[k][Indices_[j]] += as<RangeScalar> (Values_[j]) *
639 as<RangeScalar> (x_ptr[k][i]);
642 for (
size_t j = 0; j < Nnz; ++j)
643 for (
size_t k = 0; k < NumVectors; ++k)
644 y_ptr[k][Indices_[j]] +=
645 STRS::conjugate (as<RangeScalar> (Values_[j])) *
646 as<RangeScalar> (x_ptr[k][i]);
650 const size_t numMyRowsB = ExtMatrix_->getNodeNumRows ();
651 for (
size_t i = 0 ; i < numMyRowsB ; ++i) {
654 ExtMatrix_->getLocalRowCopy (i, Indices_ (), Values_ (), Nnz);
655 if (mode == Teuchos::NO_TRANS) {
656 for (
size_t j = 0; j < Nnz; ++j)
657 for (
size_t k = 0; k < NumVectors; ++k)
658 y_ptr[k][numMyRowsA+i] += as<RangeScalar> (Values_[j]) *
659 as<RangeScalar> (x_ptr[k][Indices_[j]]);
661 else if (mode == Teuchos::TRANS) {
662 for (
size_t j = 0; j < Nnz; ++j)
663 for (
size_t k = 0; k < NumVectors; ++k)
664 y_ptr[k][numMyRowsA+Indices_[j]] += as<RangeScalar> (Values_[j]) *
665 as<RangeScalar> (x_ptr[k][i]);
668 for (
size_t j = 0; j < Nnz; ++j)
669 for (
size_t k = 0; k < NumVectors; ++k)
670 y_ptr[k][numMyRowsA+Indices_[j]] +=
671 STRS::conjugate (as<RangeScalar> (Values_[j])) *
672 as<RangeScalar> (x_ptr[k][i]);
678 template<
class MatrixType>
681 importMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
682 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
683 Tpetra::CombineMode CM)
685 OvX.doImport (X, *Importer_, CM);
689 template<
class MatrixType>
692 exportMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
693 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
694 Tpetra::CombineMode CM)
696 X.doExport (OvX, *Importer_, CM);
700 template<
class MatrixType>
707 template<
class MatrixType>
713 template<
class MatrixType>
716 std::ostringstream oss;
718 oss <<
"{ isFillComplete: true" 725 oss <<
"{ isFillComplete: false" 732 template<
class MatrixType>
734 const Teuchos::EVerbosityLevel verbLevel)
const 739 using Teuchos::VERB_DEFAULT;
740 using Teuchos::VERB_NONE;
741 using Teuchos::VERB_LOW;
742 using Teuchos::VERB_MEDIUM;
743 using Teuchos::VERB_HIGH;
744 using Teuchos::VERB_EXTREME;
747 using Teuchos::ArrayView;
749 Teuchos::EVerbosityLevel vl = verbLevel;
750 if (vl == VERB_DEFAULT) {
753 RCP<const Teuchos::Comm<int> > comm = this->
getComm();
754 const int myRank = comm->getRank();
755 const int numProcs = comm->getSize();
760 width = std::max<size_t> (width, as<size_t> (11)) + 2;
761 Teuchos::OSTab tab(out);
769 if (vl != VERB_NONE) {
771 out << this->description() << std::endl;
779 if (vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME) {
781 out << endl <<
"Row map:" << endl;
788 out << endl <<
"Column map is row map.";
793 out << endl <<
"Column map:" << endl;
801 out << endl <<
"Domain map is row map.";
806 out << endl <<
"Domain map is column map.";
811 out << endl <<
"Domain map:" << endl;
819 out << endl <<
"Range map is domain map." << endl;
824 out << endl <<
"Range map is row map." << endl;
829 out << endl <<
"Range map: " << endl;
839 if (vl == VERB_MEDIUM || vl == VERB_HIGH || vl == VERB_EXTREME) {
840 for (
int curRank = 0; curRank < numProcs; ++curRank) {
841 if (myRank == curRank) {
842 out <<
"Process rank: " << curRank << std::endl;
845 out <<
" Number of diagonal entries: " <<
getNodeNumDiags() << std::endl;
855 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
856 for (
int curRank = 0; curRank < numProcs; ++curRank) {
857 if (myRank == curRank) {
858 out << std::setw(width) <<
"Proc Rank" 859 << std::setw(width) <<
"Global Row" 860 << std::setw(width) <<
"Num Entries";
861 if (vl == VERB_EXTREME) {
862 out << std::setw(width) <<
"(Index,Value)";
867 typename MatrixType::global_ordinal_type gid =
getRowMap()->getGlobalElement(r);
868 out << std::setw(width) << myRank
869 << std::setw(width) << gid
870 << std::setw(width) << nE;
871 if (vl == VERB_EXTREME) {
873 ArrayView<const typename MatrixType::global_ordinal_type> rowinds;
874 ArrayView<const typename MatrixType::scalar_type> rowvals;
876 for (
size_t j = 0; j < nE; ++j) {
877 out <<
" (" << rowinds[j]
878 <<
", " << rowvals[j]
883 ArrayView<const typename MatrixType::local_ordinal_type> rowinds;
884 ArrayView<const typename MatrixType::scalar_type> rowvals;
886 for (
size_t j=0; j < nE; ++j) {
887 out <<
" (" <<
getColMap()->getGlobalElement(rowinds[j])
888 <<
", " << rowvals[j]
902 out.setOutputToRootOnly(0);
903 out <<
"===========\nlocal matrix\n=================" << std::endl;
904 out.setOutputToRootOnly(-1);
905 A_->describe(out,Teuchos::VERB_EXTREME);
906 out.setOutputToRootOnly(0);
907 out <<
"===========\nend of local matrix\n=================" << std::endl;
909 out.setOutputToRootOnly(0);
910 out <<
"=================\nghost matrix\n=================" << std::endl;
911 out.setOutputToRootOnly(-1);
912 ExtMatrix_->describe(out,Teuchos::VERB_EXTREME);
913 out.setOutputToRootOnly(0);
914 out <<
"===========\nend of ghost matrix\n=================" << std::endl;
919 template<
class MatrixType>
920 Teuchos::RCP<const Tpetra::RowMatrix<typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type> >
929 #define IFPACK2_OVERLAPPINGROWMATRIX_INSTANT(S,LO,GO,N) \ 930 template class Ifpack2::OverlappingRowMatrix< Tpetra::RowMatrix<S, LO, GO, N> >; 932 #endif // IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP 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:269
virtual global_size_t getGlobalNumDiags() const
The global number of diagonal entries.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:379
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:285
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:293
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:491
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:260
virtual bool hasTransposeApply() const
Whether this operator's apply() method can apply the adjoint (transpose).
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:701
virtual mag_type getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:580
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:352
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:235
virtual bool isUpperTriangular() const
Whether this matrix is upper triangular.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:421
virtual bool isLocallyIndexed() const
Whether this matrix is locally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:428
virtual global_size_t getGlobalNumCols() const
The global number of columns in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:307
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:563
virtual bool isFillComplete() const
true if fillComplete() has been called, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:442
virtual bool isGloballyIndexed() const
Whether this matrix is globally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:435
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:251
virtual bool hasColMap() const
Whether this matrix has a column Map.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:407
virtual Teuchos::RCP< node_type > getNode() const
The matrix's Node instance.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:243
virtual bool isLowerTriangular() const
Whether this matrix is lower triangular.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:414
virtual size_t getNodeNumEntries() const
The number of entries in this matrix owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:343
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:512
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:472
virtual bool supportsRowViews() const
true if row views are supported, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:708
Sparse graph (Tpetra::RowGraph subclass) with ghost rows.
Definition: Ifpack2_Details_OverlappingRowGraph_decl.hpp:65
virtual size_t getNodeNumCols() const
The number of columns owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:321
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries in any row on any process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:393
~OverlappingRowMatrix()
Destructor.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:230
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:572
virtual size_t getNodeNumDiags() const
The number of diagonal entries owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:386
Sparse matrix (Tpetra::RowMatrix subclass) with ghost rows.
Definition: Ifpack2_OverlappingRowMatrix_decl.hpp:59
virtual size_t getNodeMaxNumRowEntries() const
The maximum number of entries in any row on the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:400
OverlappingRowMatrix(const Teuchos::RCP< const row_matrix_type > &A, const int overlapLevel)
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:57
virtual size_t getNodeNumRows() const
The number of rows owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:314
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:589
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
virtual global_size_t getGlobalNumEntries() const
The global number of entries in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:336
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:451
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:366
virtual global_ordinal_type getIndexBase() const
The index base for global indices for this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:329
virtual global_size_t getGlobalNumRows() const
The global number of rows in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:300
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:530