Ifpack2 Templated Preconditioning Package  Version 1.0
Ifpack2_ReorderFilter_def.hpp
1 /*@HEADER
2 // ***********************************************************************
3 //
4 // Ifpack2: Tempated 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 //==========================================================================
57 
58 #ifdef HAVE_IFPACK2_ZOLTAN2
59 template<class MatrixType>
60 ReorderFilter<MatrixType>::ReorderFilter(const Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > & Matrix,
61  const Teuchos::RCP<const Zoltan2::OrderingSolution<GlobalOrdinal,LocalOrdinal> > & Reordering):
62  A_(Matrix)
63 {
64 
65  // use this filter only on serial matrices
66  if (A_->getComm()->getSize() != 1 || A_->getNodeNumRows() != A_->getGlobalNumRows()) {
67  throw std::runtime_error("Ifpack2::ReorderFilter can be used with Comm().getSize() == 1 only. This class is a tool for Ifpack2_AdditiveSchwarz, and it is not meant to be used otherwise.");
68  }
69 
70  // perm_[i] gives the where OLD index i shows up in the NEW ordering
71  // reverseperm_[i] gives the where NEW index i shows up in the OLD ordering
72  perm_=Reordering->getPermutationRCPConst();
73 
74  // Generate the reverse permutation
75  size_t N=A_->getNodeNumRows();
76  reverseperm_.resize(N);
77 
78  for(size_t i=0; i<N; i++) {
79  reverseperm_[perm_[i]] = i;
80  }
81 
82  // Temp arrays for apply
83  Indices_.resize(A_->getNodeMaxNumRowEntries());
84  Values_.resize(A_->getNodeMaxNumRowEntries());
85 }
86 #endif
87 
88 //=========================================================================
89 template<class MatrixType>
91 
92 //==========================================================================
93 template<class MatrixType>
94 const Teuchos::RCP<const Teuchos::Comm<int> > & ReorderFilter<MatrixType>::getComm() const
95 {
96  return A_->getComm();
97 }
98 
99 //==========================================================================
100 template<class MatrixType>
101 Teuchos::RCP <typename MatrixType::node_type> ReorderFilter<MatrixType>::getNode() const
102 {
103  return A_->getNode();
104 }
105 
106 //==========================================================================
107 template<class MatrixType>
108 const Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
109  typename MatrixType::global_ordinal_type,
110  typename MatrixType::node_type> >&
112 {
113  return A_->getRowMap();
114 }
115 
116 //==========================================================================
117 template<class MatrixType>
118 const Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
119  typename MatrixType::global_ordinal_type,
120  typename MatrixType::node_type> >&
122 {
123  return A_->getColMap();
124 }
125 
126 //==========================================================================
127 template<class MatrixType>
128 const Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
129  typename MatrixType::global_ordinal_type,
130  typename MatrixType::node_type> >&
132 {
133  return A_->getDomainMap();
134 }
135 
136 //==========================================================================
137 template<class MatrixType>
138 const Teuchos::RCP<const Tpetra::Map<typename MatrixType::local_ordinal_type,
139  typename MatrixType::global_ordinal_type,
140  typename MatrixType::node_type> >&
142 {
143  return A_->getRangeMap();
144 }
145 
146 //==========================================================================
147 template<class MatrixType>
148 Teuchos::RCP<const Tpetra::RowGraph<typename MatrixType::local_ordinal_type,
149  typename MatrixType::global_ordinal_type,
150  typename MatrixType::node_type> >
152 {
153  throw std::runtime_error("Ifpack2::ReorderFilter: does not support getGraph.");
154 }
155 
156 //==========================================================================
157 template<class MatrixType>
159 {
160  return A_->getGlobalNumRows();
161 }
162 
163 //==========================================================================
164 template<class MatrixType>
166 {
167  return A_->getGlobalNumCols();
168 }
169 
170 //==========================================================================
171 template<class MatrixType>
173 {
174  return A_->getNodeNumRows();
175 }
176 
177 //==========================================================================
178 
179 template<class MatrixType>
181 {
182  return A_->getNodeNumCols();
183 }
184 
185 //==========================================================================
186 template<class MatrixType>
187 typename MatrixType::global_ordinal_type ReorderFilter<MatrixType>::getIndexBase() const
188 {
189  return A_->getIndexBase();
190 }
191 
192 //==========================================================================
193 template<class MatrixType>
195 {
196  return A_->getGlobalNumEntries();
197 }
198 
199 //==========================================================================
200 template<class MatrixType>
202 {
203  return A_->getNodeNumEntries();
204 }
205 
206 //==========================================================================
207 template<class MatrixType>
208 size_t ReorderFilter<MatrixType>::getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
209 {
210  throw std::runtime_error("Ifpack2::ReorderFilter does not implement getNumEntriesInGlobalRow");
211 }
212 
213 //==========================================================================
214 template<class MatrixType>
215 size_t ReorderFilter<MatrixType>::getNumEntriesInLocalRow(LocalOrdinal localRow) const
216 {
217  LocalOrdinal MyReorderedRow = reverseperm_[localRow];
218  return A_->getNumEntriesInLocalRow(MyReorderedRow);
219 }
220 
221 //==========================================================================
222 template<class MatrixType>
224 {
225  return A_->getGlobalNumDiags();
226 }
227 
228 //==========================================================================
229 template<class MatrixType>
231 {
232  return A_->getNodeNumDiags();
233 }
234 
235 //==========================================================================
236 template<class MatrixType>
238 {
239  return A_->getGlobalMaxNumRowEntries();
240 }
241 
242 //==========================================================================
243 template<class MatrixType>
245 {
246  return A_->getNodeMaxNumRowEntries();
247 }
248 
249 //==========================================================================
250 template<class MatrixType>
252 {
253  return true;
254 }
255 
256 //==========================================================================
257 template<class MatrixType>
259 {
260  return A_->isLowerTriangular();
261 }
262 
263 //==========================================================================
264 template<class MatrixType>
266 {
267  return A_->isUpperTriangular();
268 }
269 
270 //==========================================================================
271 template<class MatrixType>
273 {
274  return A_->isLocallyIndexed();
275 }
276 
277 //==========================================================================
278 template<class MatrixType>
280 {
281  return A_->isGloballyIndexed();
282 }
283 
284 //==========================================================================
285 template<class MatrixType>
287 {
288  return A_->isFillComplete();
289 }
290 
291 //==========================================================================
292 template<class MatrixType>
293 void ReorderFilter<MatrixType>::getGlobalRowCopy(GlobalOrdinal GlobalRow,
294  const Teuchos::ArrayView<GlobalOrdinal> &Indices,
295  const Teuchos::ArrayView<Scalar> &Values,
296  size_t &NumEntries) const
297 {
298  throw std::runtime_error("Ifpack2::ReorderFilter does not implement getGlobalRowCopy.");
299 }
300 
301 //==========================================================================
302 template<class MatrixType>
303 void ReorderFilter<MatrixType>::getLocalRowCopy(LocalOrdinal LocalRow,
304  const Teuchos::ArrayView<LocalOrdinal> &Indices,
305  const Teuchos::ArrayView<Scalar> &Values,
306  size_t &NumEntries) const
307 {
308  TEUCHOS_TEST_FOR_EXCEPTION((LocalRow < 0 || (size_t) LocalRow >= A_->getNodeNumRows() || (size_t) Indices.size() < A_->getNumEntriesInLocalRow(LocalRow)), std::runtime_error, "Ifpack2::ReorderFilter::getLocalRowCopy invalid row or array size.");
309 
310 
311  LocalOrdinal MyOriginalRow = reverseperm_[LocalRow];
312  A_->getLocalRowCopy(MyOriginalRow,Indices,Values,NumEntries);
313  // Do a col reindex via perm
314  for (size_t i = 0 ; i < NumEntries ; ++i) {
315  Indices[i] = perm_[Indices[i]];
316  }
317 }
318 
319 //==========================================================================
320 template<class MatrixType>
321 void ReorderFilter<MatrixType>::getGlobalRowView(GlobalOrdinal GlobalRow,
322  Teuchos::ArrayView<const GlobalOrdinal> &indices,
323  Teuchos::ArrayView<const Scalar> &values) const
324 {
325  throw std::runtime_error("Ifpack2::ReorderFilter: does not support getGlobalRowView.");
326 }
327 
328 //==========================================================================
329 template<class MatrixType>
330 void ReorderFilter<MatrixType>::getLocalRowView(LocalOrdinal LocalRow,
331  Teuchos::ArrayView<const LocalOrdinal> &indices,
332  Teuchos::ArrayView<const Scalar> &values) const
333 {
334  throw std::runtime_error("Ifpack2::ReorderFilter: does not support getLocalRowView.");
335 }
336 
337 //==========================================================================
338 template<class MatrixType>
339 void ReorderFilter<MatrixType>::getLocalDiagCopy(Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &diag) const
340 {
341  // This is somewhat dubious as to how the maps match.
342  return A_->getLocalDiagCopy(diag);
343 }
344 
345 //==========================================================================
346 template<class MatrixType>
347 void ReorderFilter<MatrixType>::leftScale(const Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& x)
348 {
349  throw std::runtime_error("Ifpack2::ReorderFilter does not support leftScale.");
350 }
351 
352 //==========================================================================
353 template<class MatrixType>
354 void ReorderFilter<MatrixType>::rightScale(const Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& x)
355 {
356  throw std::runtime_error("Ifpack2::ReorderFilter does not support rightScale.");
357 }
358 
359 //==========================================================================
360 template<class MatrixType>
361 void ReorderFilter<MatrixType>::apply(const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X,
362  Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
363  Teuchos::ETransp mode,
364  Scalar alpha,
365  Scalar beta) const
366 {
367  this->template applyTempl<Scalar,Scalar>(X, Y, mode, alpha, beta);
368 }
369 
370 
371 //==========================================================================
372 template<class MatrixType>
373 template<class DomainScalar, class RangeScalar>
374 void ReorderFilter<MatrixType>::applyTempl(const Tpetra::MultiVector<DomainScalar,LocalOrdinal,GlobalOrdinal,Node> &X,
375  Tpetra::MultiVector<RangeScalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
376  Teuchos::ETransp mode,
377  RangeScalar alpha,
378  RangeScalar beta) const
379 {
380  // Note: This isn't AztecOO compliant. But neither was Ifpack's version.
381  // Note: The localized maps mean the matvec is trivial (and has no import)
382  TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
383  "Ifpack2::ReorderFilter::apply ERROR: X.getNumVectors() != Y.getNumVectors().");
384 
385  RangeScalar zero = Teuchos::ScalarTraits<RangeScalar>::zero();
386  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const DomainScalar> > x_ptr = X.get2dView();
387  Teuchos::ArrayRCP<Teuchos::ArrayRCP<RangeScalar> > y_ptr = Y.get2dViewNonConst();
388 
389  Y.putScalar(zero);
390  size_t NumVectors = Y.getNumVectors();
391 
392  for (size_t i = 0 ; i < A_->getNodeNumRows() ; ++i) {
393  size_t Nnz;
394  // Use this class's getrow to make the below code simpler
395  getLocalRowCopy(i,Indices_(),Values_(),Nnz);
396  if (mode==Teuchos::NO_TRANS){
397  for (size_t j = 0 ; j < Nnz ; ++j)
398  for (size_t k = 0 ; k < NumVectors ; ++k)
399  y_ptr[k][i] += (RangeScalar)Values_[j] * (RangeScalar)x_ptr[k][Indices_[j]];
400  }
401  else if (mode==Teuchos::TRANS){
402  for (size_t j = 0 ; j < Nnz ; ++j)
403  for (size_t k = 0 ; k < NumVectors ; ++k)
404  y_ptr[k][Indices_[j]] += (RangeScalar)Values_[j] * (RangeScalar)x_ptr[k][i];
405  }
406  else { //mode==Teuchos::CONJ_TRANS
407  for (size_t j = 0 ; j < Nnz ; ++j)
408  for (size_t k = 0 ; k < NumVectors ; ++k)
409  y_ptr[k][Indices_[j]] += Teuchos::ScalarTraits<RangeScalar>::conjugate((RangeScalar)Values_[j]) * (RangeScalar)x_ptr[k][i];
410  }
411  }
412 }
413 
414 
415 //==========================================================================
416 template<class MatrixType>
418 {
419  return true;
420 }
421 
422 //==========================================================================
423 template<class MatrixType>
425 {
426  return false;
427 }
428 
429 //==========================================================================
430 template<class MatrixType>
431 typename Teuchos::ScalarTraits<typename MatrixType::scalar_type>::magnitudeType ReorderFilter<MatrixType>::getFrobeniusNorm() const
432 {
433  throw std::runtime_error("Ifpack2::ReorderFilter does not implement getFrobeniusNorm.");
434 }
435 
436 //==========================================================================
438 template<class MatrixType>
439 void ReorderFilter<MatrixType>::permuteOriginalToReordered(const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &originalX,
440  Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &reorderedY) const
441 {
442  this->template permuteOriginalToReorderedTempl<Scalar,Scalar>(originalX, reorderedY);
443 }
444 
445 //==========================================================================
447 template<class MatrixType>
448 template<class DomainScalar, class RangeScalar>
449 void ReorderFilter<MatrixType>::permuteOriginalToReorderedTempl(const Tpetra::MultiVector<DomainScalar,LocalOrdinal,GlobalOrdinal,Node> &originalX,
450  Tpetra::MultiVector<RangeScalar,LocalOrdinal,GlobalOrdinal,Node> &reorderedY) const
451 {
452  TEUCHOS_TEST_FOR_EXCEPTION(originalX.getNumVectors() != reorderedY.getNumVectors(), std::runtime_error,
453  "Ifpack2::ReorderFilter::permuteOriginalToReordered ERROR: X.getNumVectors() != Y.getNumVectors().");
454 
455  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const DomainScalar> > x_ptr = originalX.get2dView();
456  Teuchos::ArrayRCP<Teuchos::ArrayRCP<RangeScalar> > y_ptr = reorderedY.get2dViewNonConst();
457 
458  for(size_t k=0; k < originalX.getNumVectors(); k++)
459  for(LocalOrdinal i=0; (size_t)i< originalX.getLocalLength(); i++)
460  y_ptr[k][perm_[i]] = (RangeScalar)x_ptr[k][i];
461 }
462 
463 //==========================================================================
465 template<class MatrixType>
466 void ReorderFilter<MatrixType>::permuteReorderedToOriginal(const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &reorderedX,
467  Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &originalY) const
468 {
469  this->template permuteReorderedToOriginalTempl<Scalar,Scalar>(reorderedX, originalY);
470 }
471 
472 //==========================================================================
474 template<class MatrixType>
475 template<class DomainScalar, class RangeScalar>
476 void ReorderFilter<MatrixType>::permuteReorderedToOriginalTempl(const Tpetra::MultiVector<DomainScalar,LocalOrdinal,GlobalOrdinal,Node> &reorderedX,
477  Tpetra::MultiVector<RangeScalar,LocalOrdinal,GlobalOrdinal,Node> &originalY) const
478 {
479  TEUCHOS_TEST_FOR_EXCEPTION(reorderedX.getNumVectors() != originalY.getNumVectors(), std::runtime_error,
480  "Ifpack2::ReorderFilter::permuteReorderedToOriginal ERROR: X.getNumVectors() != Y.getNumVectors().");
481 
482  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const DomainScalar> > x_ptr = reorderedX.get2dView();
483  Teuchos::ArrayRCP<Teuchos::ArrayRCP<RangeScalar> > y_ptr = originalY.get2dViewNonConst();
484 
485  for(size_t k=0; k < reorderedX.getNumVectors(); k++)
486  for(LocalOrdinal i=0; (size_t)i< reorderedX.getLocalLength(); i++)
487  y_ptr[k][reverseperm_[i]] = (RangeScalar)x_ptr[k][i];
488 }
489 
490 //==========================================================================
491 template<class MatrixType>
492 TPETRA_DEPRECATED void ReorderFilter<MatrixType>::getGlobalRowView(GlobalOrdinal GlobalRow,
493  Teuchos::ArrayRCP<const GlobalOrdinal> &indices,
494  Teuchos::ArrayRCP<const Scalar> &values) const
495 {
496  throw std::runtime_error("Ifpack2::ReorderFilter does not implement getGlobalRowView.");
497 }
498 
499 //==========================================================================
500 template<class MatrixType>
501 TPETRA_DEPRECATED void ReorderFilter<MatrixType>::getLocalRowView(LocalOrdinal LocalRow,
502  Teuchos::ArrayRCP<const LocalOrdinal> &indices,
503  Teuchos::ArrayRCP<const Scalar> &values) const
504 {
505  throw std::runtime_error("Ifpack2::ReorderFilter does not implement getLocalRowView.");
506 }
507 
508 }// namespace Ifpack2
509 
510 #endif
virtual bool isLowerTriangular() const
Indicates whether this matrix is lower triangular.
Definition: Ifpack2_ReorderFilter_def.hpp:258
virtual bool isUpperTriangular() const
Indicates whether this matrix is upper triangular.
Definition: Ifpack2_ReorderFilter_def.hpp:265
virtual global_size_t getGlobalNumDiags() const
Returns the number of global diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_ReorderFilter_def.hpp:223
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_ReorderFilter_def.hpp:339
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getRangeMap() const
Returns the Map that describes the range distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:141
virtual void permuteReorderedToOriginal(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &reorderedX, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &originalY) const
Permute multivector: reordered-to-original.
Definition: Ifpack2_ReorderFilter_def.hpp:466
virtual bool supportsRowViews() const
Returns true if RowViews are supported.
Definition: Ifpack2_ReorderFilter_def.hpp:424
virtual void getLocalRowCopy(LocalOrdinal DropRow, const Teuchos::ArrayView< LocalOrdinal > &Indices, const Teuchos::ArrayView< Scalar > &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:303
virtual size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
Definition: Ifpack2_ReorderFilter_def.hpp:237
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_ReorderFilter_def.hpp:361
virtual void rightScale(const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Scales the RowMatrix on the right with the Vector x.
Definition: Ifpack2_ReorderFilter_def.hpp:354
virtual size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
Definition: Ifpack2_ReorderFilter_def.hpp:244
virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow, const Teuchos::ArrayView< GlobalOrdinal > &Indices, const Teuchos::ArrayView< Scalar > &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:293
virtual global_size_t getGlobalNumRows() const
Returns the number of global rows in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:158
virtual Teuchos::RCP< Node > getNode() const
Returns the underlying node.
Definition: Ifpack2_ReorderFilter_def.hpp:101
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:431
virtual size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:201
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getRowMap() const
Returns the Map that describes the row distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:111
void permuteReorderedToOriginalTempl(const Tpetra::MultiVector< DomainScalar, LocalOrdinal, GlobalOrdinal, Node > &reorderedX, Tpetra::MultiVector< RangeScalar, LocalOrdinal, GlobalOrdinal, Node > &originalY) const
Permute multivector: reordered-to-original.
Definition: Ifpack2_ReorderFilter_def.hpp:476
virtual size_t getNodeNumRows() const
Returns the number of rows owned on the calling node.
Definition: Ifpack2_ReorderFilter_def.hpp:172
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:180
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:279
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getColMap() const
Returns the Map that describes the column distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:121
virtual size_t getNodeNumDiags() const
Returns the number of local diagonal entries, based on global row/column index comparisons.
Definition: Ifpack2_ReorderFilter_def.hpp:230
void permuteOriginalToReorderedTempl(const Tpetra::MultiVector< DomainScalar, LocalOrdinal, GlobalOrdinal, Node > &originalX, Tpetra::MultiVector< RangeScalar, LocalOrdinal, GlobalOrdinal, Node > &reorderedY) const
Permute multivector: original-to-reordered.
Definition: Ifpack2_ReorderFilter_def.hpp:449
virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
Definition: Ifpack2_ReorderFilter_def.hpp:208
virtual bool hasColMap() const
Indicates whether this matrix has a well-defined column map.
Definition: Ifpack2_ReorderFilter_def.hpp:251
virtual void leftScale(const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Scales the RowMatrix on the left with the Vector x.
Definition: Ifpack2_ReorderFilter_def.hpp:347
virtual global_size_t getGlobalNumCols() const
Returns the number of global columns in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:165
virtual const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const
Returns the communicator.
Definition: Ifpack2_ReorderFilter_def.hpp:94
virtual void getLocalRowView(LocalOrdinal LocalRow, Teuchos::ArrayView< const LocalOrdinal > &indices, Teuchos::ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:330
virtual void getGlobalRowView(GlobalOrdinal GlobalRow, Teuchos::ArrayView< const GlobalOrdinal > &indices, Teuchos::ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:321
virtual bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
Definition: Ifpack2_ReorderFilter_def.hpp:417
virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
Definition: Ifpack2_ReorderFilter_def.hpp:215
virtual GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:187
virtual global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:194
virtual bool isFillComplete() const
Returns true if fillComplete() has been called.
Definition: Ifpack2_ReorderFilter_def.hpp:286
virtual Teuchos::RCP< const Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node > > getGraph() const
Returns the RowGraph associated with this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:151
void applyTempl(const Tpetra::MultiVector< DomainScalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< RangeScalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, RangeScalar alpha=Teuchos::ScalarTraits< Scalar >::one(), RangeScalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
Definition: Ifpack2_ReorderFilter_def.hpp:374
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getDomainMap() const
Returns the Map that describes the domain distribution in this matrix.
Definition: Ifpack2_ReorderFilter_def.hpp:131
virtual ~ReorderFilter()
Constructor.
Definition: Ifpack2_ReorderFilter_def.hpp:90
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:272
virtual void permuteOriginalToReordered(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &originalX, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &reorderedY) const
Permute multivector: original-to-reordered.
Definition: Ifpack2_ReorderFilter_def.hpp:439