Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_Details_Amesos2Wrapper_def.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4 //
5 // Copyright 2009 NTESS and the Ifpack2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef IFPACK2_DETAILS_AMESOS2WRAPPER_DEF_HPP
11 #define IFPACK2_DETAILS_AMESOS2WRAPPER_DEF_HPP
12 
13 #ifdef HAVE_IFPACK2_AMESOS2
14 
15 #include "Ifpack2_LocalFilter.hpp"
18 #include "Teuchos_TimeMonitor.hpp"
20 
21 // FIXME (mfh 25 Aug 2015) Work-around for Bug 6392. This doesn't
22 // need to be a weak symbol as long as the Ifpack2 package depends on
23 // Amesos2.
24 namespace Amesos2 {
25 namespace Details {
26  extern void registerLinearSolverFactory ();
27 } // namespace Details
28 } // namespace Amesos2
29 
30 namespace Ifpack2 {
31 namespace Details {
32 
33 template <class MatrixType>
36  A_(A),
37  InitializeTime_ (0.0),
38  ComputeTime_ (0.0),
39  ApplyTime_ (0.0),
40  NumInitialize_ (0),
41  NumCompute_ (0),
42  NumApply_ (0),
43  IsInitialized_ (false),
44  IsComputed_ (false),
45  SolverName_ ("")
46 {}
47 
48 template <class MatrixType>
50 {}
51 
52 template <class MatrixType>
54 {
56  using Teuchos::RCP;
57  using Teuchos::rcp;
58 
59  // FIXME (mfh 12 Sep 2014) Why does this code make a deep copy of
60  // the input ParameterList? Does Amesos2 want a deep copy?
61 
62  // Extract the list called "Amesos2" that contains the Amesos2
63  // solver's options.
64  RCP<ParameterList> theList;
65  if (params.name () == "Amesos2") {
66  theList = rcp (new ParameterList (params));
67  } else if (params.isSublist ("Amesos2")) {
68  // FIXME (mfh 12 Sep 2014) This code actually makes _two_ deep copies.
69  ParameterList subpl = params.sublist ("Amesos2");
70  theList = rcp (new ParameterList (subpl));
71  theList->setName ("Amesos2"); //FIXME hack until Teuchos sublist name bug is fixed
72  if (params.isParameter ("Amesos2 solver name")) {
73  SolverName_ = params.get<std::string>("Amesos2 solver name");
74  }
75  } else {
76  // Amesos2 silently ignores any list not called "Amesos2". We'll
77  // throw an exception.
79  true, std::runtime_error, "The ParameterList passed to Amesos2 must be "
80  "called \"Amesos2\".");
81  }
82 
83  // If solver_ hasn't been allocated yet, cache the parameters and set them
84  // once the concrete solver does exist.
85  if (solver_.is_null ()) {
86  parameterList_ = theList;
87  return;
88  }
89  // FIXME (mfh 25 Aug 2015) Why doesn't this code set parameterList_
90  // when the solver is NOT null?
91 
92  solver_->setParameters(theList);
93 }
94 
95 
96 template <class MatrixType>
100  A_.is_null (), std::runtime_error, "Ifpack2::Amesos2Wrapper::getComm: "
101  "The matrix is null. Please call setMatrix() with a nonnull input "
102  "before calling this method.");
103  return A_->getComm ();
104 }
105 
106 
107 template <class MatrixType>
110  return A_;
111 }
112 
113 
114 template <class MatrixType>
117 {
119  A_.is_null (), std::runtime_error, "Ifpack2::Amesos2Wrapper::getDomainMap: "
120  "The matrix is null. Please call setMatrix() with a nonnull input "
121  "before calling this method.");
122  return A_->getDomainMap ();
123 }
124 
125 
126 template <class MatrixType>
129 {
131  A_.is_null (), std::runtime_error, "Ifpack2::Amesos2Wrapper::getRangeMap: "
132  "The matrix is null. Please call setMatrix() with a nonnull input "
133  "before calling this method.");
134  return A_->getRangeMap ();
135 }
136 
137 
138 template <class MatrixType>
140  return true;
141 }
142 
143 
144 template <class MatrixType>
146  return NumInitialize_;
147 }
148 
149 
150 template <class MatrixType>
152  return NumCompute_;
153 }
154 
155 
156 template <class MatrixType>
158  return NumApply_;
159 }
160 
161 
162 template <class MatrixType>
164  return InitializeTime_;
165 }
166 
167 
168 template<class MatrixType>
170  return ComputeTime_;
171 }
172 
173 
174 template<class MatrixType>
176  return ApplyTime_;
177 }
178 
179 template<class MatrixType>
181 {
182  // It's legal for A to be null; in that case, you may not call
183  // initialize() until calling setMatrix() with a nonnull input.
184  // Regardless, setting the matrix invalidates any previous
185  // factorization.
186  IsInitialized_ = false;
187  IsComputed_ = false;
188 
189  if (A.is_null ()) {
190  A_ = Teuchos::null;
191  }
192  else {
193  A_ = A;
194  }
195 
196  // FIXME (mfh 10 Dec 2013) Currently, initialize() recreates
197  // solver_ unconditionally, so this code won't have any
198  // effect. Once we fix initialize() so that it keeps
199  // solver_, the code below will be effective.
200  //if (! solver_.is_null ()) {
201  // solver_->setA (A_);
202  //}
203  // FIXME JJH 2014-July18 A_ might not be a locally filtered CRS matrix, which
204  // means we have to do that dance all over again before calling solver_->setA ....
205 }
206 
207 template<class MatrixType>
210 {
211  using Teuchos::RCP;
212  using Teuchos::rcp;
213  using Teuchos::rcp_dynamic_cast;
214  using Teuchos::rcp_implicit_cast;
215 
216  // If A_'s communicator only has one process, or if its column and
217  // row Maps are the same, then it is already local, so use it
218  // directly.
219  if (A->getRowMap ()->getComm ()->getSize () == 1 ||
220  A->getRowMap ()->isSameAs (* (A->getColMap ()))) {
221  return A;
222  }
223 
224  // If A_ is already a LocalFilter, then use it directly. This
225  // should be the case if RILUK is being used through
226  // AdditiveSchwarz, for example.
227  RCP<const LocalFilter<row_matrix_type> > A_lf_r =
228  rcp_dynamic_cast<const LocalFilter<row_matrix_type> > (A);
229  if (! A_lf_r.is_null ()) {
230  return rcp_implicit_cast<const row_matrix_type> (A_lf_r);
231  }
232  else {
233  // A_'s communicator has more than one process, its row Map and
234  // its column Map differ, and A_ is not a LocalFilter. Thus, we
235  // have to wrap it in a LocalFilter.
236  return rcp (new LocalFilter<row_matrix_type> (A));
237  }
238 }
239 
240 
241 template<class MatrixType>
243 {
244  using Teuchos::RCP;
245  using Teuchos::rcp;
246  using Teuchos::rcp_const_cast;
247  using Teuchos::rcp_dynamic_cast;
248  using Teuchos::Time;
249  using Teuchos::TimeMonitor;
250  using Teuchos::Array;
251  using Teuchos::ArrayView;
252 
253  const std::string timerName ("Ifpack2::Amesos2Wrapper::initialize");
254  RCP<Time> timer = TimeMonitor::lookupCounter (timerName);
255  if (timer.is_null ()) {
256  timer = TimeMonitor::getNewCounter (timerName);
257  }
258 
259  double startTime = timer->wallTime();
260 
261  { // Start timing here.
262  TimeMonitor timeMon (*timer);
263 
264  // Check that the matrix is nonnull.
266  A_.is_null (), std::runtime_error, "Ifpack2::Amesos2Wrapper::initialize: "
267  "The matrix to precondition is null. Please call setMatrix() with a "
268  "nonnull input before calling this method.");
269 
270  // Clear any previous computations.
271  IsInitialized_ = false;
272  IsComputed_ = false;
273 
274  RCP<const row_matrix_type> A_local = makeLocalFilter (A_);
276  A_local.is_null (), std::logic_error, "Ifpack2::AmesosWrapper::initialize: "
277  "makeLocalFilter returned null; it failed to compute A_local. "
278  "Please report this bug to the Ifpack2 developers.");
279 
280  {
281  // The matrix that Amesos2 will build the preconditioner on must be a Tpetra::Crs matrix.
282  // If A_local isn't, then we build one.
283  A_local_crs_ = rcp_dynamic_cast<const crs_matrix_type> (A_local);
284 
285  if (A_local_crs_.is_null ()) {
286  local_ordinal_type numRows = A_local->getLocalNumRows();
287  Array<size_t> entriesPerRow(numRows);
288  for(local_ordinal_type i = 0; i < numRows; i++)
289  {
290  entriesPerRow[i] = A_local->getNumEntriesInLocalRow(i);
291  }
292  RCP<crs_matrix_type> A_local_crs_nc =
293  rcp (new crs_matrix_type (A_local->getRowMap (),
294  A_local->getColMap (),
295  entriesPerRow()));
296  // copy entries into A_local_crs
297  typename crs_matrix_type::nonconst_local_inds_host_view_type indices("Indices",A_local->getLocalMaxNumRowEntries() );
298  typename crs_matrix_type::nonconst_values_host_view_type values("Values", A_local->getLocalMaxNumRowEntries());
299  for(local_ordinal_type i = 0; i < numRows; i++)
300  {
301  size_t numEntries = 0;
302  A_local->getLocalRowCopy(i, indices, values, numEntries);
303  ArrayView<const local_ordinal_type> indicesInsert(indices.data(), numEntries);
304  ArrayView<const scalar_type> valuesInsert((const scalar_type*)values.data(), numEntries);
305  A_local_crs_nc->insertLocalValues(i, indicesInsert, valuesInsert);
306  }
307  A_local_crs_nc->fillComplete (A_local->getDomainMap (), A_local->getRangeMap ());
308  A_local_crs_ = rcp_const_cast<const crs_matrix_type> (A_local_crs_nc);
309  }
310  }
311 
312  // FIXME (10 Dec 2013, 25 Aug 2015) It shouldn't be necessary to
313  // recreate the solver each time, since
314  // Trilinos::Details::LinearSolver has a setA() method. See the
315  // implementation of setMatrix(). I don't want to break anything
316  // so I will leave the code as it is, possibly inefficient.
317 
318 
319  // FIXME (mfh 25 Aug 2015) This is a work-around for Bug 6392.
321  Amesos2::Details::registerLinearSolverFactory ();
322  }
323 
324  solver_ = Trilinos::Details::getLinearSolver<MV, OP, typename MV::mag_type> ("Amesos2", SolverName_);
326  (solver_.is_null (), std::runtime_error, "Ifpack2::Details::"
327  "Amesos2Wrapper::initialize: Failed to create Amesos2 solver!");
328 
329  solver_->setMatrix (A_local_crs_);
330  // If parameters have been already been cached via setParameters, set them now.
331  if (parameterList_ != Teuchos::null) {
332  setParameters (*parameterList_);
333  parameterList_ = Teuchos::null;
334  }
335  // The symbolic factorization properly belongs to initialize(),
336  // since initialize() is concerned with the matrix's structure
337  // (and compute() with the matrix's values).
338  solver_->symbolic ();
339  } // Stop timing here.
340 
341  IsInitialized_ = true;
342  ++NumInitialize_;
343 
344  InitializeTime_ += (timer->wallTime() - startTime);
345 }
346 
347 template<class MatrixType>
349 {
350  using Teuchos::RCP;
351  using Teuchos::Time;
352  using Teuchos::TimeMonitor;
353 
354  // Don't count initialization in the compute() time.
355  if (! isInitialized ()) {
356  initialize ();
357  }
358 
359  const std::string timerName ("Ifpack2::Details::Amesos2Wrapper::compute");
360  RCP<Time> timer = TimeMonitor::lookupCounter (timerName);
361  if (timer.is_null ()) {
362  timer = TimeMonitor::getNewCounter (timerName);
363  }
364 
365  double startTime = timer->wallTime();
366 
367  { // Start timing here.
368  TimeMonitor timeMon (*timer);
369  solver_->numeric ();
370  } // Stop timing here.
371 
372  IsComputed_ = true;
373  ++NumCompute_;
374 
375  ComputeTime_ += (timer->wallTime() - startTime);
376 }
377 
378 
379 template <class MatrixType>
381 apply (const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
382  Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
383  Teuchos::ETransp mode,
384  scalar_type alpha,
385  scalar_type beta) const
386 {
387  using Teuchos::ArrayView;
388  using Teuchos::RCP;
389  using Teuchos::rcp;
390  using Teuchos::rcpFromRef;
391  using Teuchos::Time;
392  using Teuchos::TimeMonitor;
393 
394  // X = RHS
395  // Y = solution
396 
397  const std::string timerName ("Ifpack2::Amesos2Wrapper::apply");
398  RCP<Time> timer = TimeMonitor::lookupCounter (timerName);
399  if (timer.is_null ()) {
400  timer = TimeMonitor::getNewCounter (timerName);
401  }
402 
403  double startTime = timer->wallTime();
404 
405  { // Start timing here.
406  TimeMonitor timeMon (*timer);
407 
409  ! isComputed (), std::runtime_error,
410  "Ifpack2::Amesos2Wrapper::apply: You must call compute() to compute the "
411  "incomplete factorization, before calling apply().");
412 
414  X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
415  "Ifpack2::Amesos2Wrapper::apply: X and Y must have the same number of columns. "
416  "X has " << X.getNumVectors () << " columns, but Y has "
417  << Y.getNumVectors () << " columns.");
418 
420  mode != Teuchos::NO_TRANS, std::logic_error,
421  "Ifpack2::Amesos2Wrapper::apply: Solving with the transpose (mode == "
422  "Teuchos::TRANS) or conjugate transpose (Teuchos::CONJ_TRANS) is not "
423  "implemented.");
424 
425  // If alpha != 1 or beta != 0, create a temporary multivector
426  // Y_temp to hold the contents of alpha*M^{-1}*X. Otherwise,
427  // alias Y_temp to Y.
428  RCP<MV> Y_temp = (alpha != STS::one () || beta != STS::zero ()) ?
429  rcp (new MV (Y.getMap (), Y.getNumVectors ())) :
430  rcpFromRef (Y);
431 
432  // If X and Y are pointing to the same memory location, create an
433  // auxiliary vector, X_temp, so that we don't clobber the input
434  // when computing the output. Otherwise, alias X_temp to X.
435  RCP<const MV> X_temp;
436  {
437  if (X.aliases(Y)) {
438  X_temp = rcp (new MV (X, Teuchos::Copy));
439  } else {
440  X_temp = rcpFromRef (X);
441  }
442  }
443 
444  // Set up "local" views of X and Y.
445  RCP<const MV> X_local;
446  RCP<MV> Y_local;
447  //JJH 15-Apr-2016 I changed this from ">=" to ">". Otherwise the else block
448  //is never hit.
449  //bmk 6-19-17: previously, the next line only set multipleProcs if A_ was distributed
450  // This doesn't work if A_ is local but X/Y are distributed, as in AdditiveSchwarz.
451  const bool multipleProcs = (A_->getRowMap ()->getComm ()->getSize () > 1) || (X.getMap ()->getComm ()->getSize () > 1);
452  if (multipleProcs) {
453  // Interpret X and Y as "local" multivectors, that is, in the
454  // local filter's domain resp. range Maps. "Interpret" means that
455  // we create views with different Maps; we don't have to copy.
456  X_local = X_temp->offsetView (A_local_crs_->getDomainMap (), 0);
457  Y_local = Y_temp->offsetViewNonConst (A_local_crs_->getRangeMap (), 0);
458  }
459  else { // only one process in A_'s communicator
460  // X and Y are already "local"; no need to set up local views.
461  X_local = X_temp;
462  Y_local = Y_temp;
463  }
464 
465  // Use the precomputed factorization to solve.
466  solver_->solve (*Y_local, *X_local);
467 
468  if (alpha != STS::one () || beta != STS::zero ()) {
469  Y.update (alpha, *Y_temp, beta);
470  }
471  } // Stop timing here.
472 
473  ++NumApply_;
474 
475  ApplyTime_ += (timer->wallTime() - startTime);
476 }
477 
478 
479 template <class MatrixType>
482  std::ostringstream os;
483 
484  // Output is a valid YAML dictionary in flow style. If you don't
485  // like everything on a single line, you should call describe()
486  // instead.
487  os << "\"Ifpack2::Amesos2Wrapper\": {";
488  if (this->getObjectLabel () != "") {
489  os << "Label: \"" << this->getObjectLabel () << "\", ";
490  }
491  os << "Initialized: " << (isInitialized () ? "true" : "false")
492  << ", Computed: " << (isComputed () ? "true" : "false");
493 
494  if (A_local_crs_.is_null ()) {
495  os << ", Matrix: null";
496  }
497  else {
498  os << ", Global matrix dimensions: ["
499  << A_local_crs_->getGlobalNumRows () << ", " << A_local_crs_->getGlobalNumCols () << "]";
500  }
501 
502  // If the actual solver happens to implement Describable, have it
503  // describe itself. Otherwise, don't print anything.
504  if (! solver_.is_null ()) {
505  Teuchos::Describable* d = dynamic_cast<Teuchos::Describable*> (solver_.getRawPtr ());
506  if (d != NULL) {
507  os << ", {";
508  os << d->description ();
509  os << "}";
510  }
511  }
512  os << "}";
513  return os.str ();
514 }
515 
516 
517 template <class MatrixType>
518 void
521  const Teuchos::EVerbosityLevel verbLevel) const
522 {
523  using Teuchos::Comm;
524  using Teuchos::OSTab;
525  using Teuchos::RCP;
527  using std::endl;
528 
529  const Teuchos::EVerbosityLevel vl = (verbLevel == Teuchos::VERB_DEFAULT) ?
530  Teuchos::VERB_LOW : verbLevel;
531 
532  // describe() starts, by convention, with a tab before it prints anything.
533  OSTab tab0 (out);
534  if (vl > Teuchos::VERB_NONE) {
535  out << "\"Ifpack2::Amesos2Wrapper\":" << endl;
536  OSTab tab1 (out);
537  out << "MatrixType: \"" << TypeNameTraits<MatrixType>::name ()
538  << "\"" << endl;
539 
540  if (this->getObjectLabel () != "") {
541  out << "Label: \"" << this->getObjectLabel () << "\"" << endl;
542  }
543 
544  out << "Initialized: " << (isInitialized () ? "true" : "false") << endl;
545  out << "Computed: " << (isComputed () ? "true" : "false") << endl;
546  out << "Number of initialize calls: " << getNumInitialize () << endl;
547  out << "Number of compute calls: " << getNumCompute () << endl;
548  out << "Number of apply calls: " << getNumApply () << endl;
549  out << "Total time in seconds for initialize: " << getInitializeTime () << endl;
550  out << "Total time in seconds for compute: " << getComputeTime () << endl;
551  out << "Total time in seconds for apply: " << getApplyTime () << endl;
552 
553  if (vl > Teuchos::VERB_LOW) {
554  out << "Matrix:" << endl;
555  A_local_crs_->describe (out, vl);
556  }
557  }
558 }
559 
560 } // namespace Details
561 } // namespace Ifpack2
562 
563 // There's no need to instantiate for CrsMatrix too. All Ifpack2
564 // preconditioners can and should do dynamic casts if they need a type
565 // more specific than RowMatrix.
566 
567 #define IFPACK2_DETAILS_AMESOS2WRAPPER_INSTANT(S,LO,GO,N) \
568  template class Ifpack2::Details::Amesos2Wrapper< Tpetra::RowMatrix<S, LO, GO, N> >;
569 
570 #else
571 
572 #define IFPACK2_DETAILS_AMESOS2WRAPPER_INSTANT(S,LO,GO,N)
573 
574 #endif // HAVE_IFPACK2_AMESOS2
575 #endif // IFPACK2_DETAILS_AMESOS2WRAPPER_DEF_HPP
double getInitializeTime() const
The total time in seconds spent in successful calls to initialize().
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:163
const std::string & name() const
double getApplyTime() const
The total time in seconds spent in successful calls to apply().
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:175
basic_OSTab< char > OSTab
void setParameters(const Teuchos::ParameterList &params)
Set parameters.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:53
T & get(const std::string &name, T def_value)
bool rememberRegisteredSomeLinearSolverFactory(const std::string &packageName)
bool hasTransposeApply() const
Whether this object&#39;s apply() method can apply the transpose (or conjugate transpose, if applicable).
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:139
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
int getNumApply() const
The total number of successful calls to apply().
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:157
void initialize()
Compute the preordering and symbolic factorization of the matrix.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:242
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
The input matrix&#39;s communicator.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:98
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to the given output stream.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:520
int getNumInitialize() const
The total number of successful calls to initialize().
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:145
bool isParameter(const std::string &name) const
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_Details_Amesos2Wrapper_decl.hpp:84
Teuchos::RCP< const map_type > getDomainMap() const
Tpetra::Map representing the domain of this operator.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:116
Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > crs_matrix_type
Type of the Tpetra::CrsMatrix specialization that this class uses.
Definition: Ifpack2_Details_Amesos2Wrapper_decl.hpp:116
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Wrapper class for direct solvers in Amesos2.
Definition: Ifpack2_Details_Amesos2Wrapper_decl.hpp:69
Teuchos::RCP< const map_type > getRangeMap() const
Tpetra::Map representing the range of this operator.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:128
bool isSublist(const std::string &name) const
virtual std::string description() const
virtual ~Amesos2Wrapper()
Destructor.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:49
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_Details_Amesos2Wrapper_decl.hpp:87
Amesos2Wrapper(const Teuchos::RCP< const row_matrix_type > &A)
Constructor.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:35
Teuchos::RCP< const row_matrix_type > getMatrix() const
The input matrix; the matrix to be preconditioned.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:109
double getComputeTime() const
The total time in seconds spent in successful calls to compute().
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:169
int getNumCompute() const
The total number of successful calls to compute().
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:151
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, resulting in Y.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:381
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
void compute()
Compute the numeric factorization of the matrix.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:348
Access only local rows and columns of a sparse matrix.
Definition: Ifpack2_LocalFilter_decl.hpp:128
void registerLinearSolverFactory()
std::string description() const
A one-line description of this object.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:480
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Change the matrix to be preconditioned.
Definition: Ifpack2_Details_Amesos2Wrapper_def.hpp:180
bool is_null() const