43 #ifndef IFPACK2_LOCALFILTER_DECL_HPP 44 #define IFPACK2_LOCALFILTER_DECL_HPP 46 #include "Ifpack2_ConfigDefs.hpp" 47 #include "Tpetra_ConfigDefs.hpp" 48 #include "Tpetra_RowMatrix.hpp" 49 #include "Teuchos_RefCountPtr.hpp" 50 #include "Teuchos_ScalarTraits.hpp" 99 template<
class MatrixType>
101 virtual public Tpetra::RowMatrix<typename MatrixType::scalar_type,
102 typename MatrixType::local_ordinal_type,
103 typename MatrixType::global_ordinal_type,
104 typename MatrixType::node_type>
114 TEUCHOS_DEPRECATED
typedef typename MatrixType::scalar_type
Scalar;
121 TEUCHOS_DEPRECATED
typedef typename MatrixType::local_ordinal_type
LocalOrdinal;
128 TEUCHOS_DEPRECATED
typedef typename MatrixType::global_ordinal_type
GlobalOrdinal;
135 TEUCHOS_DEPRECATED
typedef typename MatrixType::node_type
Node;
139 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
142 TEUCHOS_DEPRECATED
typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitudeType;
155 explicit LocalFilter (
const Teuchos::RCP<
const Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> >& Matrix);
165 virtual const Teuchos::RCP<const Teuchos::Comm<int> > &
getComm()
const;
168 virtual Teuchos::RCP<node_type>
getNode()
const;
171 virtual const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > &
getRowMap()
const;
174 virtual const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > &
getColMap()
const;
177 virtual const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > &
getDomainMap()
const;
180 virtual const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > &
getRangeMap()
const;
183 virtual Teuchos::RCP<const Tpetra::RowGraph<local_ordinal_type,global_ordinal_type,node_type> >
getGraph()
const;
271 const Teuchos::ArrayView<global_ordinal_type> &Indices,
272 const Teuchos::ArrayView<scalar_type> &Values,
273 size_t &NumEntries)
const;
288 const Teuchos::ArrayView<local_ordinal_type> &Indices,
289 const Teuchos::ArrayView<scalar_type> &Values,
290 size_t &NumEntries)
const ;
304 Teuchos::ArrayView<const global_ordinal_type> &indices,
305 Teuchos::ArrayView<const scalar_type> &values)
const;
319 Teuchos::ArrayView<const local_ordinal_type> &indices,
320 Teuchos::ArrayView<const scalar_type> &values)
const;
326 getLocalDiagCopy (Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &diag)
const;
341 virtual void leftScale(
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x);
352 virtual void rightScale(
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x);
371 apply (
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &X,
372 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &Y,
373 Teuchos::ETransp mode = Teuchos::NO_TRANS,
374 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
375 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
395 TPETRA_DEPRECATED
virtual void getGlobalRowView(global_ordinal_type GlobalRow,
396 Teuchos::ArrayRCP<const global_ordinal_type> &indices,
397 Teuchos::ArrayRCP<const scalar_type> &values)
const;
409 TPETRA_DEPRECATED
virtual void getLocalRowView(local_ordinal_type LocalRow,
410 Teuchos::ArrayRCP<const local_ordinal_type> &indices,
411 Teuchos::ArrayRCP<const scalar_type> &values)
const;
418 Teuchos::RCP<const Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> > A_;
420 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> > LocalMap_;
426 size_t MaxNumEntries_;
428 size_t MaxNumEntriesA_;
430 std::vector<size_t> NumEntries_;
432 mutable Teuchos::Array<local_ordinal_type> Indices_;
434 mutable Teuchos::Array<scalar_type> Values_;
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:443
virtual size_t getNodeNumDiags() const
The number of local diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_LocalFilter_def.hpp:286
virtual magnitude_type getFrobeniusNorm() const
The Frobenius norm of the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:524
virtual const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:168
virtual Teuchos::RCP< node_type > getNode() const
Returns the underlying Kokkos Node object.
Definition: Ifpack2_LocalFilter_def.hpp:158
virtual size_t getNodeNumRows() const
The number of rows owned on the calling process.
Definition: Ifpack2_LocalFilter_def.hpp:229
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_LocalFilter_def.hpp:342
TEUCHOS_DEPRECATED typedef MatrixType::global_ordinal_type GlobalOrdinal
Preserved only for backwards compatibility. Please use "global_ordinal_type".
Definition: Ifpack2_LocalFilter_decl.hpp:128
virtual size_t getNodeMaxNumRowEntries() const
The maximum number of entries across all rows/columns on this process.
Definition: Ifpack2_LocalFilter_def.hpp:300
virtual void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Computes the operator-multivector application.
Definition: Ifpack2_LocalFilter_def.hpp:450
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:125
virtual bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
Definition: Ifpack2_LocalFilter_def.hpp:510
virtual bool isLocallyIndexed() const
Whether the underlying sparse matrix is locally (opposite of globally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:328
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:405
virtual void getLocalDiagCopy(Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
Definition: Ifpack2_LocalFilter_def.hpp:423
virtual const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const
Returns the communicator.
Definition: Ifpack2_LocalFilter_def.hpp:151
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:208
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:118
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_LocalFilter_def.hpp:517
virtual global_size_t getGlobalNumDiags() const
The number of global diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_LocalFilter_def.hpp:279
virtual const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:178
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:265
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:436
virtual global_ordinal_type getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:244
virtual bool isGloballyIndexed() const
Whether the underlying sparse matrix is globally (opposite of locally) indexed.
Definition: Ifpack2_LocalFilter_def.hpp:335
virtual bool isUpperTriangular() const
Whether this matrix is upper triangular.
Definition: Ifpack2_LocalFilter_def.hpp:321
virtual size_t getGlobalMaxNumRowEntries() const
The maximum number of entries across all rows/columns on all processes.
Definition: Ifpack2_LocalFilter_def.hpp:293
virtual void getLocalRowCopy(local_ordinal_type LocalRow, const Teuchos::ArrayView< local_ordinal_type > &Indices, const Teuchos::ArrayView< scalar_type > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the graph. Put into storage allocated by callin...
Definition: Ifpack2_LocalFilter_def.hpp:359
virtual size_t getNodeNumCols() const
The number of columns in the (locally filtered) matrix.
Definition: Ifpack2_LocalFilter_def.hpp:237
TEUCHOS_DEPRECATED typedef Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitudeType
Preserved only for backwards compatibility. Please use "magnitude_type".
Definition: Ifpack2_LocalFilter_decl.hpp:142
LocalFilter(const Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &Matrix)
Constructor.
Definition: Ifpack2_LocalFilter_def.hpp:65
virtual ~LocalFilter()
Destructor.
Definition: Ifpack2_LocalFilter_def.hpp:147
virtual global_size_t getGlobalNumRows() const
The number of global rows in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:215
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:111
virtual size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:258
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:272
TEUCHOS_DEPRECATED typedef MatrixType::scalar_type Scalar
Preserved only for backwards compatibility. Please use "scalar_type".
Definition: Ifpack2_LocalFilter_decl.hpp:114
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_LocalFilter_decl.hpp:139
virtual const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:188
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:251
virtual void getGlobalRowCopy(global_ordinal_type GlobalRow, const Teuchos::ArrayView< global_ordinal_type > &Indices, const Teuchos::ArrayView< scalar_type > &Values, size_t &NumEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
Definition: Ifpack2_LocalFilter_def.hpp:349
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:100
virtual global_size_t getGlobalNumCols() const
The number of global columns in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:222
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
virtual bool isLowerTriangular() const
Whether this matrix is lower triangular.
Definition: Ifpack2_LocalFilter_def.hpp:314
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:414
TEUCHOS_DEPRECATED typedef MatrixType::node_type Node
Preserved only for backwards compatibility. Please use "node_type".
Definition: Ifpack2_LocalFilter_decl.hpp:135
virtual bool hasColMap() const
Whether this matrix has a well-defined column Map.
Definition: Ifpack2_LocalFilter_def.hpp:307
TEUCHOS_DEPRECATED typedef MatrixType::local_ordinal_type LocalOrdinal
Preserved only for backwards compatibility. Please use "local_ordinal_type".
Definition: Ifpack2_LocalFilter_decl.hpp:121
virtual const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_LocalFilter_def.hpp:198
MatrixType::node_type node_type
The type of the Kokkos Node used by the input MatrixType.
Definition: Ifpack2_LocalFilter_decl.hpp:132