43 #ifndef IFPACK2_LOCALFILTER_DEF_HPP 44 #define IFPACK2_LOCALFILTER_DEF_HPP 46 #include <Ifpack2_LocalFilter_decl.hpp> 47 #include <Tpetra_Map.hpp> 48 #include <Tpetra_MultiVector.hpp> 49 #include <Tpetra_Vector.hpp> 52 # include "Teuchos_DefaultMpiComm.hpp" 54 # include "Teuchos_DefaultSerialComm.hpp" 60 template<
class MatrixType>
62 LocalFilter<MatrixType>::
63 mapPairsAreFitted (
const row_matrix_type& A)
65 const map_type& rangeMap = * (A.getRangeMap ());
66 const map_type& rowMap = * (A.getRowMap ());
67 const bool rangeAndRowFitted = mapPairIsFitted (rangeMap, rowMap);
69 const map_type& domainMap = * (A.getDomainMap ());
70 const map_type& columnMap = * (A.getColMap ());
71 const bool domainAndColumnFitted = mapPairIsFitted (domainMap, columnMap);
73 return rangeAndRowFitted && domainAndColumnFitted;
77 template<
class MatrixType>
79 LocalFilter<MatrixType>::
80 mapPairIsFitted (
const map_type& map1,
const map_type& map2)
82 return Tpetra::Details::isLocallyFitted (map1, map2);
86 template<
class MatrixType>
97 #ifdef HAVE_IFPACK2_DEBUG 98 TEUCHOS_TEST_FOR_EXCEPTION(
99 ! mapPairsAreFitted (*A), std::invalid_argument,
"Ifpack2::LocalFilter: " 100 "A's Map pairs are not fitted to each other on Process " 101 << A_->getRowMap ()->getComm ()->getRank () <<
" of the input matrix's " 103 "This means that LocalFilter does not currently know how to work with A. " 104 "This will change soon. Please see discussion of Bug 5992.");
105 #endif // HAVE_IFPACK2_DEBUG 108 RCP<const Teuchos::Comm<int> > localComm;
110 localComm = rcp (
new Teuchos::MpiComm<int> (MPI_COMM_SELF));
112 localComm = rcp (
new Teuchos::SerialComm<int> ());
138 const size_t numRows = A_->getRangeMap()->getNodeNumElements ();
149 rcp (
new map_type (numRows, indexBase, localComm,
150 Tpetra::GloballyDistributed, A_->getNode ()));
153 localRangeMap_ = localRowMap_;
157 if (A_->getRangeMap ().getRawPtr () == A_->getDomainMap ().getRawPtr ()) {
160 localDomainMap_ = localRangeMap_;
163 const size_t numCols = A_->getDomainMap()->getNodeNumElements ();
165 rcp (
new map_type (numCols, indexBase, localComm,
166 Tpetra::GloballyDistributed, A_->getNode ()));
172 NumEntries_.resize (numRows);
176 MaxNumEntries_ = A_->getNodeMaxNumRowEntries ();
177 MaxNumEntriesA_ = A_->getNodeMaxNumRowEntries ();
180 localIndices_.resize (MaxNumEntries_);
181 Values_.resize (MaxNumEntries_);
190 size_t ActualMaxNumEntries = 0;
192 for (
size_t i = 0; i < numRows; ++i) {
194 size_t Nnz, NewNnz = 0;
195 A_->getLocalRowCopy (i, localIndices_, Values_, Nnz);
196 for (
size_t j = 0; j < Nnz; ++j) {
208 if (static_cast<size_t> (localIndices_[j]) < numRows) {
213 if (NewNnz > ActualMaxNumEntries) {
214 ActualMaxNumEntries = NewNnz;
217 NumNonzeros_ += NewNnz;
218 NumEntries_[i] = NewNnz;
221 MaxNumEntries_ = ActualMaxNumEntries;
225 template<
class MatrixType>
230 template<
class MatrixType>
231 Teuchos::RCP<const Teuchos::Comm<int> >
234 return localRowMap_->getComm ();
238 template<
class MatrixType>
239 Teuchos::RCP<typename MatrixType::node_type>
242 return A_->getNode ();
246 template<
class MatrixType>
247 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
248 typename MatrixType::global_ordinal_type,
249 typename MatrixType::node_type> >
256 template<
class MatrixType>
257 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
258 typename MatrixType::global_ordinal_type,
259 typename MatrixType::node_type> >
266 template<
class MatrixType>
267 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
268 typename MatrixType::global_ordinal_type,
269 typename MatrixType::node_type> >
272 return localDomainMap_;
276 template<
class MatrixType>
277 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
278 typename MatrixType::global_ordinal_type,
279 typename MatrixType::node_type> >
282 return localRangeMap_;
286 template<
class MatrixType>
287 Teuchos::RCP<
const Tpetra::RowGraph<
typename MatrixType::local_ordinal_type,
288 typename MatrixType::global_ordinal_type,
289 typename MatrixType::node_type> >
295 return A_->getGraph ();
299 template<
class MatrixType>
302 return static_cast<global_size_t
> (localRangeMap_->getNodeNumElements ());
306 template<
class MatrixType>
309 return static_cast<global_size_t
> (localDomainMap_->getNodeNumElements ());
313 template<
class MatrixType>
316 return static_cast<size_t> (localRangeMap_->getNodeNumElements ());
320 template<
class MatrixType>
323 return static_cast<size_t> (localDomainMap_->getNodeNumElements ());
327 template<
class MatrixType>
328 typename MatrixType::global_ordinal_type
331 return A_->getIndexBase ();
335 template<
class MatrixType>
342 template<
class MatrixType>
349 template<
class MatrixType>
355 if (localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
363 return NumEntries_[localRow];
368 template<
class MatrixType>
378 if (getRowMap ()->isNodeLocalElement (localRow)) {
379 return NumEntries_[localRow];
391 template<
class MatrixType>
394 return A_->getGlobalNumDiags ();
398 template<
class MatrixType>
401 return A_->getNodeNumDiags ();
405 template<
class MatrixType>
408 return MaxNumEntries_;
412 template<
class MatrixType>
415 return MaxNumEntries_;
419 template<
class MatrixType>
426 template<
class MatrixType>
429 return A_->isLowerTriangular();
433 template<
class MatrixType>
436 return A_->isUpperTriangular();
440 template<
class MatrixType>
443 return A_->isLocallyIndexed ();
447 template<
class MatrixType>
450 return A_->isGloballyIndexed();
454 template<
class MatrixType>
457 return A_->isFillComplete ();
461 template<
class MatrixType>
465 const Teuchos::ArrayView<global_ordinal_type>& globalIndices,
466 const Teuchos::ArrayView<scalar_type>& values,
467 size_t& numEntries)
const 470 typedef typename Teuchos::Array<LO>::size_type size_type;
472 const LO localRow = this->getRowMap ()->getLocalElement (globalRow);
473 if (localRow == Teuchos::OrdinalTraits<LO>::invalid ()) {
485 numEntries = this->getNumEntriesInLocalRow (localRow);
489 Teuchos::Array<LO> localIndices (numEntries);
490 this->getLocalRowCopy (localRow, localIndices (), values, numEntries);
492 const map_type& colMap = * (this->getColMap ());
495 const size_type numEnt =
496 std::min (static_cast<size_type> (numEntries),
497 std::min (globalIndices.size (), values.size ()));
498 for (size_type k = 0; k < numEnt; ++k) {
499 globalIndices[k] = colMap.getGlobalElement (localIndices[k]);
505 template<
class MatrixType>
509 const Teuchos::ArrayView<local_ordinal_type> &Indices,
510 const Teuchos::ArrayView<scalar_type> &Values,
511 size_t &NumEntries)
const 516 if (! A_->getRowMap ()->isNodeLocalElement (LocalRow)) {
522 if (A_->getRowMap()->getComm()->getSize() == 1) {
523 A_->getLocalRowCopy (LocalRow, Indices (), Values (), NumEntries);
528 const size_t numEntInLclRow = NumEntries_[LocalRow];
529 if (static_cast<size_t> (Indices.size ()) < numEntInLclRow ||
530 static_cast<size_t> (Values.size ()) < numEntInLclRow) {
534 TEUCHOS_TEST_FOR_EXCEPTION(
535 true, std::runtime_error,
536 "Ifpack2::LocalFilter::getLocalRowCopy: Invalid output array length. " 537 "The output arrays must each have length at least " << numEntInLclRow
538 <<
" for local row " << LocalRow <<
" on Process " 539 << localRowMap_->getComm ()->getRank () <<
".");
541 else if (numEntInLclRow == static_cast<size_t> (0)) {
560 size_t numEntInMat = 0;
561 A_->getLocalRowCopy (LocalRow, localIndices_ (), Values_ (), numEntInMat);
566 const map_type& matrixDomMap = * (A_->getDomainMap ());
567 const map_type& matrixColMap = * (A_->getColMap ());
569 const size_t capacity =
static_cast<size_t> (std::min (Indices.size (),
572 const size_t numRows = localRowMap_->getNodeNumElements ();
573 const bool buggy =
true;
574 for (
size_t j = 0; j < numEntInMat; ++j) {
580 const LO matrixLclCol = localIndices_[j];
581 const GO gblCol = matrixColMap.getGlobalElement (matrixLclCol);
590 if ((
size_t) localIndices_[j] < numRows) {
591 Indices[NumEntries] = localIndices_[j];
592 Values[NumEntries] = Values_[j];
596 if (matrixDomMap.isNodeGlobalElement (gblCol)) {
600 if (NumEntries < capacity) {
601 Indices[NumEntries] = matrixLclCol;
602 Values[NumEntries] = Values_[j];
611 template<
class MatrixType>
615 Teuchos::ArrayView<const global_ordinal_type> &indices,
616 Teuchos::ArrayView<const scalar_type> &values)
const 618 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
619 "Ifpack2::LocalFilter does not implement getGlobalRowView.");
623 template<
class MatrixType>
627 Teuchos::ArrayView<const local_ordinal_type> &indices,
628 Teuchos::ArrayView<const scalar_type> &values)
const 630 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
631 "Ifpack2::LocalFilter does not implement getLocalRowView.");
635 template<
class MatrixType>
638 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const 645 RCP<vector_type> diagView = diag.offsetViewNonConst (A_->getRowMap (), 0);
646 A_->getLocalDiagCopy (*diagView);
650 template<
class MatrixType>
653 leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x)
655 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
656 "Ifpack2::LocalFilter does not implement leftScale.");
660 template<
class MatrixType>
663 rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x)
665 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
666 "Ifpack2::LocalFilter does not implement rightScale.");
670 template<
class MatrixType>
673 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
674 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
675 Teuchos::ETransp mode,
679 typedef Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> MV;
680 TEUCHOS_TEST_FOR_EXCEPTION(
681 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
682 "Ifpack2::LocalFilter::apply: X and Y must have the same number of columns. " 683 "X has " << X.getNumVectors () <<
" columns, but Y has " 684 << Y.getNumVectors () <<
" columns.");
686 #ifdef HAVE_IFPACK2_DEBUG 688 typedef Teuchos::ScalarTraits<magnitude_type> STM;
689 Teuchos::Array<magnitude_type> norms (X.getNumVectors ());
692 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
693 if (STM::isnaninf (norms[j])) {
698 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the input X is NaN or Inf.");
700 #endif // HAVE_IFPACK2_DEBUG 708 MV X_copy (X, Teuchos::Copy);
709 applyNonAliased (X_copy, Y, mode, alpha, beta);
711 applyNonAliased (X, Y, mode, alpha, beta);
714 #ifdef HAVE_IFPACK2_DEBUG 716 typedef Teuchos::ScalarTraits<magnitude_type> STM;
717 Teuchos::Array<magnitude_type> norms (Y.getNumVectors ());
720 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
721 if (STM::isnaninf (norms[j])) {
726 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the output Y is NaN or Inf.");
728 #endif // HAVE_IFPACK2_DEBUG 731 template<
class MatrixType>
734 applyNonAliased (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
735 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
736 Teuchos::ETransp mode,
738 scalar_type beta)
const 740 using Teuchos::ArrayView;
741 using Teuchos::ArrayRCP;
742 typedef Teuchos::ScalarTraits<scalar_type> STS;
744 const scalar_type
zero = STS::zero ();
745 const scalar_type one = STS::one ();
750 else if (beta != one) {
754 const size_t NumVectors = Y.getNumVectors ();
755 const size_t numRows = localRowMap_->getNodeNumElements ();
762 const bool constantStride = X.isConstantStride () && Y.isConstantStride ();
763 if (constantStride) {
766 const size_t x_stride = X.getStride();
767 const size_t y_stride = Y.getStride();
768 ArrayRCP<scalar_type> y_rcp = Y.get1dViewNonConst();
769 ArrayRCP<const scalar_type> x_rcp = X.get1dView();
770 ArrayView<scalar_type> y_ptr = y_rcp();
771 ArrayView<const scalar_type> x_ptr = x_rcp();
772 for (
size_t i = 0; i < numRows; ++i) {
775 getLocalRowCopy (i, localIndices_ (), Values_ (), Nnz);
776 if (mode == Teuchos::NO_TRANS) {
777 for (
size_t j = 0; j < Nnz; ++j) {
778 const local_ordinal_type col = localIndices_[j];
779 for (
size_t k = 0; k < NumVectors; ++k) {
780 y_ptr[i + y_stride*k] +=
781 alpha * Values_[j] * x_ptr[col + x_stride*k];
785 else if (mode == Teuchos::TRANS) {
786 for (
size_t j = 0; j < Nnz; ++j) {
787 const local_ordinal_type col = localIndices_[j];
788 for (
size_t k = 0; k < NumVectors; ++k) {
789 y_ptr[col + y_stride*k] +=
790 alpha * Values_[j] * x_ptr[i + x_stride*k];
795 for (
size_t j = 0; j < Nnz; ++j) {
796 const local_ordinal_type col = localIndices_[j];
797 for (
size_t k = 0; k < NumVectors; ++k) {
798 y_ptr[col + y_stride*k] +=
799 alpha * STS::conjugate (Values_[j]) * x_ptr[i + x_stride*k];
808 ArrayRCP<ArrayRCP<const scalar_type> > x_ptr = X.get2dView();
809 ArrayRCP<ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
811 for (
size_t i = 0; i < numRows; ++i) {
814 getLocalRowCopy (i, localIndices_ (), Values_ (), Nnz);
815 if (mode == Teuchos::NO_TRANS) {
816 for (
size_t k = 0; k < NumVectors; ++k) {
817 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
818 ArrayView<scalar_type> y_local = (y_ptr())[k]();
819 for (
size_t j = 0; j < Nnz; ++j) {
820 y_local[i] += alpha * Values_[j] * x_local[localIndices_[j]];
824 else if (mode == Teuchos::TRANS) {
825 for (
size_t k = 0; k < NumVectors; ++k) {
826 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
827 ArrayView<scalar_type> y_local = (y_ptr())[k]();
828 for (
size_t j = 0; j < Nnz; ++j) {
829 y_local[localIndices_[j]] += alpha * Values_[j] * x_local[i];
834 for (
size_t k = 0; k < NumVectors; ++k) {
835 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
836 ArrayView<scalar_type> y_local = (y_ptr())[k]();
837 for (
size_t j = 0; j < Nnz; ++j) {
838 y_local[localIndices_[j]] +=
839 alpha * STS::conjugate (Values_[j]) * x_local[i];
847 template<
class MatrixType>
854 template<
class MatrixType>
861 template<
class MatrixType>
863 LocalFilter<MatrixType>::mag_type
866 #ifdef TPETRA_HAVE_KOKKOS_REFACTOR 867 typedef Kokkos::Details::ArithTraits<scalar_type> STS;
868 typedef Kokkos::Details::ArithTraits<mag_type> STM;
870 typedef Teuchos::ScalarTraits<scalar_type> STS;
871 typedef Teuchos::ScalarTraits<magnitude_type> STM;
873 typedef typename Teuchos::Array<scalar_type>::size_type size_type;
875 const size_type maxNumRowEnt = getNodeMaxNumRowEntries ();
876 Teuchos::Array<local_ordinal_type> ind (maxNumRowEnt);
877 Teuchos::Array<scalar_type> val (maxNumRowEnt);
878 const size_t numRows =
static_cast<size_t> (localRowMap_->getNodeNumElements ());
881 mag_type sumSquared = STM::zero ();
882 for (
size_t i = 0; i < numRows; ++i) {
883 size_t numEntries = 0;
884 this->getLocalRowCopy (i, ind (), val (), numEntries);
885 for (size_type k = 0; k < static_cast<size_type> (numEntries); ++k) {
886 const mag_type v_k_abs = STS::magnitude (val[k]);
887 sumSquared += v_k_abs * v_k_abs;
890 return STM::squareroot (sumSquared);
893 template<
class MatrixType>
897 using Teuchos::TypeNameTraits;
898 std::ostringstream os;
900 os <<
"Ifpack2::LocalFilter: {";
901 os <<
"MatrixType: " << TypeNameTraits<MatrixType>::name ();
902 if (this->getObjectLabel () !=
"") {
903 os <<
", Label: \"" << this->getObjectLabel () <<
"\"";
905 os <<
", Number of rows: " << getGlobalNumRows ()
906 <<
", Number of columns: " << getGlobalNumCols ()
912 template<
class MatrixType>
916 const Teuchos::EVerbosityLevel verbLevel)
const 918 using Teuchos::OSTab;
919 using Teuchos::TypeNameTraits;
922 const Teuchos::EVerbosityLevel vl =
923 (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
925 if (vl > Teuchos::VERB_NONE) {
929 out <<
"Ifpack2::LocalFilter:" << endl;
931 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
932 if (this->getObjectLabel () !=
"") {
933 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
935 out <<
"Number of rows: " << getGlobalNumRows () << endl
936 <<
"Number of columns: " << getGlobalNumCols () << endl
937 <<
"Number of nonzeros: " << NumNonzeros_ << endl;
939 if (vl > Teuchos::VERB_LOW) {
940 out <<
"Row Map:" << endl;
941 localRowMap_->describe (out, vl);
942 out <<
"Domain Map:" << endl;
943 localDomainMap_->describe (out, vl);
944 out <<
"Range Map:" << endl;
945 localRangeMap_->describe (out, vl);
950 template<
class MatrixType>
951 Teuchos::RCP<
const Tpetra::RowMatrix<
typename MatrixType::scalar_type,
952 typename MatrixType::local_ordinal_type,
953 typename MatrixType::global_ordinal_type,
954 typename MatrixType::node_type> >
963 #define IFPACK2_LOCALFILTER_INSTANT(S,LO,GO,N) \ 964 template class Ifpack2::LocalFilter< Tpetra::RowMatrix<S, LO, GO, N> >; 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_LocalFilter_def.hpp:626
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_LocalFilter_def.hpp:455
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_LocalFilter_def.hpp:663
virtual mag_type getFrobeniusNorm() const
The Frobenius norm of the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:864
virtual Teuchos::RCP< const row_matrix_type > getUnderlyingMatrix() const
Return matrix that LocalFilter was built on.
Definition: Ifpack2_LocalFilter_def.hpp:955
virtual global_size_t getGlobalNumCols() const
The number of global columns in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:307
virtual bool isUpperTriangular() const
Whether this matrix is upper triangular.
Definition: Ifpack2_LocalFilter_def.hpp:434
virtual bool isLocallyIndexed() const
Whether the underlying sparse matrix is locally (opposite of globally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:441
virtual size_t getNodeNumDiags() const
The number of local diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_LocalFilter_def.hpp:399
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object to the given output stream.
Definition: Ifpack2_LocalFilter_def.hpp:915
virtual size_t getNodeNumCols() const
The number of columns in the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:321
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_LocalFilter_def.hpp:614
virtual global_size_t getGlobalNumDiags() const
The number of global diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_LocalFilter_def.hpp:392
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:190
virtual global_size_t getGlobalNumRows() const
The number of global rows in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:300
virtual Teuchos::RCP< const map_type > getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:280
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Type of the Tpetra::Map specialization that this class uses.
Definition: Ifpack2_LocalFilter_decl.hpp:207
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_LocalFilter_def.hpp:855
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:187
virtual Teuchos::RCP< const map_type > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:260
virtual void getGlobalRowCopy(global_ordinal_type GlobalRow, const Teuchos::ArrayView< global_ordinal_type > &Indices, const Teuchos::ArrayView< scalar_type > &Values, size_t &NumEntries) const
Get the entries in the given row, using global indices.
Definition: Ifpack2_LocalFilter_def.hpp:464
virtual void getLocalRowCopy(local_ordinal_type LocalRow, const Teuchos::ArrayView< local_ordinal_type > &Indices, const Teuchos::ArrayView< scalar_type > &Values, size_t &NumEntries) const
Get the entries in the given row, using local indices.
Definition: Ifpack2_LocalFilter_def.hpp:508
virtual bool isLowerTriangular() const
Whether this matrix is lower triangular.
Definition: Ifpack2_LocalFilter_def.hpp:427
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_LocalFilter_def.hpp:653
virtual Teuchos::RCP< const Tpetra::RowGraph< local_ordinal_type, global_ordinal_type, node_type > > getGraph() const
The (locally filtered) matrix's graph.
Definition: Ifpack2_LocalFilter_def.hpp:290
virtual size_t getNodeNumRows() const
The number of rows owned on the calling process.
Definition: Ifpack2_LocalFilter_def.hpp:314
LinearOp zero(const VectorSpace &vs)
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
Compute Y = beta*Y + alpha*A_local*X.
Definition: Ifpack2_LocalFilter_def.hpp:673
virtual global_ordinal_type getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:329
virtual bool hasColMap() const
Whether this matrix has a well-defined column Map.
Definition: Ifpack2_LocalFilter_def.hpp:420
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on all processes.
Definition: Ifpack2_LocalFilter_def.hpp:406
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the communicator.
Definition: Ifpack2_LocalFilter_def.hpp:232
virtual std::string description() const
A one-line description of this object.
Definition: Ifpack2_LocalFilter_def.hpp:895
virtual size_t getNodeMaxNumRowEntries() const
The maximum number of entries across all rows/columns on this process.
Definition: Ifpack2_LocalFilter_def.hpp:413
LocalFilter(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_LocalFilter_def.hpp:88
virtual ~LocalFilter()
Destructor.
Definition: Ifpack2_LocalFilter_def.hpp:226
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:336
virtual Teuchos::RCP< const map_type > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:250
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:184
virtual size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:343
virtual bool isGloballyIndexed() const
Whether the underlying sparse matrix is globally (opposite of locally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:448
virtual void getLocalDiagCopy(Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &diag) const
Get the diagonal entries of the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:638
virtual Teuchos::RCP< node_type > getNode() const
Returns the underlying Node object.
Definition: Ifpack2_LocalFilter_def.hpp:240
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:160
virtual Teuchos::RCP< const map_type > getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:270
virtual size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const
The current number of entries on this node in the specified global row.
Definition: Ifpack2_LocalFilter_def.hpp:352
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
Definition: Ifpack2_LocalFilter_def.hpp:848
virtual size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const
The current number of entries on this node in the specified local row.
Definition: Ifpack2_LocalFilter_def.hpp:371
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:193