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"
60template<
class MatrixType>
65 const map_type& rangeMap = * (A.getRangeMap ());
66 const map_type& rowMap = * (A.getRowMap ());
67 const bool rangeAndRowFitted = mapPairIsFitted (rowMap, rangeMap);
69 const map_type& domainMap = * (A.getDomainMap ());
70 const map_type& columnMap = * (A.getColMap ());
71 const bool domainAndColumnFitted = mapPairIsFitted (columnMap, domainMap);
78 int localSuccess = rangeAndRowFitted && domainAndColumnFitted;
81 Teuchos::reduceAll<int, int> (*(A.getComm()), Teuchos::REDUCE_MIN, localSuccess, Teuchos::outArg (globalSuccess));
83 return globalSuccess == 1;
87template<
class MatrixType>
92 return map1.isLocallyFitted (map2);
96template<
class MatrixType>
98LocalFilter (
const Teuchos::RCP<const row_matrix_type>& A) :
107#ifdef HAVE_IFPACK2_DEBUG
108 if(! mapPairsAreFitted (*A))
110 std::cout <<
"WARNING: Ifpack2::LocalFilter:\n" <<
111 "A's Map pairs are not fitted to each other on Process "
112 << A_->getRowMap ()->getComm ()->getRank () <<
" of the input matrix's "
114 "This means that LocalFilter may not work with A. "
115 "Please see discussion of Bug 5992.";
120 RCP<const Teuchos::Comm<int> > localComm;
122 localComm = rcp (
new Teuchos::MpiComm<int> (MPI_COMM_SELF));
124 localComm = rcp (
new Teuchos::SerialComm<int> ());
151 const size_t numRows = A_->getRangeMap()->getLocalNumElements () / blockSize;
156 rcp (
new map_type (numRows, indexBase, localComm,
157 Tpetra::GloballyDistributed));
160 localRangeMap_ = localRowMap_;
164 if (A_->getRangeMap ().getRawPtr () == A_->getDomainMap ().getRawPtr ()) {
167 localDomainMap_ = localRangeMap_;
170 const size_t numCols = A_->getDomainMap()->getLocalNumElements () / blockSize;
172 rcp (
new map_type (numCols, indexBase, localComm,
173 Tpetra::GloballyDistributed));
179 NumEntries_.resize (numRows);
183 MaxNumEntries_ = A_->getLocalMaxNumRowEntries ();
184 MaxNumEntriesA_ = A_->getLocalMaxNumRowEntries ();
187 Kokkos::resize(localIndices_,MaxNumEntries_);
188 Kokkos::resize(localIndicesForGlobalCopy_,MaxNumEntries_);
189 Kokkos::resize(Values_,MaxNumEntries_*blockSize*blockSize);
198 size_t ActualMaxNumEntries = 0;
200 for (
size_t i = 0; i < numRows; ++i) {
202 size_t Nnz, NewNnz = 0;
203 A_->getLocalRowCopy (i, localIndices_, Values_, Nnz);
204 for (
size_t j = 0; j < Nnz; ++j) {
216 if (
static_cast<size_t> (localIndices_[j]) < numRows) {
221 if (NewNnz > ActualMaxNumEntries) {
222 ActualMaxNumEntries = NewNnz;
225 NumNonzeros_ += NewNnz;
226 NumEntries_[i] = NewNnz;
229 MaxNumEntries_ = ActualMaxNumEntries;
233template<
class MatrixType>
238template<
class MatrixType>
239Teuchos::RCP<const Teuchos::Comm<int> >
242 return localRowMap_->getComm ();
248template<
class MatrixType>
249Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
250 typename MatrixType::global_ordinal_type,
251 typename MatrixType::node_type> >
258template<
class MatrixType>
259Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
260 typename MatrixType::global_ordinal_type,
261 typename MatrixType::node_type> >
268template<
class MatrixType>
269Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
270 typename MatrixType::global_ordinal_type,
271 typename MatrixType::node_type> >
274 return localDomainMap_;
278template<
class MatrixType>
279Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
280 typename MatrixType::global_ordinal_type,
281 typename MatrixType::node_type> >
284 return localRangeMap_;
288template<
class MatrixType>
289Teuchos::RCP<
const Tpetra::RowGraph<
typename MatrixType::local_ordinal_type,
290 typename MatrixType::global_ordinal_type,
291 typename MatrixType::node_type> >
297 return A_->getGraph ();
301template<
class MatrixType>
304 return static_cast<global_size_t
> (localRangeMap_->getLocalNumElements ());
308template<
class MatrixType>
311 return static_cast<global_size_t
> (localDomainMap_->getLocalNumElements ());
315template<
class MatrixType>
318 return static_cast<size_t> (localRangeMap_->getLocalNumElements ());
322template<
class MatrixType>
325 return static_cast<size_t> (localDomainMap_->getLocalNumElements ());
329template<
class MatrixType>
330typename MatrixType::global_ordinal_type
333 return A_->getIndexBase ();
337template<
class MatrixType>
344template<
class MatrixType>
350template<
class MatrixType>
353 return A_->getBlockSize();
356template<
class MatrixType>
362 if (localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
370 return NumEntries_[localRow];
375template<
class MatrixType>
385 if (
getRowMap ()->isNodeLocalElement (localRow)) {
386 return NumEntries_[localRow];
398template<
class MatrixType>
401 return MaxNumEntries_;
405template<
class MatrixType>
408 return MaxNumEntries_;
412template<
class MatrixType>
419template<
class MatrixType>
422 return A_->isLocallyIndexed ();
426template<
class MatrixType>
429 return A_->isGloballyIndexed();
433template<
class MatrixType>
436 return A_->isFillComplete ();
440template<
class MatrixType>
444 nonconst_global_inds_host_view_type &globalIndices,
445 nonconst_values_host_view_type &values,
446 size_t& numEntries)
const
449 typedef typename Teuchos::Array<LO>::size_type size_type;
451 const LO localRow = this->
getRowMap ()->getLocalElement (globalRow);
452 if (localRow == Teuchos::OrdinalTraits<LO>::invalid ()) {
470 this->
getLocalRowCopy (localRow, localIndicesForGlobalCopy_, values, numEntries);
475 const size_type numEnt =
476 std::min (
static_cast<size_type
> (numEntries),
477 std::min ((size_type)globalIndices.size (), (size_type)values.size ()));
478 for (size_type k = 0; k < numEnt; ++k) {
479 globalIndices[k] = colMap.getGlobalElement (localIndicesForGlobalCopy_[k]);
485template<
class MatrixType>
489 nonconst_local_inds_host_view_type &Indices,
490 nonconst_values_host_view_type &Values,
491 size_t& NumEntries)
const
496 if (! A_->getRowMap ()->isNodeLocalElement (LocalRow)) {
502 if (A_->getRowMap()->getComm()->getSize() == 1) {
503 A_->getLocalRowCopy (LocalRow, Indices, Values, NumEntries);
509 const size_t numEntInLclRow = NumEntries_[LocalRow];
510 if (
static_cast<size_t> (Indices.size ()) < numEntInLclRow ||
511 static_cast<size_t> (Values.size ()) < numEntInLclRow*blockNumEntr) {
515 TEUCHOS_TEST_FOR_EXCEPTION(
516 true, std::runtime_error,
517 "Ifpack2::LocalFilter::getLocalRowCopy: Invalid output array length. "
518 "The output arrays must each have length at least " << numEntInLclRow
519 <<
" for local row " << LocalRow <<
" on Process "
520 << localRowMap_->getComm ()->getRank () <<
".");
522 else if (numEntInLclRow ==
static_cast<size_t> (0)) {
541 size_t numEntInMat = 0;
542 A_->getLocalRowCopy (LocalRow, localIndices_, Values_ , numEntInMat);
547 const map_type& matrixDomMap = * (A_->getDomainMap ());
548 const map_type& matrixColMap = * (A_->getColMap ());
550 const size_t capacity =
static_cast<size_t> (std::min (Indices.size (),
551 Values.size ()/blockNumEntr));
553 const size_t numRows = localRowMap_->getLocalNumElements ();
554 const bool buggy =
true;
555 for (
size_t j = 0; j < numEntInMat; ++j) {
561 const LO matrixLclCol = localIndices_[j];
562 const GO gblCol = matrixColMap.getGlobalElement (matrixLclCol);
571 if ((
size_t) localIndices_[j] < numRows) {
572 Indices[NumEntries] = localIndices_[j];
573 for (LO k=0;k<blockNumEntr;++k)
574 Values[NumEntries*blockNumEntr + k] = Values_[j*blockNumEntr + k];
578 if (matrixDomMap.isNodeGlobalElement (gblCol)) {
582 if (NumEntries < capacity) {
583 Indices[NumEntries] = matrixLclCol;
584 for (LO k=0;k<blockNumEntr;++k)
585 Values[NumEntries*blockNumEntr + k] = Values_[j*blockNumEntr + k];
594template<
class MatrixType>
598 global_inds_host_view_type &,
599 values_host_view_type &)
const
601 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
602 "Ifpack2::LocalFilter does not implement getGlobalRowView.");
606template<
class MatrixType>
610 local_inds_host_view_type &,
611 values_host_view_type &)
const
613 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
614 "Ifpack2::LocalFilter does not implement getLocalRowView.");
618template<
class MatrixType>
621getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const
628 RCP<vector_type> diagView = diag.offsetViewNonConst (A_->getRowMap (), 0);
629 A_->getLocalDiagCopy (*diagView);
633template<
class MatrixType>
636leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
638 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
639 "Ifpack2::LocalFilter does not implement leftScale.");
643template<
class MatrixType>
646rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
648 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
649 "Ifpack2::LocalFilter does not implement rightScale.");
653template<
class MatrixType>
656apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
657 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
658 Teuchos::ETransp mode,
662 typedef Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> MV;
663 TEUCHOS_TEST_FOR_EXCEPTION(
664 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
665 "Ifpack2::LocalFilter::apply: X and Y must have the same number of columns. "
666 "X has " << X.getNumVectors () <<
" columns, but Y has "
667 << Y.getNumVectors () <<
" columns.");
669#ifdef HAVE_IFPACK2_DEBUG
671 typedef Teuchos::ScalarTraits<magnitude_type> STM;
672 Teuchos::Array<magnitude_type> norms (X.getNumVectors ());
675 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
676 if (STM::isnaninf (norms[j])) {
681 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the input X is NaN or Inf.");
685 TEUCHOS_TEST_FOR_EXCEPTION(
687 "Ifpack2::LocalFilter::apply: Block size greater than zero is not yet supported for "
688 "LocalFilter::apply. Please contact an Ifpack2 developer to request this feature.");
696 MV X_copy (X, Teuchos::Copy);
697 applyNonAliased (X_copy, Y, mode, alpha, beta);
699 applyNonAliased (X, Y, mode, alpha, beta);
702#ifdef HAVE_IFPACK2_DEBUG
704 typedef Teuchos::ScalarTraits<magnitude_type> STM;
705 Teuchos::Array<magnitude_type> norms (Y.getNumVectors ());
708 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
709 if (STM::isnaninf (norms[j])) {
714 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the output Y is NaN or Inf.");
719template<
class MatrixType>
722applyNonAliased (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
723 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
724 Teuchos::ETransp mode,
726 scalar_type beta)
const
728 using Teuchos::ArrayView;
729 using Teuchos::ArrayRCP;
730 typedef Teuchos::ScalarTraits<scalar_type> STS;
732 const scalar_type zero = STS::zero ();
733 const scalar_type one = STS::one ();
738 else if (beta != one) {
742 const size_t NumVectors = Y.getNumVectors ();
743 const size_t numRows = localRowMap_->getLocalNumElements ();
750 const bool constantStride = X.isConstantStride () && Y.isConstantStride ();
751 if (constantStride) {
754 const size_t x_stride = X.getStride();
755 const size_t y_stride = Y.getStride();
756 ArrayRCP<scalar_type> y_rcp = Y.get1dViewNonConst();
757 ArrayRCP<const scalar_type> x_rcp = X.get1dView();
758 ArrayView<scalar_type> y_ptr = y_rcp();
759 ArrayView<const scalar_type> x_ptr = x_rcp();
760 for (
size_t i = 0; i < numRows; ++i) {
763 getLocalRowCopy (i, localIndices_ , Values_ , Nnz);
764 scalar_type* Values =
reinterpret_cast<scalar_type*
>(Values_.data());
765 if (mode == Teuchos::NO_TRANS) {
766 for (
size_t j = 0; j < Nnz; ++j) {
768 for (
size_t k = 0; k < NumVectors; ++k) {
769 y_ptr[i + y_stride*k] +=
770 alpha * Values[j] * x_ptr[col + x_stride*k];
774 else if (mode == Teuchos::TRANS) {
775 for (
size_t j = 0; j < Nnz; ++j) {
777 for (
size_t k = 0; k < NumVectors; ++k) {
778 y_ptr[col + y_stride*k] +=
779 alpha * Values[j] * x_ptr[i + x_stride*k];
784 for (
size_t j = 0; j < Nnz; ++j) {
786 for (
size_t k = 0; k < NumVectors; ++k) {
787 y_ptr[col + y_stride*k] +=
788 alpha * STS::conjugate (Values[j]) * x_ptr[i + x_stride*k];
797 ArrayRCP<ArrayRCP<const scalar_type> > x_ptr = X.get2dView();
798 ArrayRCP<ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
800 for (
size_t i = 0; i < numRows; ++i) {
803 getLocalRowCopy (i, localIndices_ , Values_ , Nnz);
804 scalar_type* Values =
reinterpret_cast<scalar_type*
>(Values_.data());
805 if (mode == Teuchos::NO_TRANS) {
806 for (
size_t k = 0; k < NumVectors; ++k) {
807 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
808 ArrayView<scalar_type> y_local = (y_ptr())[k]();
809 for (
size_t j = 0; j < Nnz; ++j) {
810 y_local[i] += alpha * Values[j] * x_local[localIndices_[j]];
814 else if (mode == Teuchos::TRANS) {
815 for (
size_t k = 0; k < NumVectors; ++k) {
816 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
817 ArrayView<scalar_type> y_local = (y_ptr())[k]();
818 for (
size_t j = 0; j < Nnz; ++j) {
819 y_local[localIndices_[j]] += alpha * Values[j] * x_local[i];
824 for (
size_t k = 0; k < NumVectors; ++k) {
825 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
826 ArrayView<scalar_type> y_local = (y_ptr())[k]();
827 for (
size_t j = 0; j < Nnz; ++j) {
828 y_local[localIndices_[j]] +=
829 alpha * STS::conjugate (Values[j]) * x_local[i];
837template<
class MatrixType>
844template<
class MatrixType>
851template<
class MatrixType>
853LocalFilter<MatrixType>::mag_type
856 typedef Kokkos::ArithTraits<scalar_type> STS;
857 typedef Kokkos::ArithTraits<mag_type> STM;
858 typedef typename Teuchos::Array<scalar_type>::size_type size_type;
862 nonconst_local_inds_host_view_type ind (
"ind",maxNumRowEnt);
863 nonconst_values_host_view_type val (
"val",maxNumRowEnt*blockNumEntr);
864 const size_t numRows =
static_cast<size_t> (localRowMap_->getLocalNumElements ());
867 mag_type sumSquared = STM::zero ();
868 for (
size_t i = 0; i < numRows; ++i) {
869 size_t numEntries = 0;
871 for (size_type k = 0; k < static_cast<size_type> (numEntries*blockNumEntr); ++k) {
872 const mag_type v_k_abs = STS::magnitude (val[k]);
873 sumSquared += v_k_abs * v_k_abs;
876 return STM::squareroot (sumSquared);
879template<
class MatrixType>
883 using Teuchos::TypeNameTraits;
884 std::ostringstream os;
886 os <<
"Ifpack2::LocalFilter: {";
887 os <<
"MatrixType: " << TypeNameTraits<MatrixType>::name ();
888 if (this->getObjectLabel () !=
"") {
889 os <<
", Label: \"" << this->getObjectLabel () <<
"\"";
898template<
class MatrixType>
901describe (Teuchos::FancyOStream &out,
902 const Teuchos::EVerbosityLevel verbLevel)
const
904 using Teuchos::OSTab;
905 using Teuchos::TypeNameTraits;
908 const Teuchos::EVerbosityLevel vl =
909 (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
911 if (vl > Teuchos::VERB_NONE) {
915 out <<
"Ifpack2::LocalFilter:" << endl;
917 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
918 if (this->getObjectLabel () !=
"") {
919 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
923 <<
"Number of nonzeros: " << NumNonzeros_ << endl;
925 if (vl > Teuchos::VERB_LOW) {
926 out <<
"Row Map:" << endl;
927 localRowMap_->describe (out, vl);
928 out <<
"Domain Map:" << endl;
929 localDomainMap_->describe (out, vl);
930 out <<
"Range Map:" << endl;
931 localRangeMap_->describe (out, vl);
936template<
class MatrixType>
937Teuchos::RCP<
const Tpetra::RowMatrix<
typename MatrixType::scalar_type,
938 typename MatrixType::local_ordinal_type,
939 typename MatrixType::global_ordinal_type,
940 typename MatrixType::node_type> >
949#define IFPACK2_LOCALFILTER_INSTANT(S,LO,GO,N) \
950 template class Ifpack2::LocalFilter< Tpetra::RowMatrix<S, LO, GO, N> >;
Access only local rows and columns of a sparse matrix.
Definition Ifpack2_LocalFilter_decl.hpp:163
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:901
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:292
virtual Teuchos::RCP< const map_type > getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:272
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on all processes.
Definition Ifpack2_LocalFilter_def.hpp:399
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:636
virtual void getGlobalRowCopy(global_ordinal_type GlobalRow, nonconst_global_inds_host_view_type &Indices, nonconst_values_host_view_type &Values, size_t &NumEntries) const
Get the entries in the given row, using global indices.
Definition Ifpack2_LocalFilter_def.hpp:443
virtual bool isGloballyIndexed() const
Whether the underlying sparse matrix is globally (opposite of locally) indexed.
Definition Ifpack2_LocalFilter_def.hpp:427
virtual Teuchos::RCP< const row_matrix_type > getUnderlyingMatrix() const
Return matrix that LocalFilter was built on.
Definition Ifpack2_LocalFilter_def.hpp:941
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition Ifpack2_LocalFilter_decl.hpp:181
virtual Teuchos::RCP< const map_type > getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:282
virtual mag_type getFrobeniusNorm() const
The Frobenius norm of the (locally filtered) matrix.
Definition Ifpack2_LocalFilter_def.hpp:854
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:359
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition Ifpack2_LocalFilter_decl.hpp:190
virtual global_size_t getGlobalNumCols() const
The number of global columns in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:309
virtual bool hasColMap() const
Whether this matrix has a well-defined column Map.
Definition Ifpack2_LocalFilter_def.hpp:413
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_LocalFilter_def.hpp:597
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition Ifpack2_LocalFilter_decl.hpp:187
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
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:420
virtual size_t getLocalNumCols() const
The number of columns in the (locally filtered) matrix.
Definition Ifpack2_LocalFilter_def.hpp:323
virtual Teuchos::RCP< const map_type > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:262
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
Definition Ifpack2_LocalFilter_def.hpp:838
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:621
virtual size_t getLocalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on this process.
Definition Ifpack2_LocalFilter_def.hpp:406
LocalFilter(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition Ifpack2_LocalFilter_def.hpp:98
virtual global_ordinal_type getIndexBase() const
Returns the index base for global indices for this matrix.
Definition Ifpack2_LocalFilter_def.hpp:331
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition Ifpack2_LocalFilter_def.hpp:845
virtual std::string description() const
A one-line description of this object.
Definition Ifpack2_LocalFilter_def.hpp:881
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:338
virtual local_ordinal_type getBlockSize() const
The number of degrees of freedom per mesh point.
Definition Ifpack2_LocalFilter_def.hpp:351
virtual ~LocalFilter()
Destructor.
Definition Ifpack2_LocalFilter_def.hpp:234
virtual size_t getLocalNumRows() const
The number of rows owned on the calling process.
Definition Ifpack2_LocalFilter_def.hpp:316
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:656
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition Ifpack2_LocalFilter_decl.hpp:184
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:646
virtual void getLocalRowCopy(local_ordinal_type LocalRow, nonconst_local_inds_host_view_type &Indices, nonconst_values_host_view_type &Values, size_t &NumEntries) const
Get the entries in the given row, using local indices.
Definition Ifpack2_LocalFilter_def.hpp:488
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:378
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_LocalFilter_def.hpp:609
virtual global_size_t getGlobalNumRows() const
The number of global rows in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:302
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:216
virtual size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:345
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the communicator.
Definition Ifpack2_LocalFilter_def.hpp:240
virtual Teuchos::RCP< const map_type > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition Ifpack2_LocalFilter_def.hpp:252
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:74