10 #ifndef IFPACK2_LOCALFILTER_DEF_HPP
11 #define IFPACK2_LOCALFILTER_DEF_HPP
13 #include <Ifpack2_LocalFilter_decl.hpp>
14 #include <Tpetra_Map.hpp>
15 #include <Tpetra_MultiVector.hpp>
16 #include <Tpetra_Vector.hpp>
21 # include "Teuchos_DefaultSerialComm.hpp"
27 template<
class MatrixType>
29 LocalFilter<MatrixType>::
30 mapPairsAreFitted (
const row_matrix_type& A)
32 const auto rangeMap = A.getRangeMap();
33 const auto rowMap = A.getRowMap();
34 const bool rangeAndRowFitted = mapPairIsFitted (*rowMap, *rangeMap);
36 const auto domainMap = A.getDomainMap();
37 const auto columnMap = A.getColMap();
38 const bool domainAndColumnFitted = mapPairIsFitted (*columnMap, *domainMap);
45 int localSuccess = rangeAndRowFitted && domainAndColumnFitted;
48 Teuchos::reduceAll<int, int> (*(A.getComm()),
Teuchos::REDUCE_MIN, localSuccess, Teuchos::outArg (globalSuccess));
50 return globalSuccess == 1;
54 template<
class MatrixType>
56 LocalFilter<MatrixType>::
57 mapPairIsFitted (
const map_type& map1,
const map_type& map2)
59 return map1.isLocallyFitted (map2);
63 template<
class MatrixType>
74 #ifdef HAVE_IFPACK2_DEBUG
75 if(! mapPairsAreFitted (*A))
77 std::cout <<
"WARNING: Ifpack2::LocalFilter:\n" <<
78 "A's Map pairs are not fitted to each other on Process "
79 << A_->getRowMap ()->getComm ()->getRank () <<
" of the input matrix's "
81 "This means that LocalFilter may not work with A. "
82 "Please see discussion of Bug 5992.";
84 #endif // HAVE_IFPACK2_DEBUG
87 RCP<const Teuchos::Comm<int> > localComm;
89 localComm =
rcp (
new Teuchos::MpiComm<int> (MPI_COMM_SELF));
118 const size_t numRows = A_->getRangeMap()->getLocalNumElements () / blockSize;
120 const global_ordinal_type indexBase =
static_cast<global_ordinal_type
> (0);
124 Tpetra::GloballyDistributed));
127 localRangeMap_ = localRowMap_;
134 localDomainMap_ = localRangeMap_;
137 const size_t numCols = A_->getDomainMap()->getLocalNumElements () / blockSize;
140 Tpetra::GloballyDistributed));
146 NumEntries_.resize (numRows);
150 MaxNumEntries_ = A_->getLocalMaxNumRowEntries ();
151 MaxNumEntriesA_ = A_->getLocalMaxNumRowEntries ();
154 Kokkos::resize(localIndices_,MaxNumEntries_);
155 Kokkos::resize(localIndicesForGlobalCopy_,MaxNumEntries_);
156 Kokkos::resize(Values_,MaxNumEntries_*blockSize*blockSize);
165 size_t ActualMaxNumEntries = 0;
167 for (
size_t i = 0; i < numRows; ++i) {
169 size_t Nnz, NewNnz = 0;
170 A_->getLocalRowCopy (i, localIndices_, Values_, Nnz);
171 for (
size_t j = 0; j < Nnz; ++j) {
183 if (static_cast<size_t> (localIndices_[j]) < numRows) {
188 if (NewNnz > ActualMaxNumEntries) {
189 ActualMaxNumEntries = NewNnz;
192 NumNonzeros_ += NewNnz;
193 NumEntries_[i] = NewNnz;
196 MaxNumEntries_ = ActualMaxNumEntries;
200 template<
class MatrixType>
205 template<
class MatrixType>
209 return localRowMap_->getComm ();
215 template<
class MatrixType>
216 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
217 typename MatrixType::global_ordinal_type,
218 typename MatrixType::node_type> >
225 template<
class MatrixType>
226 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
227 typename MatrixType::global_ordinal_type,
228 typename MatrixType::node_type> >
235 template<
class MatrixType>
236 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
237 typename MatrixType::global_ordinal_type,
238 typename MatrixType::node_type> >
241 return localDomainMap_;
245 template<
class MatrixType>
246 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
247 typename MatrixType::global_ordinal_type,
248 typename MatrixType::node_type> >
251 return localRangeMap_;
255 template<
class MatrixType>
256 Teuchos::RCP<
const Tpetra::RowGraph<
typename MatrixType::local_ordinal_type,
257 typename MatrixType::global_ordinal_type,
258 typename MatrixType::node_type> >
261 if (local_graph_ == Teuchos::null) {
262 local_ordinal_type numRows = this->getLocalNumRows();
264 for(local_ordinal_type i = 0; i < numRows; i++) {
265 entriesPerRow[i] = this->getNumEntriesInLocalRow(i);
272 nonconst_local_inds_host_view_type indices(
"indices",this->getLocalMaxNumRowEntries());
273 nonconst_values_host_view_type values(
"values",this->getLocalMaxNumRowEntries());
274 for(local_ordinal_type i = 0; i < numRows; i++) {
275 size_t numEntries = 0;
276 this->getLocalRowCopy(i, indices, values, numEntries);
277 local_graph_nc->insertLocalIndices (i, numEntries, indices.data());
279 local_graph_nc->fillComplete (this->getDomainMap (), this->getRangeMap ());
280 local_graph_ = Teuchos::rcp_const_cast<
const crs_graph_type> (local_graph_nc);
286 template<
class MatrixType>
289 return static_cast<global_size_t
> (localRangeMap_->getLocalNumElements ());
293 template<
class MatrixType>
296 return static_cast<global_size_t
> (localDomainMap_->getLocalNumElements ());
300 template<
class MatrixType>
303 return static_cast<size_t> (localRangeMap_->getLocalNumElements ());
307 template<
class MatrixType>
310 return static_cast<size_t> (localDomainMap_->getLocalNumElements ());
314 template<
class MatrixType>
315 typename MatrixType::global_ordinal_type
318 return A_->getIndexBase ();
322 template<
class MatrixType>
329 template<
class MatrixType>
335 template<
class MatrixType>
338 return A_->getBlockSize();
341 template<
class MatrixType>
346 const local_ordinal_type localRow = getRowMap ()->getLocalElement (globalRow);
355 return NumEntries_[localRow];
360 template<
class MatrixType>
370 if (getRowMap ()->isNodeLocalElement (localRow)) {
371 return NumEntries_[localRow];
383 template<
class MatrixType>
386 return MaxNumEntries_;
390 template<
class MatrixType>
393 return MaxNumEntries_;
397 template<
class MatrixType>
404 template<
class MatrixType>
407 return A_->isLocallyIndexed ();
411 template<
class MatrixType>
414 return A_->isGloballyIndexed();
418 template<
class MatrixType>
421 return A_->isFillComplete ();
425 template<
class MatrixType>
429 nonconst_global_inds_host_view_type &globalIndices,
430 nonconst_values_host_view_type &values,
431 size_t& numEntries)
const
433 typedef local_ordinal_type LO;
436 const LO localRow = this->getRowMap ()->getLocalElement (globalRow);
449 numEntries = this->getNumEntriesInLocalRow (localRow);
455 this->getLocalRowCopy (localRow, localIndicesForGlobalCopy_, values, numEntries);
457 const map_type& colMap = * (this->getColMap ());
460 const size_type numEnt =
461 std::min (static_cast<size_type> (numEntries),
462 std::min ((size_type)globalIndices.size (), (size_type)values.size ()));
463 for (size_type k = 0; k < numEnt; ++k) {
464 globalIndices[k] = colMap.getGlobalElement (localIndicesForGlobalCopy_[k]);
470 template<
class MatrixType>
474 nonconst_local_inds_host_view_type &Indices,
475 nonconst_values_host_view_type &Values,
476 size_t& NumEntries)
const
478 typedef local_ordinal_type LO;
479 typedef global_ordinal_type GO;
481 if (! A_->getRowMap ()->isNodeLocalElement (LocalRow)) {
487 if (A_->getRowMap()->getComm()->getSize() == 1) {
488 A_->getLocalRowCopy (LocalRow, Indices, Values, NumEntries);
492 const LO blockNumEntr = getBlockSize() * getBlockSize();
494 const size_t numEntInLclRow = NumEntries_[LocalRow];
495 if (static_cast<size_t> (Indices.size ()) < numEntInLclRow ||
496 static_cast<size_t> (Values.size ()) < numEntInLclRow*blockNumEntr) {
501 true, std::runtime_error,
502 "Ifpack2::LocalFilter::getLocalRowCopy: Invalid output array length. "
503 "The output arrays must each have length at least " << numEntInLclRow
504 <<
" for local row " << LocalRow <<
" on Process "
505 << localRowMap_->getComm ()->getRank () <<
".");
507 else if (numEntInLclRow == static_cast<size_t> (0)) {
526 size_t numEntInMat = 0;
527 A_->getLocalRowCopy (LocalRow, localIndices_, Values_ , numEntInMat);
532 const map_type& matrixDomMap = * (A_->getDomainMap ());
533 const map_type& matrixColMap = * (A_->getColMap ());
535 const size_t capacity =
static_cast<size_t> (std::min (Indices.size (),
536 Values.size ()/blockNumEntr));
538 const size_t numRows = localRowMap_->getLocalNumElements ();
539 const bool buggy =
true;
540 for (
size_t j = 0; j < numEntInMat; ++j) {
546 const LO matrixLclCol = localIndices_[j];
547 const GO gblCol = matrixColMap.getGlobalElement (matrixLclCol);
556 if ((
size_t) localIndices_[j] < numRows) {
557 Indices[NumEntries] = localIndices_[j];
558 for (LO k=0;k<blockNumEntr;++k)
559 Values[NumEntries*blockNumEntr + k] = Values_[j*blockNumEntr + k];
563 if (matrixDomMap.isNodeGlobalElement (gblCol)) {
567 if (NumEntries < capacity) {
568 Indices[NumEntries] = matrixLclCol;
569 for (LO k=0;k<blockNumEntr;++k)
570 Values[NumEntries*blockNumEntr + k] = Values_[j*blockNumEntr + k];
579 template<
class MatrixType>
583 global_inds_host_view_type &,
584 values_host_view_type &)
const
587 "Ifpack2::LocalFilter does not implement getGlobalRowView.");
591 template<
class MatrixType>
595 local_inds_host_view_type &,
596 values_host_view_type &)
const
599 "Ifpack2::LocalFilter does not implement getLocalRowView.");
603 template<
class MatrixType>
606 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const
609 typedef Tpetra::Vector<scalar_type, local_ordinal_type,
610 global_ordinal_type, node_type> vector_type;
613 RCP<vector_type> diagView = diag.offsetViewNonConst (A_->getRowMap (), 0);
614 A_->getLocalDiagCopy (*diagView);
618 template<
class MatrixType>
621 leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
624 "Ifpack2::LocalFilter does not implement leftScale.");
628 template<
class MatrixType>
631 rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& )
634 "Ifpack2::LocalFilter does not implement rightScale.");
638 template<
class MatrixType>
641 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
642 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
645 scalar_type beta)
const
647 typedef Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> MV;
649 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
650 "Ifpack2::LocalFilter::apply: X and Y must have the same number of columns. "
651 "X has " << X.getNumVectors () <<
" columns, but Y has "
652 << Y.getNumVectors () <<
" columns.");
654 #ifdef HAVE_IFPACK2_DEBUG
660 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
661 if (STM::isnaninf (norms[j])) {
666 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the input X is NaN or Inf.");
668 #endif // HAVE_IFPACK2_DEBUG
671 getBlockSize() > 1, std::runtime_error,
672 "Ifpack2::LocalFilter::apply: Block size greater than zero is not yet supported for "
673 "LocalFilter::apply. Please contact an Ifpack2 developer to request this feature.");
682 applyNonAliased (X_copy, Y, mode, alpha, beta);
684 applyNonAliased (X, Y, mode, alpha, beta);
687 #ifdef HAVE_IFPACK2_DEBUG
693 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
694 if (STM::isnaninf (norms[j])) {
699 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the output Y is NaN or Inf.");
701 #endif // HAVE_IFPACK2_DEBUG
704 template<
class MatrixType>
707 applyNonAliased (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
708 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
711 scalar_type beta)
const
717 const scalar_type zero = STS::zero ();
718 const scalar_type one = STS::one ();
723 else if (beta != one) {
727 const size_t NumVectors = Y.getNumVectors ();
728 const size_t numRows = localRowMap_->getLocalNumElements ();
735 const bool constantStride = X.isConstantStride () && Y.isConstantStride ();
736 if (constantStride) {
739 const size_t x_stride = X.getStride();
740 const size_t y_stride = Y.getStride();
741 ArrayRCP<scalar_type> y_rcp = Y.get1dViewNonConst();
742 ArrayRCP<const scalar_type> x_rcp = X.get1dView();
743 ArrayView<scalar_type> y_ptr = y_rcp();
744 ArrayView<const scalar_type> x_ptr = x_rcp();
745 for (
size_t i = 0; i < numRows; ++i) {
748 getLocalRowCopy (i, localIndices_ , Values_ , Nnz);
749 scalar_type* Values =
reinterpret_cast<scalar_type*
>(Values_.data());
751 for (
size_t j = 0; j < Nnz; ++j) {
752 const local_ordinal_type col = localIndices_[j];
753 for (
size_t k = 0; k < NumVectors; ++k) {
754 y_ptr[i + y_stride*k] +=
755 alpha * Values[j] * x_ptr[col + x_stride*k];
760 for (
size_t j = 0; j < Nnz; ++j) {
761 const local_ordinal_type col = localIndices_[j];
762 for (
size_t k = 0; k < NumVectors; ++k) {
763 y_ptr[col + y_stride*k] +=
764 alpha * Values[j] * x_ptr[i + x_stride*k];
769 for (
size_t j = 0; j < Nnz; ++j) {
770 const local_ordinal_type col = localIndices_[j];
771 for (
size_t k = 0; k < NumVectors; ++k) {
772 y_ptr[col + y_stride*k] +=
773 alpha * STS::conjugate (Values[j]) * x_ptr[i + x_stride*k];
782 ArrayRCP<ArrayRCP<const scalar_type> > x_ptr = X.get2dView();
783 ArrayRCP<ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
785 for (
size_t i = 0; i < numRows; ++i) {
788 getLocalRowCopy (i, localIndices_ , Values_ , Nnz);
789 scalar_type* Values =
reinterpret_cast<scalar_type*
>(Values_.data());
791 for (
size_t k = 0; k < NumVectors; ++k) {
792 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
793 ArrayView<scalar_type> y_local = (y_ptr())[k]();
794 for (
size_t j = 0; j < Nnz; ++j) {
795 y_local[i] += alpha * Values[j] * x_local[localIndices_[j]];
800 for (
size_t k = 0; k < NumVectors; ++k) {
801 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
802 ArrayView<scalar_type> y_local = (y_ptr())[k]();
803 for (
size_t j = 0; j < Nnz; ++j) {
804 y_local[localIndices_[j]] += alpha * Values[j] * x_local[i];
809 for (
size_t k = 0; k < NumVectors; ++k) {
810 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
811 ArrayView<scalar_type> y_local = (y_ptr())[k]();
812 for (
size_t j = 0; j < Nnz; ++j) {
813 y_local[localIndices_[j]] +=
814 alpha * STS::conjugate (Values[j]) * x_local[i];
822 template<
class MatrixType>
829 template<
class MatrixType>
836 template<
class MatrixType>
838 LocalFilter<MatrixType>::mag_type
841 typedef Kokkos::ArithTraits<scalar_type> STS;
842 typedef Kokkos::ArithTraits<mag_type> STM;
845 const size_type maxNumRowEnt = getLocalMaxNumRowEntries ();
846 const local_ordinal_type blockNumEntr = getBlockSize() * getBlockSize();
847 nonconst_local_inds_host_view_type ind (
"ind",maxNumRowEnt);
848 nonconst_values_host_view_type val (
"val",maxNumRowEnt*blockNumEntr);
849 const size_t numRows =
static_cast<size_t> (localRowMap_->getLocalNumElements ());
852 mag_type sumSquared = STM::zero ();
853 for (
size_t i = 0; i < numRows; ++i) {
854 size_t numEntries = 0;
855 this->getLocalRowCopy (i, ind, val, numEntries);
856 for (size_type k = 0; k < static_cast<size_type> (numEntries*blockNumEntr); ++k) {
857 const mag_type v_k_abs = STS::magnitude (val[k]);
858 sumSquared += v_k_abs * v_k_abs;
861 return STM::squareroot (sumSquared);
864 template<
class MatrixType>
869 std::ostringstream os;
871 os <<
"Ifpack2::LocalFilter: {";
872 os <<
"MatrixType: " << TypeNameTraits<MatrixType>::name ();
873 if (this->getObjectLabel () !=
"") {
874 os <<
", Label: \"" << this->getObjectLabel () <<
"\"";
876 os <<
", Number of rows: " << getGlobalNumRows ()
877 <<
", Number of columns: " << getGlobalNumCols ()
883 template<
class MatrixType>
900 out <<
"Ifpack2::LocalFilter:" << endl;
902 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
903 if (this->getObjectLabel () !=
"") {
904 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
906 out <<
"Number of rows: " << getGlobalNumRows () << endl
907 <<
"Number of columns: " << getGlobalNumCols () << endl
908 <<
"Number of nonzeros: " << NumNonzeros_ << endl;
911 out <<
"Row Map:" << endl;
912 localRowMap_->describe (out, vl);
913 out <<
"Domain Map:" << endl;
914 localDomainMap_->describe (out, vl);
915 out <<
"Range Map:" << endl;
916 localRangeMap_->describe (out, vl);
921 template<
class MatrixType>
922 Teuchos::RCP<
const Tpetra::RowMatrix<
typename MatrixType::scalar_type,
923 typename MatrixType::local_ordinal_type,
924 typename MatrixType::global_ordinal_type,
925 typename MatrixType::node_type> >
934 #define IFPACK2_LOCALFILTER_INSTANT(S,LO,GO,N) \
935 template class Ifpack2::LocalFilter< Tpetra::RowMatrix<S, LO, GO, N> >;
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:631
virtual Teuchos::RCP< const map_type > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:219
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:886
basic_OSTab< char > OSTab
virtual Teuchos::RCP< const map_type > getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:239
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual size_t getLocalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on this process.
Definition: Ifpack2_LocalFilter_def.hpp:391
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:428
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_LocalFilter_def.hpp:419
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:473
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the communicator.
Definition: Ifpack2_LocalFilter_def.hpp:207
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:582
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:641
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
Definition: Ifpack2_LocalFilter_def.hpp:823
virtual bool isLocallyIndexed() const
Whether the underlying sparse matrix is locally (opposite of globally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:405
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:606
virtual size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:330
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:189
virtual mag_type getFrobeniusNorm() const
The Frobenius norm of the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:839
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:259
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_LocalFilter_def.hpp:830
virtual size_t getLocalNumCols() const
The number of columns in the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:308
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:344
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:621
virtual global_ordinal_type getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:316
virtual bool isGloballyIndexed() const
Whether the underlying sparse matrix is globally (opposite of locally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:412
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on all processes.
Definition: Ifpack2_LocalFilter_def.hpp:384
LocalFilter(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_LocalFilter_def.hpp:65
virtual ~LocalFilter()
Destructor.
Definition: Ifpack2_LocalFilter_def.hpp:201
virtual global_size_t getGlobalNumRows() const
The number of global rows in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:287
virtual std::string description() const
A one-line description of this object.
Definition: Ifpack2_LocalFilter_def.hpp:866
virtual size_t getLocalNumRows() const
The number of rows owned on the calling process.
Definition: Ifpack2_LocalFilter_def.hpp:301
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:363
virtual Teuchos::RCP< const map_type > getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:249
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:323
virtual Teuchos::RCP< const row_matrix_type > getUnderlyingMatrix() const
Return matrix that LocalFilter was built on.
Definition: Ifpack2_LocalFilter_def.hpp:926
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:128
virtual global_size_t getGlobalNumCols() const
The number of global columns in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:294
virtual Teuchos::RCP< const map_type > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:229
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:594
virtual bool hasColMap() const
Whether this matrix has a well-defined column Map.
Definition: Ifpack2_LocalFilter_def.hpp:398
virtual local_ordinal_type getBlockSize() const
The number of degrees of freedom per mesh point.
Definition: Ifpack2_LocalFilter_def.hpp:336