Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_ReorderFilter_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_REORDERFILTER_DEF_HPP
44 #define IFPACK2_REORDERFILTER_DEF_HPP
45 #include "Ifpack2_ReorderFilter_decl.hpp"
46 #include <vector>
47 
48 #include "Tpetra_ConfigDefs.hpp"
49 #include "Tpetra_RowMatrix.hpp"
50 #include "Tpetra_Map.hpp"
51 #include "Tpetra_MultiVector.hpp"
52 #include "Tpetra_Vector.hpp"
53 
54 namespace Ifpack2 {
55 
56 template<class MatrixType>
60  const Teuchos::ArrayRCP<local_ordinal_type>& reverseperm)
61  : A_ (A),
62  perm_ (perm),
63  reverseperm_ (reverseperm)
64 {
66  A_.is_null (), std::invalid_argument,
67  "Ifpack2::ReorderFilter: The input matrix is null.");
68 
69  // use this filter only on serial matrices
71  A_->getComm()->getSize() != 1, std::invalid_argument,
72  "Ifpack2::ReorderFilter: This class may only be used if the input matrix's "
73  "communicator has one process. This class is an implementation detail of "
74  "Ifpack2::AdditiveSchwarz, and it is not meant to be used otherwise.");
75 
77  A_->getNodeNumRows () != A_->getGlobalNumRows (),
78  std::invalid_argument,
79  "Ifpack2::ReorderFilter: The input matrix is not square.");
80 
81  // Temp arrays for apply
82  Indices_.resize (A_->getNodeMaxNumRowEntries ());
83  Values_.resize (A_->getNodeMaxNumRowEntries ());
84 }
85 
86 
87 template<class MatrixType>
89 
90 
91 template<class MatrixType>
93 {
94  return A_->getComm();
95 }
96 
97 
98 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
99 template<class MatrixType>
100 TPETRA_DEPRECATED
103 {
104  return Teuchos::null;
105 }
106 #endif // TPETRA_ENABLE_DEPRECATED_CODE
107 
108 
109 template<class MatrixType>
112 {
114  A_.is_null (), std::runtime_error, "Ifpack2::ReorderFilter::"
115  "getRowMap: The matrix A is null, so there is no row Map.");
116 
117  return A_->getRowMap ();
118 }
119 
120 
121 template<class MatrixType>
124 {
126  A_.is_null (), std::runtime_error, "Ifpack2::ReorderFilter::"
127  "getColMap: The matrix A is null, so there is no column Map.");
128 
129  return A_->getColMap();
130 }
131 
132 
133 template<class MatrixType>
136 {
138  A_.is_null (), std::runtime_error, "Ifpack2::ReorderFilter::"
139  "getDomainMap: The matrix A is null, so there is no domain Map.");
140 
141  return A_->getDomainMap();
142 }
143 
144 
145 template<class MatrixType>
148 {
150  A_.is_null (), std::runtime_error, "Ifpack2::ReorderFilter::"
151  "getRangeMap: The matrix A is null, so there is no range Map.");
152 
153  return A_->getRangeMap();
154 }
155 
156 
157 template<class MatrixType>
158 Teuchos::RCP<const Tpetra::RowGraph<typename MatrixType::local_ordinal_type,
159  typename MatrixType::global_ordinal_type,
160  typename MatrixType::node_type> >
162 {
163  throw std::runtime_error("Ifpack2::ReorderFilter: does not support getGraph.");
164 }
165 
166 
167 template<class MatrixType>
169 {
170  return A_->getGlobalNumRows();
171 }
172 
173 
174 template<class MatrixType>
176 {
177  return A_->getGlobalNumCols();
178 }
179 
180 
181 template<class MatrixType>
183 {
184  return A_->getNodeNumRows();
185 }
186 
187 
188 template<class MatrixType>
190 {
191  return A_->getNodeNumCols();
192 }
193 
194 
195 template<class MatrixType>
196 typename MatrixType::global_ordinal_type ReorderFilter<MatrixType>::getIndexBase() const
197 {
198  return A_->getIndexBase();
199 }
200 
201 
202 template<class MatrixType>
204 {
205  return A_->getGlobalNumEntries();
206 }
207 
208 
209 template<class MatrixType>
211 {
212  return A_->getNodeNumEntries();
213 }
214 
215 
216 template<class MatrixType>
218 getNumEntriesInGlobalRow (global_ordinal_type globalRow) const
219 {
220  if (A_.is_null () || A_->getRowMap ().is_null ()) {
222  }
223  else {
224  const local_ordinal_type lclRow =
225  A_->getRowMap ()->getLocalElement (globalRow);
227  // The calling process doesn't own any entries in this row.
228  return static_cast<size_t> (0);
229  } else {
230  const local_ordinal_type origLclRow = reverseperm_[lclRow];
231  return A_->getNumEntriesInLocalRow (origLclRow);
232  }
233  }
234 }
235 
236 
237 template<class MatrixType>
239 getNumEntriesInLocalRow (local_ordinal_type localRow) const
240 {
241  // Make sure that localRow is in bounds before using it to index
242  // into the permutation.
243  if (A_->getRowMap ()->isNodeLocalElement (localRow)) {
244  // localRow is a valid index into reverseperm_.
245  const local_ordinal_type localReorderedRow = reverseperm_[localRow];
246  return A_->getNumEntriesInLocalRow (localReorderedRow);
247  } else {
248  // The calling process doesn't own any entries in this row.
249  return static_cast<size_t> (0);
250  }
251 }
252 
253 
254 template<class MatrixType>
256 {
257  return A_->getGlobalMaxNumRowEntries();
258 }
259 
260 
261 template<class MatrixType>
263 {
264  return A_->getNodeMaxNumRowEntries();
265 }
266 
267 
268 template<class MatrixType>
270 {
271  return true;
272 }
273 
274 
275 template<class MatrixType>
277 {
278  return A_->isLocallyIndexed();
279 }
280 
281 
282 template<class MatrixType>
284 {
285  return A_->isGloballyIndexed();
286 }
287 
288 
289 template<class MatrixType>
291 {
292  return A_->isFillComplete();
293 }
294 
295 
296 template<class MatrixType>
298 getGlobalRowCopy (global_ordinal_type globalRow,
301  size_t& numEntries) const
302 {
303  using Teuchos::Array;
304  using Teuchos::ArrayView;
305  using Teuchos::av_reinterpret_cast;
306  typedef local_ordinal_type LO;
307  typedef global_ordinal_type GO;
308  typedef Teuchos::OrdinalTraits<LO> OTLO;
309 
310  const map_type& rowMap = * (A_->getRowMap ());
311  const local_ordinal_type localRow = rowMap.getLocalElement (globalRow);
313  localRow == OTLO::invalid (), std::invalid_argument, "Ifpack2::Reorder"
314  "Filter::getGlobalRowCopy: The given global row index " << globalRow
315  << " is not owned by the calling process with rank "
316  << rowMap.getComm ()->getRank () << ".");
317 
318  if (sizeof (GO) == sizeof (LO)) {
319  // This means we can convert local to global in place.
320  ArrayView<LO> localInd = av_reinterpret_cast<LO> (globalInd);
321  this->getLocalRowCopy (localRow, localInd, val, numEntries);
322 
323  // Convert local indices back to global indices.
324  for (size_t k = 0; k < numEntries; ++k) {
325  globalInd[k] = rowMap.getGlobalElement (localInd[k]);
326  }
327  }
328  else {
329  // LO and GO have different sizes, so we need a temp array
330  // for converting local to global.
331  numEntries = this->getNumEntriesInLocalRow (localRow);
332  Array<LO> localInd (numEntries);
333  this->getLocalRowCopy (localRow, localInd, val, numEntries);
334 
335  // Convert local indices back to global indices.
336  for (size_t k = 0; k < numEntries; ++k) {
337  globalInd[k] = rowMap.getGlobalElement (localInd[k]);
338  }
339  }
340 }
341 
342 
343 template<class MatrixType>
345 getLocalRowCopy (local_ordinal_type LocalRow,
347  const Teuchos::ArrayView<scalar_type> &Values,
348  size_t &NumEntries) const
349 {
351  ! A_->getRowMap ()->isNodeLocalElement (LocalRow),
352  std::invalid_argument,
353  "Ifpack2::ReorderFilter::getLocalRowCopy: The given local row index "
354  << LocalRow << " is not a valid local row index on the calling process "
355  "with rank " << A_->getRowMap ()->getComm ()->getRank () << ".");
356 
357  // This duplicates code in getNumEntriesInGlobalRow, but avoids an
358  // extra array lookup and some extra tests.
359  const local_ordinal_type origLclRow = reverseperm_[LocalRow];
360  const size_t numEntries = A_->getNumEntriesInLocalRow (origLclRow);
361 
363  static_cast<size_t> (Indices.size ()) < numEntries ||
364  static_cast<size_t> (Values.size ()) < numEntries,
365  std::invalid_argument,
366  "Ifpack2::ReorderFilter::getLocalRowCopy: The given array views are not "
367  "long enough to store all the data in the given row " << LocalRow
368  << ". Indices.size() = " << Indices.size () << ", Values.size() = "
369  << Values.size () << ", but the (original) row has " << numEntries
370  << " entry/ies.");
371 
372  A_->getLocalRowCopy (origLclRow, Indices, Values, NumEntries);
373  // Do a col reindex via perm
374  //
375  // FIXME (mfh 30 Jan 2014) This assumes that the row and column
376  // indices are the same.
377  for (size_t i = 0; i < NumEntries; ++i) {
378  Indices[i] = perm_[Indices[i]];
379  }
380 }
381 
382 
383 template<class MatrixType>
385 getGlobalRowView (global_ordinal_type /* GlobalRow */,
387  Teuchos::ArrayView<const scalar_type> &/* values */) const
388 {
389  throw std::runtime_error("Ifpack2::ReorderFilter: does not support getGlobalRowView.");
390 }
391 
392 
393 template<class MatrixType>
395 getLocalRowView (local_ordinal_type /* LocalRow */,
397  Teuchos::ArrayView<const scalar_type> &/* values */) const
398 {
399  throw std::runtime_error("Ifpack2::ReorderFilter: does not support getLocalRowView.");
400 }
401 
402 
403 template<class MatrixType>
405 getLocalDiagCopy (Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &diag) const
406 {
407  // This is somewhat dubious as to how the maps match.
408  return A_->getLocalDiagCopy(diag);
409 }
410 
411 
412 template<class MatrixType>
413 void ReorderFilter<MatrixType>::leftScale(const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& /* x */)
414 {
415  throw std::runtime_error("Ifpack2::ReorderFilter does not support leftScale.");
416 }
417 
418 
419 template<class MatrixType>
420 void ReorderFilter<MatrixType>::rightScale(const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& /* x */)
421 {
422  throw std::runtime_error("Ifpack2::ReorderFilter does not support rightScale.");
423 }
424 
425 
426 template<class MatrixType>
428 apply (const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
429  Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
430  Teuchos::ETransp mode,
431  scalar_type alpha,
432  scalar_type beta) const
433 {
435 
437  alpha != STS::one () || beta != STS::zero (), std::logic_error,
438  "Ifpack2::ReorderFilter::apply is only implemented for alpha = 1 and "
439  "beta = 0. You set alpha = " << alpha << " and beta = " << beta << ".");
440 
441  // Note: This isn't AztecOO compliant. But neither was Ifpack's version.
442  // Note: The localized maps mean the matvec is trivial (and has no import)
444  X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
445  "Ifpack2::ReorderFilter::apply: X.getNumVectors() != Y.getNumVectors().");
446 
447  const scalar_type zero = STS::zero ();
449  Teuchos::ArrayRCP<Teuchos::ArrayRCP<scalar_type> > y_ptr = Y.get2dViewNonConst();
450 
451  Y.putScalar (zero);
452  const size_t NumVectors = Y.getNumVectors ();
453 
454  for (size_t i = 0; i < A_->getNodeNumRows (); ++i) {
455  size_t Nnz;
456  // Use this class's getrow to make the below code simpler
457  getLocalRowCopy (i, Indices_ (), Values_ (), Nnz);
458  if (mode == Teuchos::NO_TRANS) {
459  for (size_t j = 0; j < Nnz; ++j) {
460  for (size_t k = 0; k < NumVectors; ++k) {
461  y_ptr[k][i] += Values_[j] * x_ptr[k][Indices_[j]];
462  }
463  }
464  }
465  else if (mode == Teuchos::TRANS) {
466  for (size_t j = 0; j < Nnz; ++j) {
467  for (size_t k = 0; k < NumVectors; ++k) {
468  y_ptr[k][Indices_[j]] += Values_[j] * x_ptr[k][i];
469  }
470  }
471  }
472  else { //mode==Teuchos::CONJ_TRANS
473  for (size_t j = 0; j < Nnz; ++j) {
474  for (size_t k = 0; k < NumVectors; ++k) {
475  y_ptr[k][Indices_[j]] += STS::conjugate(Values_[j]) * x_ptr[k][i];
476  }
477  }
478  }
479  }
480 }
481 
482 
483 template<class MatrixType>
485 {
486  return true;
487 }
488 
489 
490 template<class MatrixType>
492 {
493  return false;
494 }
495 
496 
497 template<class MatrixType>
498 typename ReorderFilter<MatrixType>::mag_type ReorderFilter<MatrixType>::getFrobeniusNorm() const
499 {
500  // Reordering doesn't change the Frobenius norm.
501  return A_->getFrobeniusNorm ();
502 }
503 
504 
505 template<class MatrixType>
507 permuteOriginalToReordered (const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &originalX,
508  Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &reorderedY) const
509 {
510  this->template permuteOriginalToReorderedTempl<scalar_type,scalar_type>(originalX, reorderedY);
511 }
512 
513 
514 template<class MatrixType>
515 template<class DomainScalar, class RangeScalar>
516 void ReorderFilter<MatrixType>::permuteOriginalToReorderedTempl(const Tpetra::MultiVector<DomainScalar,local_ordinal_type,global_ordinal_type,node_type> &originalX,
517  Tpetra::MultiVector<RangeScalar,local_ordinal_type,global_ordinal_type,node_type> &reorderedY) const
518 {
519  TEUCHOS_TEST_FOR_EXCEPTION(originalX.getNumVectors() != reorderedY.getNumVectors(), std::runtime_error,
520  "Ifpack2::ReorderFilter::permuteOriginalToReordered ERROR: X.getNumVectors() != Y.getNumVectors().");
521 
522  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const DomainScalar> > x_ptr = originalX.get2dView();
523  Teuchos::ArrayRCP<Teuchos::ArrayRCP<RangeScalar> > y_ptr = reorderedY.get2dViewNonConst();
524 
525  for(size_t k=0; k < originalX.getNumVectors(); k++)
526  for(local_ordinal_type i=0; (size_t)i< originalX.getLocalLength(); i++)
527  y_ptr[k][perm_[i]] = (RangeScalar)x_ptr[k][i];
528 }
529 
530 
531 template<class MatrixType>
532 void ReorderFilter<MatrixType>::permuteReorderedToOriginal(const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &reorderedX,
533  Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &originalY) const
534 {
535  this->template permuteReorderedToOriginalTempl<scalar_type,scalar_type>(reorderedX, originalY);
536 }
537 
538 
539 template<class MatrixType>
540 template<class DomainScalar, class RangeScalar>
542 permuteReorderedToOriginalTempl (const Tpetra::MultiVector<DomainScalar,local_ordinal_type,global_ordinal_type,node_type> &reorderedX,
543  Tpetra::MultiVector<RangeScalar,local_ordinal_type,global_ordinal_type,node_type> &originalY) const
544 {
546  reorderedX.getNumVectors() != originalY.getNumVectors(),
547  std::runtime_error,
548  "Ifpack2::ReorderFilter::permuteReorderedToOriginal: "
549  "X.getNumVectors() != Y.getNumVectors().");
550 
551 #ifdef HAVE_IFPACK2_DEBUG
552  {
554  typedef typename STS::magnitudeType magnitude_type;
556  Teuchos::Array<magnitude_type> norms (reorderedX.getNumVectors ());
557  reorderedX.norm2 (norms ());
558  bool good = true;
559  for (size_t j = 0;
560  j < reorderedX.getNumVectors (); ++j) {
561  if (STM::isnaninf (norms[j])) {
562  good = false;
563  break;
564  }
565  }
567  ! good, std::runtime_error, "Ifpack2::ReorderFilter::"
568  "permuteReorderedToOriginalTempl: The 2-norm of the input reorderedX is "
569  "NaN or Inf.");
570  }
571 #endif // HAVE_IFPACK2_DEBUG
572 
573  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const DomainScalar> > x_ptr = reorderedX.get2dView();
574  Teuchos::ArrayRCP<Teuchos::ArrayRCP<RangeScalar> > y_ptr = originalY.get2dViewNonConst();
575 
576  for (size_t k = 0; k < reorderedX.getNumVectors (); ++k) {
577  for (local_ordinal_type i = 0; (size_t)i < reorderedX.getLocalLength (); ++i) {
578  y_ptr[k][reverseperm_[i]] = (RangeScalar) x_ptr[k][i];
579  }
580  }
581 
582 #ifdef HAVE_IFPACK2_DEBUG
583  {
585  typedef typename STS::magnitudeType magnitude_type;
587  Teuchos::Array<magnitude_type> norms (originalY.getNumVectors ());
588  originalY.norm2 (norms ());
589  bool good = true;
590  for (size_t j = 0;
591  j < originalY.getNumVectors (); ++j) {
592  if (STM::isnaninf (norms[j])) {
593  good = false;
594  break;
595  }
596  }
598  ! good, std::runtime_error, "Ifpack2::ReorderFilter::"
599  "permuteReorderedToOriginalTempl: The 2-norm of the output originalY is "
600  "NaN or Inf.");
601  }
602 #endif // HAVE_IFPACK2_DEBUG
603 }
604 
605 } // namespace Ifpack2
606 
607 #define IFPACK2_REORDERFILTER_INSTANT(S,LO,GO,N) \
608  template class Ifpack2::ReorderFilter< Tpetra::RowMatrix<S, LO, GO, N> >;
609 
610 #endif
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_ReorderFilter_def.hpp:385
Wraps a Tpetra::RowMatrix in a filter that reorders local rows and columns.
Definition: Ifpack2_ReorderFilter_decl.hpp:69
virtual mag_type getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:498
virtual Teuchos::RCP< const map_type > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:111
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_ReorderFilter_def.hpp:491
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_ReorderFilter_def.hpp:298
virtual size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
Definition: Ifpack2_ReorderFilter_def.hpp:255
virtual Teuchos::RCP< const map_type > getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:135
virtual size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
Definition: Ifpack2_ReorderFilter_def.hpp:262
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual global_size_t getGlobalNumRows() const
Returns the number of global rows in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:168
size_type size() const
virtual Teuchos::RCP< const map_type > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:123
ReorderFilter(const Teuchos::RCP< const row_matrix_type > &A, const Teuchos::ArrayRCP< local_ordinal_type > &perm, const Teuchos::ArrayRCP< local_ordinal_type > &reverseperm)
Constructor.
Definition: Ifpack2_ReorderFilter_def.hpp:58
virtual Teuchos::RCP< const map_type > getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:147
virtual size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:210
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
, where Op(A) is either A, , or .
Definition: Ifpack2_ReorderFilter_def.hpp:428
virtual size_t getNodeNumRows() const
Returns the number of rows owned on the calling node.
Definition: Ifpack2_ReorderFilter_def.hpp:182
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_ReorderFilter_def.hpp:189
virtual bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
Definition: Ifpack2_ReorderFilter_def.hpp:283
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The matrix&#39;s communicator.
Definition: Ifpack2_ReorderFilter_def.hpp:92
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_ReorderFilter_def.hpp:405
void resize(size_type new_size, const value_type &x=value_type())
virtual size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const
The current number of entries in this matrix, stored on the calling process, in the row whose local i...
Definition: Ifpack2_ReorderFilter_def.hpp:239
virtual bool hasColMap() const
Indicates whether this matrix has a well-defined column map.
Definition: Ifpack2_ReorderFilter_def.hpp:269
virtual size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const
The current number of entries in this matrix, stored on the calling process, in the row whose global ...
Definition: Ifpack2_ReorderFilter_def.hpp:218
virtual void getLocalRowCopy(local_ordinal_type DropRow, 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_ReorderFilter_def.hpp:345
virtual global_size_t getGlobalNumCols() const
Returns the number of global columns in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:175
virtual bool hasTransposeApply() const
Whether apply() can apply the transpose or conjugate transpose.
Definition: Ifpack2_ReorderFilter_def.hpp:484
virtual global_ordinal_type getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:196
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_ReorderFilter_def.hpp:395
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:203
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_ReorderFilter_def.hpp:290
virtual void permuteReorderedToOriginal(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &reorderedX, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &originalY) const
Permute multivector: reordered-to-original.
Definition: Ifpack2_ReorderFilter_def.hpp:532
virtual Teuchos::RCP< const Tpetra::RowGraph< local_ordinal_type, global_ordinal_type, node_type > > getGraph() const
Returns the RowGraph associated with this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:161
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_ReorderFilter_def.hpp:413
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_ReorderFilter_def.hpp:420
virtual void permuteOriginalToReordered(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &originalX, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &reorderedY) const
Permute multivector: original-to-reordered.
Definition: Ifpack2_ReorderFilter_def.hpp:507
virtual ~ReorderFilter()
Destructor.
Definition: Ifpack2_ReorderFilter_def.hpp:88
virtual bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
Definition: Ifpack2_ReorderFilter_def.hpp:276
bool is_null() const