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 using Teuchos::ArrayView;
83 typedef global_ordinal_type GO;
84 typedef typename ArrayView<const GO>::size_type size_type;
90 else if (map1.isContiguous () && map2.isContiguous () &&
91 map1.getMinGlobalIndex () == map2.getMinGlobalIndex () &&
92 map1.getMaxGlobalIndex () <= map2.getMaxGlobalIndex ()) {
97 ArrayView<const GO> inds_map2 = map2.getNodeElementList ();
98 const size_type numInds_map1 =
static_cast<size_type
> (map1.getNodeNumElements ());
100 if (map1.isContiguous ()) {
107 if (numInds_map1 > inds_map2.size ()) {
114 const GO minInd_map1 = map1.getMinGlobalIndex ();
115 for (size_type k = 0; k < numInds_map1; ++k) {
116 const GO inds_map1_k =
static_cast<GO
> (k) + minInd_map1;
117 if (inds_map1_k != inds_map2[k]) {
126 ArrayView<const GO> inds_map1 = map1.getNodeElementList ();
127 if (numInds_map1 > inds_map2.size ()) {
134 for (size_type k = 0; k < numInds_map1; ++k) {
135 if (inds_map1[k] != inds_map2[k]) {
147 template<
class MatrixType>
158 #ifdef HAVE_IFPACK2_DEBUG 159 TEUCHOS_TEST_FOR_EXCEPTION(
160 ! mapPairsAreFitted (*A), std::invalid_argument,
"Ifpack2::LocalFilter: " 161 "A's Map pairs are not fitted to each other on Process " 162 << A_->getRowMap ()->getComm ()->getRank () <<
" of the input matrix's " 164 "This means that LocalFilter does not currently know how to work with A. " 165 "This will change soon. Please see discussion of Bug 5992.");
166 #endif // HAVE_IFPACK2_DEBUG 169 RCP<const Teuchos::Comm<int> > localComm;
171 localComm = rcp (
new Teuchos::MpiComm<int> (MPI_COMM_SELF));
173 localComm = rcp (
new Teuchos::SerialComm<int> ());
204 const size_t numRows = A_->getNodeNumRows ();
215 rcp (
new map_type (numRows, indexBase, localComm,
216 Tpetra::GloballyDistributed, A_->getNode ()));
219 localRangeMap_ = localRowMap_;
223 const size_t numCols = A_->getDomainMap ()->getNodeNumElements ();
224 if (A_->getRangeMap ().getRawPtr () == A_->getDomainMap ().getRawPtr ()) {
227 localDomainMap_ = localRangeMap_;
231 rcp (
new map_type (numCols, indexBase, localComm,
232 Tpetra::GloballyDistributed, A_->getNode ()));
238 NumEntries_.resize (numRows);
242 MaxNumEntries_ = A_->getNodeMaxNumRowEntries ();
243 MaxNumEntriesA_ = A_->getNodeMaxNumRowEntries ();
246 localIndices_.resize (MaxNumEntries_);
247 Values_.resize (MaxNumEntries_);
256 size_t ActualMaxNumEntries = 0;
258 for (
size_t i = 0; i < numRows; ++i) {
260 size_t Nnz, NewNnz = 0;
261 A_->getLocalRowCopy (i, localIndices_, Values_, Nnz);
262 for (
size_t j = 0; j < Nnz; ++j) {
274 if (static_cast<size_t> (localIndices_[j]) < numRows) {
279 if (NewNnz > ActualMaxNumEntries) {
280 ActualMaxNumEntries = NewNnz;
283 NumNonzeros_ += NewNnz;
284 NumEntries_[i] = NewNnz;
287 MaxNumEntries_ = ActualMaxNumEntries;
291 template<
class MatrixType>
296 template<
class MatrixType>
297 Teuchos::RCP<const Teuchos::Comm<int> >
300 return localRowMap_->getComm ();
304 template<
class MatrixType>
305 Teuchos::RCP<typename MatrixType::node_type>
308 return A_->getNode ();
312 template<
class MatrixType>
313 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
314 typename MatrixType::global_ordinal_type,
315 typename MatrixType::node_type> >
322 template<
class MatrixType>
323 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
324 typename MatrixType::global_ordinal_type,
325 typename MatrixType::node_type> >
332 template<
class MatrixType>
333 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
334 typename MatrixType::global_ordinal_type,
335 typename MatrixType::node_type> >
338 return localDomainMap_;
342 template<
class MatrixType>
343 Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
344 typename MatrixType::global_ordinal_type,
345 typename MatrixType::node_type> >
348 return localRangeMap_;
352 template<
class MatrixType>
353 Teuchos::RCP<
const Tpetra::RowGraph<
typename MatrixType::local_ordinal_type,
354 typename MatrixType::global_ordinal_type,
355 typename MatrixType::node_type> >
361 return A_->getGraph ();
365 template<
class MatrixType>
368 return static_cast<global_size_t
> (localRangeMap_->getNodeNumElements ());
372 template<
class MatrixType>
375 return static_cast<global_size_t
> (localDomainMap_->getNodeNumElements ());
379 template<
class MatrixType>
382 return static_cast<size_t> (localRangeMap_->getNodeNumElements ());
386 template<
class MatrixType>
389 return static_cast<size_t> (localDomainMap_->getNodeNumElements ());
393 template<
class MatrixType>
394 typename MatrixType::global_ordinal_type
397 return A_->getIndexBase ();
401 template<
class MatrixType>
408 template<
class MatrixType>
415 template<
class MatrixType>
421 if (localRow == Teuchos::OrdinalTraits<local_ordinal_type>::invalid ()) {
429 return NumEntries_[localRow];
434 template<
class MatrixType>
444 if (
getRowMap ()->isNodeLocalElement (localRow)) {
445 return NumEntries_[localRow];
457 template<
class MatrixType>
460 return A_->getGlobalNumDiags ();
464 template<
class MatrixType>
467 return A_->getNodeNumDiags ();
471 template<
class MatrixType>
474 return MaxNumEntries_;
478 template<
class MatrixType>
481 return MaxNumEntries_;
485 template<
class MatrixType>
492 template<
class MatrixType>
495 return A_->isLowerTriangular();
499 template<
class MatrixType>
502 return A_->isUpperTriangular();
506 template<
class MatrixType>
509 return A_->isLocallyIndexed ();
513 template<
class MatrixType>
516 return A_->isGloballyIndexed();
520 template<
class MatrixType>
523 return A_->isFillComplete ();
527 template<
class MatrixType>
531 const Teuchos::ArrayView<global_ordinal_type>& globalIndices,
532 const Teuchos::ArrayView<scalar_type>& values,
533 size_t& numEntries)
const 536 typedef typename Teuchos::Array<LO>::size_type size_type;
538 const LO localRow = this->
getRowMap ()->getLocalElement (globalRow);
539 if (localRow == Teuchos::OrdinalTraits<LO>::invalid ()) {
555 Teuchos::Array<LO> localIndices (numEntries);
561 const size_type numEnt =
562 std::min (static_cast<size_type> (numEntries),
563 std::min (globalIndices.size (), values.size ()));
564 for (size_type k = 0; k < numEnt; ++k) {
565 globalIndices[k] = colMap.getGlobalElement (localIndices[k]);
571 template<
class MatrixType>
575 const Teuchos::ArrayView<local_ordinal_type> &Indices,
576 const Teuchos::ArrayView<scalar_type> &Values,
577 size_t &NumEntries)
const 582 if (! A_->getRowMap ()->isNodeLocalElement (LocalRow)) {
588 const size_t numEntInLclRow = NumEntries_[LocalRow];
589 if (static_cast<size_t> (Indices.size ()) < numEntInLclRow ||
590 static_cast<size_t> (Values.size ()) < numEntInLclRow) {
594 TEUCHOS_TEST_FOR_EXCEPTION(
595 true, std::runtime_error,
596 "Ifpack2::LocalFilter::getLocalRowCopy: Invalid output array length. " 597 "The output arrays must each have length at least " << numEntInLclRow
598 <<
" for local row " << LocalRow <<
" on Process " 599 << localRowMap_->getComm ()->getRank () <<
".");
601 else if (numEntInLclRow == static_cast<size_t> (0)) {
620 size_t numEntInMat = 0;
621 A_->getLocalRowCopy (LocalRow, localIndices_ (), Values_ (), numEntInMat);
626 const map_type& matrixDomMap = * (A_->getDomainMap ());
627 const map_type& matrixColMap = * (A_->getColMap ());
629 const size_t capacity =
static_cast<size_t> (std::min (Indices.size (),
632 const size_t numRows = localRowMap_->getNodeNumElements ();
633 const bool buggy =
true;
634 for (
size_t j = 0; j < numEntInMat; ++j) {
640 const LO matrixLclCol = localIndices_[j];
641 const GO gblCol = matrixColMap.getGlobalElement (matrixLclCol);
650 if ((
size_t) localIndices_[j] < numRows) {
651 Indices[NumEntries] = localIndices_[j];
652 Values[NumEntries] = Values_[j];
656 if (matrixDomMap.isNodeGlobalElement (gblCol)) {
660 if (NumEntries < capacity) {
661 Indices[NumEntries] = matrixLclCol;
662 Values[NumEntries] = Values_[j];
671 template<
class MatrixType>
675 Teuchos::ArrayView<const global_ordinal_type> &indices,
676 Teuchos::ArrayView<const scalar_type> &values)
const 678 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
679 "Ifpack2::LocalFilter does not implement getGlobalRowView.");
683 template<
class MatrixType>
687 Teuchos::ArrayView<const local_ordinal_type> &indices,
688 Teuchos::ArrayView<const scalar_type> &values)
const 690 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
691 "Ifpack2::LocalFilter does not implement getLocalRowView.");
695 template<
class MatrixType>
698 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& diag)
const 705 RCP<vector_type> diagView = diag.offsetViewNonConst (A_->getRowMap (), 0);
706 A_->getLocalDiagCopy (*diagView);
710 template<
class MatrixType>
713 leftScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x)
715 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
716 "Ifpack2::LocalFilter does not implement leftScale.");
720 template<
class MatrixType>
723 rightScale (
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x)
725 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
726 "Ifpack2::LocalFilter does not implement rightScale.");
730 template<
class MatrixType>
733 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
734 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
735 Teuchos::ETransp mode,
739 typedef Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> MV;
740 TEUCHOS_TEST_FOR_EXCEPTION(
741 X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
742 "Ifpack2::LocalFilter::apply: X and Y must have the same number of columns. " 743 "X has " << X.getNumVectors () <<
" columns, but Y has " 744 << Y.getNumVectors () <<
" columns.");
746 #ifdef HAVE_IFPACK2_DEBUG 748 typedef Teuchos::ScalarTraits<magnitude_type> STM;
749 Teuchos::Array<magnitude_type> norms (X.getNumVectors ());
752 for (
size_t j = 0; j < X.getNumVectors (); ++j) {
753 if (STM::isnaninf (norms[j])) {
758 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the input X is NaN or Inf.");
760 #endif // HAVE_IFPACK2_DEBUG 768 MV X_copy (X, Teuchos::Copy);
769 applyNonAliased (X_copy, Y, mode, alpha, beta);
771 applyNonAliased (X, Y, mode, alpha, beta);
774 #ifdef HAVE_IFPACK2_DEBUG 776 typedef Teuchos::ScalarTraits<magnitude_type> STM;
777 Teuchos::Array<magnitude_type> norms (Y.getNumVectors ());
780 for (
size_t j = 0; j < Y.getNumVectors (); ++j) {
781 if (STM::isnaninf (norms[j])) {
786 TEUCHOS_TEST_FOR_EXCEPTION( ! good, std::runtime_error,
"Ifpack2::LocalFilter::apply: The 1-norm of the output Y is NaN or Inf.");
788 #endif // HAVE_IFPACK2_DEBUG 791 template<
class MatrixType>
794 applyNonAliased (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
795 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
796 Teuchos::ETransp mode,
800 using Teuchos::ArrayView;
801 using Teuchos::ArrayRCP;
802 typedef Teuchos::ScalarTraits<scalar_type> STS;
810 else if (beta != one) {
814 const size_t NumVectors = Y.getNumVectors ();
815 const size_t numRows = localRowMap_->getNodeNumElements ();
822 const bool constantStride = X.isConstantStride () && Y.isConstantStride ();
823 if (constantStride) {
826 const size_t x_stride = X.getStride();
827 const size_t y_stride = Y.getStride();
828 ArrayRCP<scalar_type> y_rcp = Y.get1dViewNonConst();
829 ArrayRCP<const scalar_type> x_rcp = X.get1dView();
830 ArrayView<scalar_type> y_ptr = y_rcp();
831 ArrayView<const scalar_type> x_ptr = x_rcp();
832 for (
size_t i = 0; i < numRows; ++i) {
836 if (mode == Teuchos::NO_TRANS) {
837 for (
size_t j = 0; j < Nnz; ++j) {
839 for (
size_t k = 0; k < NumVectors; ++k) {
840 y_ptr[i + y_stride*k] +=
841 alpha * Values_[j] * x_ptr[col + x_stride*k];
845 else if (mode == Teuchos::TRANS) {
846 for (
size_t j = 0; j < Nnz; ++j) {
848 for (
size_t k = 0; k < NumVectors; ++k) {
849 y_ptr[col + y_stride*k] +=
850 alpha * Values_[j] * x_ptr[i + x_stride*k];
855 for (
size_t j = 0; j < Nnz; ++j) {
857 for (
size_t k = 0; k < NumVectors; ++k) {
858 y_ptr[col + y_stride*k] +=
859 alpha * STS::conjugate (Values_[j]) * x_ptr[i + x_stride*k];
868 ArrayRCP<ArrayRCP<const scalar_type> > x_ptr = X.get2dView();
869 ArrayRCP<ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
871 for (
size_t i = 0; i < numRows; ++i) {
875 if (mode == Teuchos::NO_TRANS) {
876 for (
size_t k = 0; k < NumVectors; ++k) {
877 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
878 ArrayView<scalar_type> y_local = (y_ptr())[k]();
879 for (
size_t j = 0; j < Nnz; ++j) {
880 y_local[i] += alpha * Values_[j] * x_local[localIndices_[j]];
884 else if (mode == Teuchos::TRANS) {
885 for (
size_t k = 0; k < NumVectors; ++k) {
886 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
887 ArrayView<scalar_type> y_local = (y_ptr())[k]();
888 for (
size_t j = 0; j < Nnz; ++j) {
889 y_local[localIndices_[j]] += alpha * Values_[j] * x_local[i];
894 for (
size_t k = 0; k < NumVectors; ++k) {
895 ArrayView<const scalar_type> x_local = (x_ptr())[k]();
896 ArrayView<scalar_type> y_local = (y_ptr())[k]();
897 for (
size_t j = 0; j < Nnz; ++j) {
898 y_local[localIndices_[j]] +=
899 alpha * STS::conjugate (Values_[j]) * x_local[i];
907 template<
class MatrixType>
914 template<
class MatrixType>
921 template<
class MatrixType>
923 LocalFilter<MatrixType>::mag_type
926 #ifdef TPETRA_HAVE_KOKKOS_REFACTOR 927 typedef Kokkos::Details::ArithTraits<scalar_type> STS;
928 typedef Kokkos::Details::ArithTraits<mag_type> STM;
930 typedef Teuchos::ScalarTraits<scalar_type> STS;
931 typedef Teuchos::ScalarTraits<magnitude_type> STM;
933 typedef typename Teuchos::Array<scalar_type>::size_type size_type;
936 Teuchos::Array<local_ordinal_type> ind (maxNumRowEnt);
937 Teuchos::Array<scalar_type> val (maxNumRowEnt);
938 const size_t numRows =
static_cast<size_t> (localRowMap_->getNodeNumElements ());
941 mag_type sumSquared = STM::zero ();
942 for (
size_t i = 0; i < numRows; ++i) {
943 size_t numEntries = 0;
945 for (size_type k = 0; k < static_cast<size_type> (numEntries); ++k) {
946 const mag_type v_k_abs = STS::magnitude (val[k]);
947 sumSquared += v_k_abs * v_k_abs;
950 return STM::squareroot (sumSquared);
953 template<
class MatrixType>
957 using Teuchos::TypeNameTraits;
958 std::ostringstream os;
960 os <<
"Ifpack2::LocalFilter: {";
961 os <<
"MatrixType: " << TypeNameTraits<MatrixType>::name ();
962 if (this->getObjectLabel () !=
"") {
963 os <<
", Label: \"" << this->getObjectLabel () <<
"\"";
972 template<
class MatrixType>
976 const Teuchos::EVerbosityLevel verbLevel)
const 978 using Teuchos::OSTab;
979 using Teuchos::TypeNameTraits;
982 const Teuchos::EVerbosityLevel vl =
983 (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
985 if (vl > Teuchos::VERB_NONE) {
989 out <<
"Ifpack2::LocalFilter:" << endl;
991 out <<
"MatrixType: " << TypeNameTraits<MatrixType>::name () << endl;
992 if (this->getObjectLabel () !=
"") {
993 out <<
"Label: \"" << this->getObjectLabel () <<
"\"" << endl;
997 <<
"Number of nonzeros: " << NumNonzeros_ << endl;
999 if (vl > Teuchos::VERB_LOW) {
1000 out <<
"Row Map:" << endl;
1001 localRowMap_->describe (out, vl);
1002 out <<
"Domain Map:" << endl;
1003 localDomainMap_->describe (out, vl);
1004 out <<
"Range Map:" << endl;
1005 localRangeMap_->describe (out, vl);
1010 template<
class MatrixType>
1011 Teuchos::RCP<
const Tpetra::RowMatrix<
typename MatrixType::scalar_type,
1012 typename MatrixType::local_ordinal_type,
1013 typename MatrixType::global_ordinal_type,
1014 typename MatrixType::node_type> >
1023 #define IFPACK2_LOCALFILTER_INSTANT(S,LO,GO,N) \ 1024 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:723
virtual size_t getNodeNumDiags() const
The number of local diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_LocalFilter_def.hpp:465
virtual Teuchos::RCP< const map_type > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:316
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:975
virtual Teuchos::RCP< node_type > getNode() const
Returns the underlying Node object.
Definition: Ifpack2_LocalFilter_def.hpp:306
virtual size_t getNodeNumRows() const
The number of rows owned on the calling process.
Definition: Ifpack2_LocalFilter_def.hpp:380
virtual Teuchos::RCP< const map_type > getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:336
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_LocalFilter_def.hpp:521
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the communicator.
Definition: Ifpack2_LocalFilter_def.hpp:298
virtual size_t getNodeMaxNumRowEntries() const
The maximum number of entries across all rows/columns on this process.
Definition: Ifpack2_LocalFilter_def.hpp:479
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:733
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:190
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
Definition: Ifpack2_LocalFilter_def.hpp:908
virtual bool isLocallyIndexed() const
Whether the underlying sparse matrix is locally (opposite of globally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:507
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:674
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:698
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 mag_type getFrobeniusNorm() const
The Frobenius norm of the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:924
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:356
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:187
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_LocalFilter_def.hpp:915
virtual global_size_t getGlobalNumDiags() const
The number of global diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_LocalFilter_def.hpp:458
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:418
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:713
virtual global_ordinal_type getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:395
virtual bool isGloballyIndexed() const
Whether the underlying sparse matrix is globally (opposite of locally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:514
virtual bool isUpperTriangular() const
Whether this matrix is upper triangular.
Definition: Ifpack2_LocalFilter_def.hpp:500
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on all processes.
Definition: Ifpack2_LocalFilter_def.hpp:472
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:574
virtual size_t getNodeNumCols() const
The number of columns in the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:387
LocalFilter(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_LocalFilter_def.hpp:149
virtual ~LocalFilter()
Destructor.
Definition: Ifpack2_LocalFilter_def.hpp:292
virtual global_size_t getGlobalNumRows() const
The number of global rows in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:366
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:184
virtual std::string description() const
A one-line description of this object.
Definition: Ifpack2_LocalFilter_def.hpp:955
virtual size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:409
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:437
virtual Teuchos::RCP< const map_type > getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:346
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:402
virtual Teuchos::RCP< const row_matrix_type > getUnderlyingMatrix() const
Return matrix that LocalFilter was built on.
Definition: Ifpack2_LocalFilter_def.hpp:1015
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:530
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:160
virtual global_size_t getGlobalNumCols() const
The number of global columns in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:373
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
virtual bool isLowerTriangular() const
Whether this matrix is lower triangular.
Definition: Ifpack2_LocalFilter_def.hpp:493
virtual Teuchos::RCP< const map_type > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:326
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:686
virtual bool hasColMap() const
Whether this matrix has a well-defined column Map.
Definition: Ifpack2_LocalFilter_def.hpp:486
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:193