Ifpack2 Templated Preconditioning Package  Version 1.0
Ifpack2_Chebyshev_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_CHEBYSHEV_DEF_HPP
44 #define IFPACK2_CHEBYSHEV_DEF_HPP
45 
46 #include "Ifpack2_Parameters.hpp"
47 #include "Teuchos_TimeMonitor.hpp"
48 #include "Tpetra_CrsMatrix.hpp"
49 #include <iostream>
50 #include <sstream>
51 
52 
53 namespace Ifpack2 {
54 
55 template<class MatrixType>
56 Chebyshev<MatrixType>::
57 Chebyshev (const Teuchos::RCP<const row_matrix_type>& A)
58  : impl_ (A),
59  IsInitialized_ (false),
60  IsComputed_ (false),
61  NumInitialize_ (0),
62  NumCompute_ (0),
63  NumApply_ (0),
64  InitializeTime_ (0.0),
65  ComputeTime_ (0.0),
66  ApplyTime_ (0.0),
67  ComputeFlops_ (0.0),
68  ApplyFlops_ (0.0)
69 {
70  this->setObjectLabel ("Ifpack2::Chebyshev");
71 }
72 
73 
74 template<class MatrixType>
76 }
77 
78 
79 template<class MatrixType>
80 void Chebyshev<MatrixType>::setMatrix (const Teuchos::RCP<const row_matrix_type>& A)
81 {
82  if (A.getRawPtr () != impl_.getMatrix ().getRawPtr ()) {
83  IsInitialized_ = false;
84  IsComputed_ = false;
85  impl_.setMatrix (A);
86  }
87 }
88 
89 
90 template<class MatrixType>
91 void
92 Chebyshev<MatrixType>::setParameters (const Teuchos::ParameterList& List)
93 {
94  // FIXME (mfh 25 Jan 2013) Casting away const is bad here.
95  impl_.setParameters (const_cast<Teuchos::ParameterList&> (List));
96 }
97 
98 
99 template<class MatrixType>
100 Teuchos::RCP<const Teuchos::Comm<int> >
102 {
103  Teuchos::RCP<const row_matrix_type> A = impl_.getMatrix ();
104  TEUCHOS_TEST_FOR_EXCEPTION(
105  A.is_null (), std::runtime_error, "Ifpack2::Chebyshev::getComm: The input "
106  "matrix A is null. Please call setMatrix() with a nonnull input matrix "
107  "before calling this method.");
108  return A->getRowMap ()->getComm ();
109 }
110 
111 
112 template<class MatrixType>
113 Teuchos::RCP<const typename Chebyshev<MatrixType>::row_matrix_type>
115 getMatrix() const {
116  return impl_.getMatrix ();
117 }
118 
119 
120 template<class MatrixType>
121 Teuchos::RCP<const Tpetra::CrsMatrix<typename MatrixType::scalar_type,
122  typename MatrixType::local_ordinal_type,
123  typename MatrixType::global_ordinal_type,
124  typename MatrixType::node_type> >
126 getCrsMatrix() const {
127  typedef Tpetra::CrsMatrix<scalar_type, local_ordinal_type,
128  global_ordinal_type, node_type> crs_matrix_type;
129  return Teuchos::rcp_dynamic_cast<const crs_matrix_type> (impl_.getMatrix ());
130 }
131 
132 
133 template<class MatrixType>
134 Teuchos::RCP<const typename Chebyshev<MatrixType>::map_type>
136 getDomainMap () const
137 {
138  Teuchos::RCP<const row_matrix_type> A = impl_.getMatrix ();
139  TEUCHOS_TEST_FOR_EXCEPTION(
140  A.is_null (), std::runtime_error, "Ifpack2::Chebyshev::getDomainMap: The "
141  "input matrix A is null. Please call setMatrix() with a nonnull input "
142  "matrix before calling this method.");
143  return A->getDomainMap ();
144 }
145 
146 
147 template<class MatrixType>
148 Teuchos::RCP<const typename Chebyshev<MatrixType>::map_type>
150 getRangeMap () const
151 {
152  Teuchos::RCP<const row_matrix_type> A = impl_.getMatrix ();
153  TEUCHOS_TEST_FOR_EXCEPTION(
154  A.is_null (), std::runtime_error, "Ifpack2::Chebyshev::getRangeMap: The "
155  "input matrix A is null. Please call setMatrix() with a nonnull input "
156  "matrix before calling this method.");
157  return A->getRangeMap ();
158 }
159 
160 
161 template<class MatrixType>
163  return impl_.hasTransposeApply ();
164 }
165 
166 
167 template<class MatrixType>
169  return NumInitialize_;
170 }
171 
172 
173 template<class MatrixType>
175  return NumCompute_;
176 }
177 
178 
179 template<class MatrixType>
181  return NumApply_;
182 }
183 
184 
185 template<class MatrixType>
187  return InitializeTime_;
188 }
189 
190 
191 template<class MatrixType>
193  return ComputeTime_;
194 }
195 
196 
197 template<class MatrixType>
199  return ApplyTime_;
200 }
201 
202 
203 template<class MatrixType>
205  return ComputeFlops_;
206 }
207 
208 
209 template<class MatrixType>
211  return ApplyFlops_;
212 }
213 
214 
215 template<class MatrixType>
216 void
218 apply (const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
219  Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
220  Teuchos::ETransp mode,
221  scalar_type alpha,
222  scalar_type beta) const
223 {
224  const std::string timerName ("Ifpack2::Chebyshev::apply");
225  Teuchos::RCP<Teuchos::Time> timer = Teuchos::TimeMonitor::lookupCounter (timerName);
226  if (timer.is_null ()) {
227  timer = Teuchos::TimeMonitor::getNewCounter (timerName);
228  }
229 
230  // Start timing here.
231  {
232  Teuchos::TimeMonitor timeMon (*timer);
233 
234  // compute() calls initialize() if it hasn't already been called.
235  // Thus, we only need to check isComputed().
236  TEUCHOS_TEST_FOR_EXCEPTION(
237  ! isComputed (), std::runtime_error,
238  "Ifpack2::Chebyshev::apply(): You must call the compute() method before "
239  "you may call apply().");
240  TEUCHOS_TEST_FOR_EXCEPTION(
241  X.getNumVectors () != Y.getNumVectors (), std::runtime_error,
242  "Ifpack2::Chebyshev::apply(): X and Y must have the same number of "
243  "columns. X.getNumVectors() = " << X.getNumVectors() << " != "
244  << "Y.getNumVectors() = " << Y.getNumVectors() << ".");
245  applyImpl (X, Y, mode, alpha, beta);
246  }
247  ++NumApply_;
248 
249  // timer->totalElapsedTime() returns the total time over all timer
250  // calls. Thus, we use = instead of +=.
251  ApplyTime_ = timer->totalElapsedTime ();
252 }
253 
254 
255 template<class MatrixType>
256 void
258 applyMat (const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
259  Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
260  Teuchos::ETransp mode) const
261 {
262  TEUCHOS_TEST_FOR_EXCEPTION(
263  X.getNumVectors () != Y.getNumVectors (), std::invalid_argument,
264  "Ifpack2::Chebyshev::applyMat: X.getNumVectors() != Y.getNumVectors().");
265 
266  Teuchos::RCP<const row_matrix_type> A = impl_.getMatrix ();
267  TEUCHOS_TEST_FOR_EXCEPTION(
268  A.is_null (), std::runtime_error, "Ifpack2::Chebyshev::applyMat: The input "
269  "matrix A is null. Please call setMatrix() with a nonnull input matrix "
270  "before calling this method.");
271 
272  A->apply (X, Y, mode);
273 }
274 
275 
276 template<class MatrixType>
278  // We create the timer, but this method doesn't do anything, so
279  // there is no need to start the timer. The resulting total time
280  // will always be zero.
281  const std::string timerName ("Ifpack2::Chebyshev::initialize");
282  Teuchos::RCP<Teuchos::Time> timer = Teuchos::TimeMonitor::lookupCounter (timerName);
283  if (timer.is_null ()) {
284  timer = Teuchos::TimeMonitor::getNewCounter (timerName);
285  }
286  IsInitialized_ = true;
287  ++NumInitialize_;
288 }
289 
290 
291 template<class MatrixType>
293 {
294  const std::string timerName ("Ifpack2::Chebyshev::compute");
295  Teuchos::RCP<Teuchos::Time> timer = Teuchos::TimeMonitor::lookupCounter (timerName);
296  if (timer.is_null ()) {
297  timer = Teuchos::TimeMonitor::getNewCounter (timerName);
298  }
299 
300  // Start timing here.
301  {
302  Teuchos::TimeMonitor timeMon (*timer);
303  if (! isInitialized ()) {
304  initialize ();
305  }
306  IsComputed_ = false;
307  impl_.compute ();
308  }
309  IsComputed_ = true;
310  ++NumCompute_;
311 
312  // timer->totalElapsedTime() returns the total time over all timer
313  // calls. Thus, we use = instead of +=.
314  ComputeTime_ = timer->totalElapsedTime ();
315 }
316 
317 
318 template <class MatrixType>
320  std::ostringstream out;
321 
322  // Output is a valid YAML dictionary in flow style. If you don't
323  // like everything on a single line, you should call describe()
324  // instead.
325  out << "\"Ifpack2::Chebyshev\": {";
326  out << "Initialized: " << (isInitialized () ? "true" : "false") << ", "
327  << "Computed: " << (isComputed () ? "true" : "false") << ", ";
328 
329  out << impl_.description() << ", ";
330 
331  if (impl_.getMatrix ().is_null ()) {
332  out << "Matrix: null";
333  }
334  else {
335  out << "Global matrix dimensions: ["
336  << impl_.getMatrix ()->getGlobalNumRows () << ", "
337  << impl_.getMatrix ()->getGlobalNumCols () << "]"
338  << ", Global nnz: " << impl_.getMatrix ()->getGlobalNumEntries();
339  }
340 
341  out << "}";
342  return out.str ();
343 }
344 
345 
346 template <class MatrixType>
348 describe (Teuchos::FancyOStream &out,
349  const Teuchos::EVerbosityLevel verbLevel) const
350 {
351  const Teuchos::EVerbosityLevel vl =
352  (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
353  const int myRank = this->getComm ()->getRank ();
354 
355  if (vl != Teuchos::VERB_NONE && myRank == 0) {
356  // By convention, describe() starts with a tab.
357  Teuchos::OSTab tab0 (out);
358  out << description ();
359  }
360 
361 #if 0
362  using Teuchos::Comm;
363  using Teuchos::RCP;
364  using Teuchos::VERB_DEFAULT;
365  using Teuchos::VERB_NONE;
366  using Teuchos::VERB_LOW;
367  using Teuchos::VERB_MEDIUM;
368  using Teuchos::VERB_HIGH;
369  using Teuchos::VERB_EXTREME;
370  using std::endl;
371  using std::setw;
372 
373  Teuchos::EVerbosityLevel vl = verbLevel;
374  if (vl == VERB_DEFAULT) {
375  vl = VERB_LOW;
376  }
377  RCP<const Comm<int> > comm = A_->getRowMap ()->getComm ();
378 
379  const int myImageID = comm->getRank();
380  Teuchos::OSTab tab(out);
381 
382  scalar_type MinVal, MaxVal;
383  if (IsComputed_) {
384  Teuchos::ArrayRCP<const scalar_type> DiagView = InvDiagonal_->get1dView();
385  scalar_type myMinVal = DiagView[0];
386  scalar_type myMaxVal = DiagView[0];
387  for(typename Teuchos::ArrayRCP<scalar_type>::size_type i=1; i<DiagView.size(); ++i) {
388  if (STS::magnitude(myMinVal) > STS::magnitude(DiagView[i])) myMinVal = DiagView[i];
389  if (STS::magnitude(myMaxVal) < STS::magnitude(DiagView[i])) myMaxVal = DiagView[i];
390  }
391  Teuchos::reduceAll(*comm, Teuchos::REDUCE_MIN, 1, &myMinVal, &MinVal);
392  Teuchos::reduceAll(*comm, Teuchos::REDUCE_MAX, 1, &myMaxVal, &MaxVal);
393  }
394 
395  // none: print nothing
396  // low: print O(1) info from node 0
397  // medium:
398  // high:
399  // extreme:
400  if (vl != VERB_NONE && myImageID == 0) {
401  out << this->description() << endl;
402  out << endl;
403  out << "===============================================================================" << std::endl;
404  out << "Degree of polynomial = " << PolyDegree_ << std::endl;
405  if (ZeroStartingSolution_) { out << "Using zero starting solution" << endl; }
406  else { out << "Using input starting solution" << endl; }
407  if (IsComputed_) {
408  out << "Minimum value on stored inverse diagonal = " << MinVal << std::endl;
409  out << "Maximum value on stored inverse diagonal = " << MaxVal << std::endl;
410  }
411  out << std::endl;
412  out << "Phase # calls Total Time (s) Total MFlops MFlops/s " << endl;
413  out << "------------ ------- --------------- --------------- ---------------" << endl;
414  out << setw(12) << "initialize()" << setw(5) << getNumInitialize() << " " << setw(15) << getInitializeTime() << endl;
415  out << setw(12) << "compute()" << setw(5) << getNumCompute() << " " << setw(15) << getComputeTime() << " "
416  << setw(15) << getComputeFlops() << " "
417  << setw(15) << (getComputeTime() != 0.0 ? getComputeFlops() / getComputeTime() * 1.0e-6 : 0.0) << endl;
418  out << setw(12) << "apply()" << setw(5) << getNumApply() << " " << setw(15) << getApplyTime() << " "
419  << setw(15) << getApplyFlops() << " "
420  << setw(15) << (getApplyTime() != 0.0 ? getApplyFlops() / getApplyTime() * 1.0e-6 : 0.0) << endl;
421  out << "===============================================================================" << std::endl;
422  out << endl;
423  }
424 #endif // 0
425 }
426 
427 template<class MatrixType>
428 void
430 applyImpl (const MV& X,
431  MV& Y,
432  Teuchos::ETransp mode,
433  scalar_type alpha,
434  scalar_type beta) const
435 {
436  using Teuchos::ArrayRCP;
437  using Teuchos::as;
438  using Teuchos::RCP;
439  using Teuchos::rcp;
440  using Teuchos::rcp_const_cast;
441  using Teuchos::rcpFromRef;
442 
443  const scalar_type zero = STS::zero();
444  const scalar_type one = STS::one();
445 
446  // Y = beta*Y + alpha*M*X.
447 
448  // If alpha == 0, then we don't need to do Chebyshev at all.
449  if (alpha == zero) {
450  if (beta == zero) { // Obey Sparse BLAS rules; avoid 0*NaN.
451  Y.putScalar (zero);
452  }
453  else {
454  Y.scale (beta);
455  }
456  return;
457  }
458 
459  // If beta != 0, then we need to keep a (deep) copy of the initial
460  // value of Y, so that we can add beta*it to the Chebyshev result at
461  // the end. Usually this method is called with beta == 0, so we
462  // don't have to worry about caching Y_org.
463  RCP<MV> Y_orig;
464  if (beta != zero) {
465  Y_orig = rcp (new MV (Y, Teuchos::Copy));
466  }
467 
468  // If X and Y point to the same memory location, we need to use a
469  // (deep) copy of X (X_copy) as the input MV. Otherwise, just let
470  // X_copy point to X.
471  //
472  // This is hopefully an uncommon use case, so we don't bother to
473  // optimize for it by caching X_copy.
474  RCP<const MV> X_copy;
475  bool copiedInput = false;
476  {
477  auto X_lcl_host = X.template getLocalView<Kokkos::HostSpace> ();
478  auto Y_lcl_host = Y.template getLocalView<Kokkos::HostSpace> ();
479  if (X_lcl_host.ptr_on_device () == Y_lcl_host.ptr_on_device ()) {
480  X_copy = rcp (new MV (X, Teuchos::Copy));
481  copiedInput = true;
482  } else {
483  X_copy = rcpFromRef (X);
484  }
485  }
486 
487  // If alpha != 1, fold alpha into (a deep copy of) X.
488  //
489  // This is an uncommon use case, so we don't bother to optimize for
490  // it by caching X_copy. However, we do check whether we've already
491  // copied X above, to avoid a second copy.
492  if (alpha != one) {
493  RCP<MV> X_copy_nonConst = rcp_const_cast<MV> (X_copy);
494  if (! copiedInput) {
495  X_copy_nonConst = rcp (new MV (X, Teuchos::Copy));
496  copiedInput = true;
497  }
498  X_copy_nonConst->scale (alpha);
499  X_copy = rcp_const_cast<const MV> (X_copy_nonConst);
500  }
501 
502  impl_.apply (*X_copy, Y);
503 
504  if (beta != zero) {
505  Y.update (beta, *Y_orig, one); // Y = beta * Y_orig + 1 * Y
506  }
507 }
508 
509 
510 template<class MatrixType>
511 typename MatrixType::scalar_type Chebyshev<MatrixType>::getLambdaMaxForApply () const {
512  return impl_.getLambdaMaxForApply ();
513 }
514 
515 
516 
517 }//namespace Ifpack2
518 
519 #define IFPACK2_CHEBYSHEV_INSTANT(S,LO,GO,N) \
520  template class Ifpack2::Chebyshev< Tpetra::RowMatrix<S, LO, GO, N> >;
521 
522 #endif // IFPACK2_CHEBYSHEV_DEF_HPP
void setParameters(Teuchos::ParameterList &plist)
Set (or reset) parameters.
Definition: Ifpack2_Details_Chebyshev_def.hpp:316
double getApplyFlops() const
The total number of floating-point operations taken by all calls to apply().
Definition: Ifpack2_Chebyshev_def.hpp:210
MT apply(const MV &B, MV &X)
Solve Ax=b for x with Chebyshev iteration with left diagonal scaling.
Definition: Ifpack2_Details_Chebyshev_def.hpp:825
Teuchos::RCP< const Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > getCrsMatrix() const
Attempt to return the matrix A as a Tpetra::CrsMatrix.
Definition: Ifpack2_Chebyshev_def.hpp:126
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:223
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:217
double getApplyTime() const
The total time spent in all calls to apply().
Definition: Ifpack2_Chebyshev_def.hpp:198
void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Set the matrix.
Definition: Ifpack2_Details_Chebyshev_def.hpp:652
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_Chebyshev_def.hpp:80
void setParameters(const Teuchos::ParameterList &params)
Set (or reset) parameters.
Definition: Ifpack2_Chebyshev_def.hpp:92
Teuchos::RCP< const row_matrix_type > getMatrix() const
Get the matrix given to the constructor.
Definition: Ifpack2_Details_Chebyshev_def.hpp:1298
double getComputeTime() const
The total time spent in all calls to compute().
Definition: Ifpack2_Chebyshev_def.hpp:192
int getNumApply() const
The total number of successful calls to apply().
Definition: Ifpack2_Chebyshev_def.hpp:180
MatrixType::node_type node_type
The Node type used by the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:226
bool isInitialized() const
Definition: Ifpack2_Chebyshev_decl.hpp:432
void compute()
(Re)compute the left scaling, and (if applicable) estimate max and min eigenvalues of D_inv * A...
Definition: Ifpack2_Chebyshev_def.hpp:292
bool hasTransposeApply() const
Whether it&#39;s possible to apply the transpose of this operator.
Definition: Ifpack2_Chebyshev_def.hpp:162
double getComputeFlops() const
The total number of floating-point operations taken by all calls to compute().
Definition: Ifpack2_Chebyshev_def.hpp:204
Diagonally scaled Chebyshev iteration for Tpetra sparse matrices.
Definition: Ifpack2_Chebyshev_decl.hpp:199
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
Apply the preconditioner to X, returning the result in Y.
Definition: Ifpack2_Chebyshev_def.hpp:218
bool isComputed() const
Definition: Ifpack2_Chebyshev_decl.hpp:479
std::string description() const
A simple one-line description of this object.
Definition: Ifpack2_Chebyshev_def.hpp:319
void initialize()
Initialize the preconditioner.
Definition: Ifpack2_Chebyshev_def.hpp:277
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The communicator over which the matrix is distributed.
Definition: Ifpack2_Chebyshev_def.hpp:101
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_Chebyshev_decl.hpp:220
int getNumInitialize() const
The total number of successful calls to initialize().
Definition: Ifpack2_Chebyshev_def.hpp:168
double getInitializeTime() const
The total time spent in all calls to initialize().
Definition: Ifpack2_Chebyshev_def.hpp:186
MatrixType::scalar_type getLambdaMaxForApply() const
The estimate of the maximum eigenvalue used in the apply().
Definition: Ifpack2_Chebyshev_def.hpp:511
std::string description() const
A single-line description of the Chebyshev solver.
Definition: Ifpack2_Details_Chebyshev_def.hpp:1331
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to a Teuchos::FancyOStream.
Definition: Ifpack2_Chebyshev_def.hpp:348
Teuchos::RCP< const row_matrix_type > getMatrix() const
The matrix for which this is a preconditioner.
Definition: Ifpack2_Chebyshev_def.hpp:115
Teuchos::RCP< const map_type > getDomainMap() const
The Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_Chebyshev_def.hpp:136
virtual ~Chebyshev()
Destructor.
Definition: Ifpack2_Chebyshev_def.hpp:75
bool hasTransposeApply() const
Whether it&#39;s possible to apply the transpose of this operator.
Definition: Ifpack2_Details_Chebyshev_def.hpp:1305
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
Teuchos::RCP< const map_type > getRangeMap() const
The Tpetra::Map representing the range of this operator.
Definition: Ifpack2_Chebyshev_def.hpp:150
int getNumCompute() const
The total number of successful calls to compute().
Definition: Ifpack2_Chebyshev_def.hpp:174
void compute()
(Re)compute the left scaling D_inv, and estimate min and max eigenvalues of D_inv * A...
Definition: Ifpack2_Details_Chebyshev_def.hpp:665
void applyMat(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) const
Compute Y = Op(A)*X, where Op(A) is either A, , or .
Definition: Ifpack2_Chebyshev_def.hpp:258