10 #ifndef IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP
11 #define IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP
15 #include <Ifpack2_OverlappingRowMatrix_decl.hpp>
16 #include <Ifpack2_Details_OverlappingRowGraph.hpp>
17 #include <Tpetra_CrsMatrix.hpp>
18 #include <Tpetra_Import.hpp>
19 #include "Tpetra_Map.hpp"
20 #include <Teuchos_CommHelpers.hpp>
21 #include <unordered_set>
25 template<
class MatrixType>
28 const int overlapLevel) :
29 A_ (Teuchos::rcp_dynamic_cast<const crs_matrix_type> (A, true)),
30 OverlapLevel_ (overlapLevel)
35 using Teuchos::outArg;
37 using Teuchos::reduceAll;
38 typedef Tpetra::global_size_t GST;
39 typedef Tpetra::CrsGraph<local_ordinal_type,
40 global_ordinal_type, node_type> crs_graph_type;
42 OverlapLevel_ <= 0, std::runtime_error,
43 "Ifpack2::OverlappingRowMatrix: OverlapLevel must be > 0.");
45 (A_.
is_null (), std::runtime_error,
46 "Ifpack2::OverlappingRowMatrix: The input matrix must be a "
47 "Tpetra::CrsMatrix with the same scalar_type, local_ordinal_type, "
48 "global_ordinal_type, and device_type typedefs as MatrixType.");
50 A_->getComm()->getSize() == 1, std::runtime_error,
51 "Ifpack2::OverlappingRowMatrix: Matrix must be "
52 "distributed over more than one MPI process.");
55 RCP<const crs_graph_type> A_crsGraph = A_->getCrsGraph ();
56 const size_t numMyRowsA = A_->getLocalNumRows ();
57 const global_ordinal_type global_invalid =
61 Array<global_ordinal_type> ExtElements;
65 std::unordered_set<global_ordinal_type> ExtElementSet;
67 RCP<crs_graph_type> TmpGraph;
68 RCP<import_type> TmpImporter;
69 RCP<const map_type> RowMap, ColMap;
70 Kokkos::resize(ExtHaloStarts_, OverlapLevel_+1);
71 ExtHaloStarts_h = Kokkos::create_mirror_view(ExtHaloStarts_);
74 for (
int overlap = 0 ; overlap < OverlapLevel_ ; ++overlap) {
75 ExtHaloStarts_h(overlap) = (size_t) ExtElements.size();
79 RowMap = A_->getRowMap ();
80 ColMap = A_->getColMap ();
83 RowMap = TmpGraph->getRowMap ();
84 ColMap = TmpGraph->getColMap ();
87 const size_t size = ColMap->getLocalNumElements () - RowMap->getLocalNumElements ();
88 Array<global_ordinal_type> mylist (size);
92 for (local_ordinal_type i = 0 ; (size_t) i < ColMap->getLocalNumElements() ; ++i) {
93 const global_ordinal_type GID = ColMap->getGlobalElement (i);
94 if (A_->getRowMap ()->getLocalElement (GID) == global_invalid) {
97 if(ExtElementSet.insert(GID).second)
99 ExtElements.push_back (GID);
108 if (overlap + 1 < OverlapLevel_) {
110 TmpMap =
rcp (
new map_type (global_invalid, mylist (0, count),
114 TmpGraph =
rcp (
new crs_graph_type (TmpMap, 0));
115 TmpImporter =
rcp (
new import_type (A_->getRowMap (), TmpMap));
118 TmpGraph->doImport (*A_crsGraph, *TmpImporter, Tpetra::INSERT);
119 TmpGraph->fillComplete (A_->getDomainMap (), TmpMap);
122 ExtHaloStarts_h[OverlapLevel_] = (size_t) ExtElements.size();
123 Kokkos::deep_copy(ExtHaloStarts_,ExtHaloStarts_h);
127 Array<global_ordinal_type> mylist (numMyRowsA + ExtElements.size ());
128 for (local_ordinal_type i = 0; (size_t)i < numMyRowsA; ++i) {
129 mylist[i] = A_->getRowMap ()->getGlobalElement (i);
131 for (local_ordinal_type i = 0; i < ExtElements.size (); ++i) {
132 mylist[i + numMyRowsA] = ExtElements[i];
136 RowMap_ =
rcp (
new map_type (global_invalid, mylist (),
139 Importer_ =
rcp (
new import_type (A_->getRowMap (), RowMap_));
144 ExtMap_ =
rcp (
new map_type (global_invalid, ExtElements (),
147 ExtImporter_ =
rcp (
new import_type (A_->getRowMap (), ExtMap_));
150 auto ExtMatrixDynGraph =
rcp (
new crs_matrix_type (ExtMap_, ColMap_, 0));
151 ExtMatrixDynGraph->doImport (*A_, *ExtImporter_, Tpetra::INSERT);
152 ExtMatrixDynGraph->fillComplete (A_->getDomainMap (), RowMap_);
153 auto ExtLclMatrix = ExtMatrixDynGraph->getLocalMatrixDevice();
154 auto ExtMatrixStaticGraph =
rcp (
new crs_graph_type(ExtLclMatrix.graph,
157 ExtMatrixDynGraph->getDomainMap(),
158 ExtMatrixDynGraph->getRangeMap()));
159 ExtMatrix_ =
rcp (
new crs_matrix_type(ExtMatrixStaticGraph, ExtLclMatrix.values));
160 ExtMatrix_->fillComplete ();
164 const size_t numMyRowsB = ExtMatrix_->getLocalNumRows ();
166 GST NumMyNonzeros_tmp = A_->getLocalNumEntries () + ExtMatrix_->getLocalNumEntries ();
167 GST NumMyRows_tmp = numMyRowsA + numMyRowsB;
169 GST inArray[2], outArray[2];
170 inArray[0] = NumMyNonzeros_tmp;
171 inArray[1] = NumMyRows_tmp;
174 reduceAll<int, GST> (* (A_->getComm ()), REDUCE_SUM, 2, inArray, outArray);
175 NumGlobalNonzeros_ = outArray[0];
176 NumGlobalRows_ = outArray[1];
183 MaxNumEntries_ = A_->getLocalMaxNumRowEntries ();
185 MaxNumEntries_ = ExtMatrix_->getLocalMaxNumRowEntries ();
190 RCP<row_graph_impl_type> graph =
191 rcp (
new row_graph_impl_type (A_->getGraph (),
192 ExtMatrix_->getGraph (),
201 graph_ = Teuchos::rcp_const_cast<
const row_graph_type>
202 (Teuchos::rcp_implicit_cast<row_graph_type> (graph));
204 Kokkos::resize(Indices_,MaxNumEntries_);
205 Kokkos::resize(Values_,MaxNumEntries_);
209 template<
class MatrixType>
213 return A_->getComm ();
219 template<
class MatrixType>
228 template<
class MatrixType>
237 template<
class MatrixType>
253 template<
class MatrixType>
261 template<
class MatrixType>
269 template<
class MatrixType>
272 return NumGlobalRows_;
276 template<
class MatrixType>
279 return NumGlobalRows_;
283 template<
class MatrixType>
286 return A_->getLocalNumRows () + ExtMatrix_->getLocalNumRows ();
290 template<
class MatrixType>
293 return this->getLocalNumRows ();
297 template<
class MatrixType>
298 typename MatrixType::global_ordinal_type
301 return A_->getIndexBase();
305 template<
class MatrixType>
308 return NumGlobalNonzeros_;
312 template<
class MatrixType>
315 return A_->getLocalNumEntries () + ExtMatrix_->getLocalNumEntries ();
319 template<
class MatrixType>
324 const local_ordinal_type localRow = RowMap_->getLocalElement (globalRow);
328 return getNumEntriesInLocalRow (localRow);
333 template<
class MatrixType>
339 const size_t numMyRowsA = A_->getLocalNumRows ();
340 if (as<size_t> (localRow) < numMyRowsA) {
341 return A_->getNumEntriesInLocalRow (localRow);
343 return ExtMatrix_->getNumEntriesInLocalRow (as<local_ordinal_type> (localRow - numMyRowsA));
348 template<
class MatrixType>
351 return std::max<size_t>(A_->getGlobalMaxNumRowEntries(), ExtMatrix_->getGlobalMaxNumRowEntries());
355 template<
class MatrixType>
358 return MaxNumEntries_;
361 template<
class MatrixType>
364 return A_->getBlockSize();
367 template<
class MatrixType>
374 template<
class MatrixType>
381 template<
class MatrixType>
388 template<
class MatrixType>
395 template<
class MatrixType>
399 nonconst_global_inds_host_view_type &Indices,
400 nonconst_values_host_view_type &Values,
401 size_t& NumEntries)
const
403 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix::getGlobalRowCopy() not supported.");
406 template<
class MatrixType>
410 nonconst_local_inds_host_view_type &Indices,
411 nonconst_values_host_view_type &Values,
412 size_t& NumEntries)
const
415 const size_t numMyRowsA = A_->getLocalNumRows ();
416 if (as<size_t> (LocalRow) < numMyRowsA) {
417 A_->getLocalRowCopy (LocalRow, Indices, Values, NumEntries);
419 ExtMatrix_->getLocalRowCopy (LocalRow - as<local_ordinal_type> (numMyRowsA),
420 Indices, Values, NumEntries);
424 template<
class MatrixType>
428 global_inds_host_view_type &indices,
429 values_host_view_type &values)
const {
430 const local_ordinal_type LocalRow = RowMap_->getLocalElement (GlobalRow);
432 indices = global_inds_host_view_type();
433 values = values_host_view_type();
435 if (Teuchos::as<size_t> (LocalRow) < A_->getLocalNumRows ()) {
436 A_->getGlobalRowView (GlobalRow, indices, values);
438 ExtMatrix_->getGlobalRowView (GlobalRow, indices, values);
443 template<
class MatrixType>
447 local_inds_host_view_type & indices,
448 values_host_view_type & values)
const {
450 const size_t numMyRowsA = A_->getLocalNumRows ();
451 if (as<size_t> (LocalRow) < numMyRowsA) {
452 A_->getLocalRowView (LocalRow, indices, values);
454 ExtMatrix_->getLocalRowView (LocalRow - as<local_ordinal_type> (numMyRowsA),
460 template<
class MatrixType>
463 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const
468 vector_type baseDiag(A_->getRowMap());
469 A_->getLocalDiagCopy(baseDiag);
470 Array<scalar_type> baseDiagVals(baseDiag.getLocalLength());
471 baseDiag.get1dCopy(baseDiagVals());
473 vector_type extDiag(ExtMatrix_->getRowMap());
474 ExtMatrix_->getLocalDiagCopy(extDiag);
475 Array<scalar_type> extDiagVals(extDiag.getLocalLength());
476 extDiag.get1dCopy(extDiagVals());
479 if (allDiagVals.
size() != baseDiagVals.size() + extDiagVals.size()) {
480 std::ostringstream errStr;
481 errStr <<
"Ifpack2::OverlappingRowMatrix::getLocalDiagCopy : Mismatch in diagonal lengths, "
482 << allDiagVals.
size() <<
" != " << baseDiagVals.size() <<
"+" << extDiagVals.size();
483 throw std::runtime_error(errStr.str());
485 for (Teuchos::Ordinal i=0; i<baseDiagVals.size(); ++i)
486 allDiagVals[i] = baseDiagVals[i];
487 Teuchos_Ordinal offset=baseDiagVals.
size();
488 for (Teuchos::Ordinal i=0; i<extDiagVals.size(); ++i)
489 allDiagVals[i+offset] = extDiagVals[i];
493 template<
class MatrixType>
496 leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
498 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
502 template<
class MatrixType>
505 rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
507 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support leftScale.");
511 template<
class MatrixType>
512 typename OverlappingRowMatrix<MatrixType>::mag_type
515 throw std::runtime_error(
"Ifpack2::OverlappingRowMatrix does not support getFrobeniusNorm.");
519 template<
class MatrixType>
522 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
523 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
526 scalar_type beta)
const
528 using MV = Tpetra::MultiVector<scalar_type, local_ordinal_type,
529 global_ordinal_type, node_type>;
531 (X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
532 "Ifpack2::OverlappingRowMatrix::apply: X.getNumVectors() = "
533 << X.getNumVectors() <<
" != Y.getNumVectors() = " << Y.getNumVectors()
536 bool aliases = X.aliases(Y);
539 this->apply (X_copy, Y, mode, alpha, beta);
543 const auto& rowMap0 = * (A_->getRowMap ());
544 const auto& colMap0 = * (A_->getColMap ());
547 A_->localApply (X_0, Y_0, mode, alpha, beta);
549 const auto& rowMap1 = * (ExtMatrix_->getRowMap ());
550 const auto& colMap1 = * (ExtMatrix_->getColMap ());
552 MV Y_1 (Y, mode ==
Teuchos::NO_TRANS ? rowMap1 : colMap1, A_->getLocalNumRows ());
553 ExtMatrix_->localApply (X_1, Y_1, mode, alpha, beta);
557 template<
class MatrixType>
560 importMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
561 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
562 Tpetra::CombineMode CM)
564 OvX.doImport (X, *Importer_, CM);
568 template<
class MatrixType>
570 OverlappingRowMatrix<MatrixType>::
571 exportMultiVector (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &OvX,
572 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
573 Tpetra::CombineMode CM)
575 X.doExport (OvX, *Importer_, CM);
579 template<
class MatrixType>
586 template<
class MatrixType>
592 template<
class MatrixType>
595 std::ostringstream oss;
596 if (isFillComplete()) {
597 oss <<
"{ isFillComplete: true"
598 <<
", global rows: " << getGlobalNumRows()
599 <<
", global columns: " << getGlobalNumCols()
600 <<
", global entries: " << getGlobalNumEntries()
604 oss <<
"{ isFillComplete: false"
605 <<
", global rows: " << getGlobalNumRows()
611 template<
class MatrixType>
632 RCP<const Teuchos::Comm<int> > comm = this->getComm();
633 const int myRank = comm->getRank();
634 const int numProcs = comm->getSize();
636 for (
size_t dec=10; dec<getGlobalNumRows(); dec *= 10) {
639 width = std::max<size_t> (width, as<size_t> (11)) + 2;
650 out << this->description() << std::endl;
659 out << endl <<
"Row map:" << endl;
661 getRowMap()->describe(out,vl);
663 if (getColMap() != null) {
664 if (getColMap() == getRowMap()) {
666 out << endl <<
"Column map is row map.";
671 out << endl <<
"Column map:" << endl;
673 getColMap()->describe(out,vl);
676 if (getDomainMap() != null) {
677 if (getDomainMap() == getRowMap()) {
679 out << endl <<
"Domain map is row map.";
682 else if (getDomainMap() == getColMap()) {
684 out << endl <<
"Domain map is column map.";
689 out << endl <<
"Domain map:" << endl;
691 getDomainMap()->describe(out,vl);
694 if (getRangeMap() != null) {
695 if (getRangeMap() == getDomainMap()) {
697 out << endl <<
"Range map is domain map." << endl;
700 else if (getRangeMap() == getRowMap()) {
702 out << endl <<
"Range map is row map." << endl;
707 out << endl <<
"Range map: " << endl;
709 getRangeMap()->describe(out,vl);
718 for (
int curRank = 0; curRank < numProcs; ++curRank) {
719 if (myRank == curRank) {
720 out <<
"Process rank: " << curRank << std::endl;
721 out <<
" Number of entries: " << getLocalNumEntries() << std::endl;
722 out <<
" Max number of entries per row: " << getLocalMaxNumRowEntries() << std::endl;
731 for (
int curRank = 0; curRank < numProcs; ++curRank) {
732 if (myRank == curRank) {
733 out << std::setw(width) <<
"Proc Rank"
734 << std::setw(width) <<
"Global Row"
735 << std::setw(width) <<
"Num Entries";
737 out << std::setw(width) <<
"(Index,Value)";
740 for (
size_t r = 0; r < getLocalNumRows (); ++r) {
741 const size_t nE = getNumEntriesInLocalRow(r);
742 typename MatrixType::global_ordinal_type gid = getRowMap()->getGlobalElement(r);
743 out << std::setw(width) << myRank
744 << std::setw(width) << gid
745 << std::setw(width) << nE;
747 if (isGloballyIndexed()) {
748 global_inds_host_view_type rowinds;
749 values_host_view_type rowvals;
750 getGlobalRowView (gid, rowinds, rowvals);
751 for (
size_t j = 0; j < nE; ++j) {
752 out <<
" (" << rowinds[j]
753 <<
", " << rowvals[j]
757 else if (isLocallyIndexed()) {
758 local_inds_host_view_type rowinds;
759 values_host_view_type rowvals;
760 getLocalRowView (r, rowinds, rowvals);
761 for (
size_t j=0; j < nE; ++j) {
762 out <<
" (" << getColMap()->getGlobalElement(rowinds[j])
763 <<
", " << rowvals[j]
778 out <<
"===========\nlocal matrix\n=================" << std::endl;
782 out <<
"===========\nend of local matrix\n=================" << std::endl;
785 out <<
"=================\nghost matrix\n=================" << std::endl;
789 out <<
"===========\nend of ghost matrix\n=================" << std::endl;
794 template<
class MatrixType>
796 OverlappingRowMatrix<MatrixType>::getUnderlyingMatrix()
const
801 template<
class MatrixType>
803 OverlappingRowMatrix<MatrixType>::getExtMatrix()
const
808 template<
class MatrixType>
809 Kokkos::View<size_t*, typename OverlappingRowMatrix<MatrixType>::device_type>
810 OverlappingRowMatrix<MatrixType>::getExtHaloStarts()
const
812 return ExtHaloStarts_;
815 template<
class MatrixType>
816 typename Kokkos::View<size_t*, typename OverlappingRowMatrix<MatrixType>::device_type>::HostMirror
817 OverlappingRowMatrix<MatrixType>::getExtHaloStartsHost()
const
819 return ExtHaloStarts_h;
822 template<
class MatrixType>
823 void OverlappingRowMatrix<MatrixType>::doExtImport()
825 ExtMatrix_->resumeFill();
826 ExtMatrix_->doImport (*A_, *ExtImporter_, Tpetra::REPLACE);
827 ExtMatrix_->fillComplete (A_->getDomainMap (), RowMap_);
832 #define IFPACK2_OVERLAPPINGROWMATRIX_INSTANT(S,LO,GO,N) \
833 template class Ifpack2::OverlappingRowMatrix< Tpetra::RowMatrix<S, LO, GO, N> >;
835 #endif // IFPACK2_OVERLAPPINGROWMATRIX_DEF_HPP
virtual bool isGloballyIndexed() const
Whether this matrix is globally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:382
virtual mag_type getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:513
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual bool isFillComplete() const
true if fillComplete() has been called, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:389
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:409
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:496
virtual size_t getLocalMaxNumRowEntries() const
The maximum number of entries in any row on the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:356
virtual size_t getLocalNumRows() const
The number of rows owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:284
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:211
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:221
virtual global_size_t getGlobalNumRows() const
The global number of rows in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:270
virtual global_size_t getGlobalNumCols() const
The global number of columns in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:277
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual bool isLocallyIndexed() const
Whether this matrix is locally indexed.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:375
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:398
virtual local_ordinal_type getBlockSize() const
The number of degrees of freedom per mesh point.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:362
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:255
virtual size_t getLocalNumCols() const
The number of columns owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:291
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:239
Sparse graph (Tpetra::RowGraph subclass) with ghost rows.
Definition: Ifpack2_Details_OverlappingRowGraph_decl.hpp:32
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:446
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
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:322
virtual global_size_t getGlobalNumEntries() const
The global number of entries in this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:306
virtual bool hasTransposeApply() const
Whether this operator's apply() method can apply the adjoint (transpose).
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:580
virtual global_ordinal_type getIndexBase() const
The index base for global indices for this matrix.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:299
virtual bool hasColMap() const
Whether this matrix has a column Map.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:368
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:427
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:336
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:505
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:263
TypeTo as(const TypeFrom &t)
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:463
Sparse matrix (Tpetra::RowMatrix subclass) with ghost rows.
Definition: Ifpack2_OverlappingRowMatrix_decl.hpp:25
OverlappingRowMatrix(const Teuchos::RCP< const row_matrix_type > &A, const int overlapLevel)
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:27
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:522
virtual size_t getLocalNumEntries() const
The number of entries in this matrix owned by the calling process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:313
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:230
virtual bool supportsRowViews() const
true if row views are supported, else false.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:587
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries in any row on any process.
Definition: Ifpack2_OverlappingRowMatrix_def.hpp:349