Ifpack2 Templated Preconditioning Package  Version 1.0
Ifpack2_SparsityFilter_def.hpp
1 /*@HEADER
2 // ***********************************************************************
3 //
4 // Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
5 // Copyright (2009) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 */
42 
43 #ifndef IFPACK2_SPARSITYFILTER_DEF_HPP
44 #define IFPACK2_SPARSITYFILTER_DEF_HPP
45 
46 #include "Tpetra_Map.hpp"
47 #include "Tpetra_MultiVector.hpp"
48 #include "Tpetra_Vector.hpp"
49 
50 #include <algorithm>
51 #include <vector>
52 
53 namespace Ifpack2 {
54 
55 //==========================================================================
56 template<class MatrixType>
57 SparsityFilter<MatrixType>::SparsityFilter(const Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& Matrix,
58  size_t AllowedNumEntries,
59  LocalOrdinal AllowedBandwidth):
60  A_(Matrix),
61  AllowedNumEntries_(AllowedNumEntries),
62  AllowedBandwidth_(AllowedBandwidth),
63  NumRows_(0),
64  NumNonzeros_(0),
65  MaxNumEntries_(0),
66  MaxNumEntriesA_(0)
67 {
68 
69  // use this filter only on serial matrices
70  TEUCHOS_TEST_FOR_EXCEPTION(
71  A_->getComm()->getSize() != 1 || A_->getNodeNumRows() != A_->getGlobalNumRows(),
72  std::runtime_error, "Ifpack2::SparsityFilter: "
73  "This class may only be used when A.getComm()->getSize() == 1.");
74 
75  // localized matrix has all the local rows of Matrix
76  NumRows_ = A_->getNodeNumRows();
77 
78  // NodeNumEntries_ will contain the actual number of nonzeros
79  // for each localized row (that is, without external nodes,
80  // and always with the diagonal entry)
81  NumEntries_.resize(NumRows_);
82 
83  // tentative value for MaxNumEntries. This is the number of
84  // nonzeros in the local matrix
85  MaxNumEntries_ = A_->getNodeMaxNumRowEntries();
86  MaxNumEntriesA_ = A_->getNodeMaxNumRowEntries();
87 
88  // ExtractMyRowCopy() will use these vectors
89  Kokkos::resize(Indices_,MaxNumEntries_);
90  Kokkos::resize(Values_,MaxNumEntries_);
91 
92  size_t ActualMaxNumEntries = 0;
93  for (size_t i = 0 ; i < NumRows_ ; ++i) {
94  NumEntries_[i] = MaxNumEntriesA_;
95  size_t Nnz;
96  A_->getLocalRowCopy(i,Indices_,Values_,Nnz);
97 
98  NumNonzeros_ += Nnz;
99  NumEntries_[i] = Nnz;
100  if (Nnz > ActualMaxNumEntries)
101  ActualMaxNumEntries = Nnz;
102  }
103 
104  MaxNumEntries_ = ActualMaxNumEntries;
105 }
106 
107 //=========================================================================
108 template<class MatrixType>
110 
111 //==========================================================================
112 template<class MatrixType>
113 Teuchos::RCP<const Teuchos::Comm<int> > SparsityFilter<MatrixType>::getComm() const
114 {
115  return A_->getComm();
116 }
117 
118 
119 //==========================================================================
120 template<class MatrixType>
121 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
122  typename MatrixType::global_ordinal_type,
123  typename MatrixType::node_type> >
125 {
126  return A_->getRowMap();
127 }
128 
129 //==========================================================================
130 template<class MatrixType>
131 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
132  typename MatrixType::global_ordinal_type,
133  typename MatrixType::node_type> >
135 {
136  return A_->getColMap();
137 }
138 
139 //==========================================================================
140 template<class MatrixType>
141 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
142  typename MatrixType::global_ordinal_type,
143  typename MatrixType::node_type> >
145 {
146  return A_->getDomainMap();
147 }
148 
149 //==========================================================================
150 template<class MatrixType>
151 Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
152  typename MatrixType::global_ordinal_type,
153  typename MatrixType::node_type> >
155 {
156  return A_->getRangeMap();
157 }
158 
159 //==========================================================================
160 template<class MatrixType>
161 Teuchos::RCP<const Tpetra::RowGraph<typename MatrixType::local_ordinal_type,
162  typename MatrixType::global_ordinal_type,
163  typename MatrixType::node_type> >
165 {
166  throw std::runtime_error("Ifpack2::SparsityFilter: does not support getGraph.");
167 }
168 
169 //==========================================================================
170 template<class MatrixType>
172 {
173  return NumRows_;
174 }
175 
176 //==========================================================================
177 template<class MatrixType>
179 {
180  return NumRows_;
181 }
182 
183 //==========================================================================
184 template<class MatrixType>
186 {
187  return NumRows_;
188 }
189 
190 //==========================================================================
191 
192 template<class MatrixType>
194 {
195  return NumRows_;
196 }
197 
198 //==========================================================================
199 template<class MatrixType>
200 typename MatrixType::global_ordinal_type SparsityFilter<MatrixType>::getIndexBase() const
201 {
202  return A_->getIndexBase();
203 }
204 
205 //==========================================================================
206 template<class MatrixType>
208 {
209  return NumNonzeros_;
210 }
211 
212 //==========================================================================
213 template<class MatrixType>
215 {
216  return NumNonzeros_;
217 }
218 
219 //==========================================================================
220 template<class MatrixType>
221 size_t SparsityFilter<MatrixType>::getNumEntriesInGlobalRow(GlobalOrdinal /* globalRow */) const
222 {
223  throw std::runtime_error("Ifpack2::SparsityFilter does not implement getNumEntriesInGlobalRow.");
224 }
225 
226 //==========================================================================
227 template<class MatrixType>
228 size_t SparsityFilter<MatrixType>::getNumEntriesInLocalRow(LocalOrdinal localRow) const
229 {
230  return NumEntries_[localRow];
231 }
232 
233 //==========================================================================
234 template<class MatrixType>
236 {
237  return MaxNumEntries_;
238 }
239 
240 //==========================================================================
241 template<class MatrixType>
243 {
244  return MaxNumEntries_;
245 }
246 
247 //==========================================================================
248 template<class MatrixType>
250 {
251  return true;
252 }
253 
254 //==========================================================================
255 template<class MatrixType>
257 {
258  return A_->isLocallyIndexed();
259 }
260 
261 //==========================================================================
262 template<class MatrixType>
264 {
265  return A_->isGloballyIndexed();
266 }
267 
268 //==========================================================================
269 template<class MatrixType>
271 {
272  return A_->isFillComplete();
273 }
274 
275 //==========================================================================
276 template<class MatrixType>
278 getGlobalRowCopy (GlobalOrdinal /*GlobalRow*/,
279  nonconst_global_inds_host_view_type &/*Indices*/,
280  nonconst_values_host_view_type &/*Values*/,
281  size_t& /*NumEntries*/) const {
282  throw std::runtime_error("Ifpack2::SparsityFilter does not implement getGlobalRowCopy.");
283 }
284 
285 //==========================================================================
286 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
287 template<class MatrixType>
289 getGlobalRowCopy(GlobalOrdinal /* GlobalRow */,
290  const Teuchos::ArrayView<GlobalOrdinal> &/* Indices */,
291  const Teuchos::ArrayView<Scalar> &/* Values */,
292  size_t &/* NumEntries */) const
293 {
294  throw std::runtime_error("Ifpack2::SparsityFilter does not implement getGlobalRowCopy.");
295 }
296 #endif
297 
298 //==========================================================================
299 template<class MatrixType>
301  getLocalRowCopy (LocalOrdinal LocalRow,
302  nonconst_local_inds_host_view_type &Indices,
303  nonconst_values_host_view_type &Values,
304  size_t& NumEntries) const
305 {
306 TEUCHOS_TEST_FOR_EXCEPTION((LocalRow < 0 || (size_t) LocalRow >= NumRows_ || (size_t) Indices.size() < NumEntries_[LocalRow]), std::runtime_error, "Ifpack2::SparsityFilter::getLocalRowCopy invalid row or array size.");
307 
308  // Note: This function will work correctly if called by apply, say, with Indices_ and Values_ as
309  // parameters. The structure of the loop below should make that obvious.
310 
311  // always extract using the object Values_ and Indices_.
312  // This is because I need more space than that given by
313  // the user (for the external nodes)
314  size_t A_NumEntries=0;
315  A_->getLocalRowCopy(LocalRow,Indices_,Values_,A_NumEntries);
316  magnitudeType Threshold = Teuchos::ScalarTraits<magnitudeType>::zero();
317  std::vector<magnitudeType> Values2(A_NumEntries,Teuchos::ScalarTraits<magnitudeType>::zero());
318 
319  if (A_NumEntries > AllowedNumEntries_) {
320  size_t count = 0;
321  for (size_t i = 0 ; i < A_NumEntries ; ++i) {
322  // skip diagonal entry (which is always inserted)
323  if (Indices_[i] == LocalRow)
324  continue;
325  // put magnitude
326  Values2[count] = Teuchos::ScalarTraits<Scalar>::magnitude(Values_[i]);
327  count++;
328  }
329 
330  // sort in descending order
331  std::sort(Values2.rbegin(),Values2.rend());
332  // get the cut-off value
333  Threshold = Values2[AllowedNumEntries_ - 1];
334  }
335 
336 
337  // loop over all nonzero elements of row MyRow,
338  // and drop elements below specified threshold.
339  // Also, add value to zero diagonal
340  NumEntries = 0;
341  for (size_t i = 0 ; i < A_NumEntries ; ++i) {
342  if (std::abs(Indices_[i] - LocalRow) > AllowedBandwidth_)
343  continue;
344 
345  if ((Indices_[i] != LocalRow) && (Teuchos::ScalarTraits<Scalar>::magnitude(Values_[i]) < Threshold))
346  continue;
347 
348  Values[NumEntries] = Values_[i];
349  Indices[NumEntries] = Indices_[i];
350 
351  NumEntries++;
352  if (NumEntries > AllowedNumEntries_)
353  break;
354  }
355 
356 
357 }
358 
359 //==========================================================================
360 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
361 template<class MatrixType>
363 getLocalRowCopy(LocalOrdinal DropRow,
364  const Teuchos::ArrayView<LocalOrdinal> &Indices,
365  const Teuchos::ArrayView<Scalar> &Values,
366  size_t &NumEntries) const
367 {
368  using IST = typename row_matrix_type::impl_scalar_type;
369  nonconst_local_inds_host_view_type ind_in(Indices.data(),Indices.size());
370  nonconst_values_host_view_type val_in(reinterpret_cast<IST*>(Values.data()),Values.size());
371  getLocalRowCopy(DropRow,ind_in,val_in,NumEntries);
372 }
373 #endif
374 
375 //==========================================================================
376 template<class MatrixType>
377 void SparsityFilter<MatrixType>::getGlobalRowView(GlobalOrdinal /* GlobalRow */,
378  global_inds_host_view_type &/*indices*/,
379  values_host_view_type &/*values*/) const
380 {
381  throw std::runtime_error("Ifpack2::SparsityFilter: does not support getGlobalRowView.");
382 }
383 
384 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
385 template<class MatrixType>
386 void SparsityFilter<MatrixType>::getGlobalRowView(GlobalOrdinal /* GlobalRow */,
387  Teuchos::ArrayView<const GlobalOrdinal> &/* indices */,
388  Teuchos::ArrayView<const Scalar> &/* values */) const
389 {
390  throw std::runtime_error("Ifpack2::SparsityFilter: does not support getGlobalRowView.");
391 }
392 #endif
393 
394 //==========================================================================
395 template<class MatrixType>
396 void SparsityFilter<MatrixType>::getLocalRowView(LocalOrdinal /* LocalRow */,
397  local_inds_host_view_type & /*indices*/,
398  values_host_view_type & /*values*/) const
399 {
400  throw std::runtime_error("Ifpack2::SparsityFilter: does not support getLocalRowView.");
401 }
402 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
403 template<class MatrixType>
404 void SparsityFilter<MatrixType>::getLocalRowView(LocalOrdinal /* LocalRow */,
405  Teuchos::ArrayView<const LocalOrdinal> &/* indices */,
406  Teuchos::ArrayView<const Scalar> &/* values */) const
407 {
408  throw std::runtime_error("Ifpack2::SparsityFilter: does not support getLocalRowView.");
409 }
410 #endif
411 
412 //==========================================================================
413 template<class MatrixType>
414 void SparsityFilter<MatrixType>::getLocalDiagCopy(Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &diag) const
415 {
416  // This is somewhat dubious as to how the maps match.
417  return A_->getLocalDiagCopy(diag);
418 }
419 
420 //==========================================================================
421 template<class MatrixType>
422 void SparsityFilter<MatrixType>::leftScale(const Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& /* x */)
423 {
424  throw std::runtime_error("Ifpack2::SparsityFilter does not support leftScale.");
425 }
426 
427 //==========================================================================
428 template<class MatrixType>
429 void SparsityFilter<MatrixType>::rightScale(const Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& /* x */)
430 {
431  throw std::runtime_error("Ifpack2::SparsityFilter does not support rightScale.");
432 }
433 
434 //==========================================================================
435 template<class MatrixType>
436 void SparsityFilter<MatrixType>::apply(const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X,
437  Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
438  Teuchos::ETransp mode,
439  Scalar /* alpha */,
440  Scalar /* beta */) const
441 {
442  // Note: This isn't AztecOO compliant. But neither was Ifpack's version.
443  // Note: The localized maps mean the matvec is trivial (and has no import)
444  TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
445  "Ifpack2::SparsityFilter::apply ERROR: X.getNumVectors() != Y.getNumVectors().");
446 
447  Scalar zero = Teuchos::ScalarTraits<Scalar>::zero();
448  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> > x_ptr = X.get2dView();
449  Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > y_ptr = Y.get2dViewNonConst();
450 
451  Y.putScalar(zero);
452  size_t NumVectors = Y.getNumVectors();
453 
454  for (size_t i = 0 ; i < NumRows_ ; ++i) {
455  size_t Nnz;
456  // Use this class's getrow to make the below code simpler
457  getLocalRowCopy(i,Indices_,Values_,Nnz);
458  Scalar* Values = reinterpret_cast<Scalar*>(Values_.data());
459  if (mode==Teuchos::NO_TRANS){
460  for (size_t j = 0 ; j < Nnz ; ++j)
461  for (size_t k = 0 ; k < NumVectors ; ++k)
462  y_ptr[k][i] += Values[j] * x_ptr[k][Indices_[j]];
463  }
464  else if (mode==Teuchos::TRANS){
465  for (size_t j = 0 ; j < Nnz ; ++j)
466  for (size_t k = 0 ; k < NumVectors ; ++k)
467  y_ptr[k][Indices_[j]] += Values[j] * x_ptr[k][i];
468  }
469  else { //mode==Teuchos::CONJ_TRANS
470  for (size_t j = 0 ; j < Nnz ; ++j)
471  for (size_t k = 0 ; k < NumVectors ; ++k)
472  y_ptr[k][Indices_[j]] += Teuchos::ScalarTraits<Scalar>::conjugate(Values[j]) * x_ptr[k][i];
473  }
474  }
475 }
476 
477 
478 //==========================================================================
479 template<class MatrixType>
481 {
482  return true;
483 }
484 
485 //==========================================================================
486 template<class MatrixType>
488 {
489  return false;
490 }
491 
492 //==========================================================================
493 template<class MatrixType>
494 typename SparsityFilter<MatrixType>::mag_type SparsityFilter<MatrixType>::getFrobeniusNorm() const
495 {
496  throw std::runtime_error("Ifpack2::SparsityFilter does not implement getFrobeniusNorm.");
497 }
498 
499 } // namespace Ifpack2
500 
501 #define IFPACK2_SPARSITYFILTER_INSTANT(S,LO,GO,N) \
502  template class Ifpack2::SparsityFilter< Tpetra::RowMatrix<S, LO, GO, N> >;
503 
504 #endif
virtual void getLocalDiagCopy(Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
Definition: Ifpack2_SparsityFilter_def.hpp:414
virtual size_t getNodeNumCols() const
Returns the number of columns needed to apply the forward operator on this node, i.e., the number of elements listed in the column map.
Definition: Ifpack2_SparsityFilter_def.hpp:193
virtual size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
Definition: Ifpack2_SparsityFilter_def.hpp:235
virtual global_size_t getGlobalNumRows() const
Returns the number of global rows in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:171
virtual void getGlobalRowView(GlobalOrdinal 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_SparsityFilter_def.hpp:377
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_SparsityFilter_def.hpp:487
virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow, nonconst_global_inds_host_view_type &Indices, nonconst_values_host_view_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_SparsityFilter_def.hpp:278
virtual ~SparsityFilter()
Destructor.
Definition: Ifpack2_SparsityFilter_def.hpp:109
virtual bool hasColMap() const
Indicates whether this matrix has a well-defined column map.
Definition: Ifpack2_SparsityFilter_def.hpp:249
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the communicator.
Definition: Ifpack2_SparsityFilter_def.hpp:113
SparsityFilter(const Teuchos::RCP< const row_matrix_type > &Matrix, size_t AllowedNumEntries, LocalOrdinal AllowedBandwidth=-Teuchos::ScalarTraits< LocalOrdinal >::one())
Constructor.
Definition: Ifpack2_SparsityFilter_def.hpp:57
virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
Definition: Ifpack2_SparsityFilter_def.hpp:221
virtual bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
Definition: Ifpack2_SparsityFilter_def.hpp:263
virtual bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
Definition: Ifpack2_SparsityFilter_def.hpp:256
virtual size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
Definition: Ifpack2_SparsityFilter_def.hpp:242
virtual bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
Definition: Ifpack2_SparsityFilter_def.hpp:480
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_SparsityFilter_def.hpp:270
virtual mag_type getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:494
virtual GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:200
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:207
virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
Definition: Ifpack2_SparsityFilter_def.hpp:228
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:154
virtual void apply(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
Definition: Ifpack2_SparsityFilter_def.hpp:436
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:124
virtual void getLocalRowView(LocalOrdinal 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_SparsityFilter_def.hpp:396
virtual void rightScale(const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Scales the RowMatrix on the right with the Vector x.
Definition: Ifpack2_SparsityFilter_def.hpp:429
virtual void leftScale(const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Scales the RowMatrix on the left with the Vector x.
Definition: Ifpack2_SparsityFilter_def.hpp:422
virtual global_size_t getGlobalNumCols() const
Returns the number of global columns in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:178
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:73
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:144
virtual Teuchos::RCP< const Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node > > getGraph() const
Returns the RowGraph associated with this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:164
virtual void getLocalRowCopy(LocalOrdinal LocalRow, nonconst_local_inds_host_view_type &Indices, nonconst_values_host_view_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_SparsityFilter_def.hpp:301
virtual size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:214
virtual size_t getNodeNumRows() const
Returns the number of rows owned on the calling node.
Definition: Ifpack2_SparsityFilter_def.hpp:185
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_SparsityFilter_def.hpp:134