Stratimikos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_AmesosLinearOpWithSolveFactory.cpp
Go to the documentation of this file.
1 /*
2 // @HEADER
3 // ***********************************************************************
4 //
5 // Stratimikos: Thyra-based strategies for linear solvers
6 // Copyright (2006) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
39 //
40 // ***********************************************************************
41 // @HEADER
42 */
43 
44 #ifndef SUN_CXX
45 
47 
50 #include "Amesos.h"
51 #include "Teuchos_dyn_cast.hpp"
52 #include "Teuchos_TimeMonitor.hpp"
55 
56 #ifdef HAVE_AMESOS_KLU
57 #include "Amesos_Klu.h"
58 #endif
59 #ifdef HAVE_AMESOS_PASTIX
60 #include "Amesos_Pastix.h"
61 #endif
62 #ifdef HAVE_AMESOS_LAPACK
63 #include "Amesos_Lapack.h"
64 #endif
65 #ifdef HAVE_AMESOS_MUMPS
66 #include "Amesos_Mumps.h"
67 #endif
68 #ifdef HAVE_AMESOS_SCALAPACK
69 #include "Amesos_Scalapack.h"
70 #endif
71 #ifdef HAVE_AMESOS_UMFPACK
72 #include "Amesos_Umfpack.h"
73 #endif
74 #ifdef HAVE_AMESOS_SUPERLUDIST
75 #include "Amesos_Superludist.h"
76 #endif
77 #ifdef HAVE_AMESOS_SUPERLU
78 #include "Amesos_Superlu.h"
79 #endif
80 #ifdef HAVE_AMESOS_DSCPACK
81 #include "Amesos_Dscpack.h"
82 #endif
83 #ifdef HAVE_AMESOS_PARDISO
84 #include "Amesos_Pardiso.h"
85 #endif
86 #ifdef HAVE_AMESOS_TAUCS
87 #include "Amesos_Taucs.h"
88 #endif
89 #ifdef HAVE_AMESOS_PARAKLETE
90 #include "Amesos_Paraklete.h"
91 #endif
92 
93 namespace {
94 
95 const std::string epetraFwdOp_str = "epetraFwdOp";
96 
97 } // namespace
98 
99 namespace Thyra {
100 
101 
102 // Parameter names for Paramter List
103 
104 const std::string AmesosLinearOpWithSolveFactory::SolverType_name = "Solver Type";
105 
106 const std::string AmesosLinearOpWithSolveFactory::RefactorizationPolicy_name = "Refactorization Policy";
107 
108 const std::string AmesosLinearOpWithSolveFactory::ThrowOnPreconditionerInput_name = "Throw on Preconditioner Input";
109 
110 const std::string AmesosLinearOpWithSolveFactory::Amesos_Settings_name = "Amesos Settings";
111 
112 // Constructors/initializers/accessors
113 
115 {
116 #ifdef TEUCHOS_DEBUG
117  if(paramList_.get())
119  *this->getValidParameters(),0 // Only validate this level for now!
120  );
121 #endif
122 }
123 
125  const Amesos::ESolverType solverType
126  ,const Amesos::ERefactorizationPolicy refactorizationPolicy
127  ,const bool throwOnPrecInput
128  )
129  :epetraFwdOpViewExtractor_(Teuchos::rcp(new EpetraOperatorViewExtractorStd()))
130  ,solverType_(solverType)
131  ,refactorizationPolicy_(refactorizationPolicy)
132  ,throwOnPrecInput_(throwOnPrecInput)
133 {}
134 
135 // Overridden from LinearOpWithSolveFactoryBase
136 
138  const LinearOpSourceBase<double> &fwdOpSrc
139  ) const
140 {
141  using Teuchos::outArg;
143  fwdOp = fwdOpSrc.getOp();
144  RCP<const Epetra_Operator> epetraFwdOp;
145  EOpTransp epetraFwdOpTransp;
146  EApplyEpetraOpAs epetraFwdOpApplyAs;
147  EAdjointEpetraOp epetraFwdOpAdjointSupport;
148  double epetraFwdOpScalar;
149  epetraFwdOpViewExtractor_->getEpetraOpView(
150  fwdOp,
151  outArg(epetraFwdOp), outArg(epetraFwdOpTransp),
152  outArg(epetraFwdOpApplyAs), outArg(epetraFwdOpAdjointSupport),
153  outArg(epetraFwdOpScalar)
154  );
155  if( !dynamic_cast<const Epetra_RowMatrix*>(&*epetraFwdOp) )
156  return false;
157  return true;
158 }
159 
162 {
164 }
165 
167  const RCP<const LinearOpSourceBase<double> > &fwdOpSrc
168  ,LinearOpWithSolveBase<double> *Op
169  ,const ESupportSolveUse /* supportSolveUse */
170  ) const
171 {
172  using Teuchos::outArg;
173  THYRA_FUNC_TIME_MONITOR("Stratimikos: AmesosLOWSF");
174 #ifdef TEUCHOS_DEBUG
175  TEUCHOS_TEST_FOR_EXCEPT(Op==NULL);
176 #endif
178  fwdOp = fwdOpSrc->getOp();
179  //
180  // Unwrap and get the forward Epetra_Operator object
181  //
182  RCP<const Epetra_Operator> epetraFwdOp;
183  EOpTransp epetraFwdOpTransp;
184  EApplyEpetraOpAs epetraFwdOpApplyAs;
185  EAdjointEpetraOp epetraFwdOpAdjointSupport;
186  double epetraFwdOpScalar;
187  epetraFwdOpViewExtractor_->getEpetraOpView(
188  fwdOp,
189  outArg(epetraFwdOp), outArg(epetraFwdOpTransp),
190  outArg(epetraFwdOpApplyAs), outArg(epetraFwdOpAdjointSupport),
191  outArg(epetraFwdOpScalar)
192  );
193  // Get the AmesosLinearOpWithSolve object
195  *amesosOp = &Teuchos::dyn_cast<AmesosLinearOpWithSolve>(*Op);
196  //
197  // Determine if we must start over or not
198  //
199  bool startOver = ( amesosOp->get_amesosSolver()==Teuchos::null );
200  if(!startOver) {
201  startOver =
202  (
203  epetraFwdOpTransp != amesosOp->get_amesosSolverTransp() ||
204  epetraFwdOp.get() != amesosOp->get_epetraLP()->GetOperator()
205  // We must start over if the matrix object changes. This is a
206  // weakness of Amesos but there is nothing I can do about this right
207  // now!
208  );
209  }
210  //
211  // Update the amesos solver
212  //
213  if(startOver) {
214  //
215  // This LOWS object has not be initialized yet or is not compatible with the existing
216  //
217  // so this is where we setup everything from the ground up.
218  //
219  // Create the linear problem and set the operator with memory of RCP to Epetra_Operator view!
221  epetraLP = Teuchos::rcp(new Epetra_LinearProblem());
222  epetraLP->SetOperator(const_cast<Epetra_Operator*>(&*epetraFwdOp));
223  Teuchos::set_extra_data< RCP<const Epetra_Operator> >( epetraFwdOp, epetraFwdOp_str,
224  Teuchos::inOutArg(epetraLP) );
225  // Create the concrete solver
227  amesosSolver;
228  {
229  THYRA_FUNC_TIME_MONITOR_DIFF("Stratimikos: AmesosLOWSF:InitConstruct",
230  InitConstruct);
231  switch(solverType_) {
232  case Thyra::Amesos::LAPACK :
233  amesosSolver = Teuchos::rcp(new Amesos_Lapack(*epetraLP));
234  break;
235 #ifdef HAVE_AMESOS_KLU
236  case Thyra::Amesos::KLU :
237  amesosSolver = Teuchos::rcp(new Amesos_Klu(*epetraLP));
238  break;
239 #endif
240 #ifdef HAVE_AMESOS_PASTIX
241  case Thyra::Amesos::PASTIX :
242  amesosSolver = Teuchos::rcp(new Amesos_Pastix(*epetraLP));
243  break;
244 #endif
245 #ifdef HAVE_AMESOS_MUMPS
246  case Thyra::Amesos::MUMPS :
247  amesosSolver = Teuchos::rcp(new Amesos_Mumps(*epetraLP));
248  break;
249 #endif
250 #ifdef HAVE_AMESOS_SCALAPACK
251  case Thyra::Amesos::SCALAPACK :
252  amesosSolver = Teuchos::rcp(new Amesos_Scalapack(*epetraLP));
253  break;
254 #endif
255 #ifdef HAVE_AMESOS_UMFPACK
256  case Thyra::Amesos::UMFPACK :
257  amesosSolver = Teuchos::rcp(new Amesos_Umfpack(*epetraLP));
258  break;
259 #endif
260 #ifdef HAVE_AMESOS_SUPERLUDIST
261  case Thyra::Amesos::SUPERLUDIST :
262  amesosSolver = Teuchos::rcp(new Amesos_Superludist(*epetraLP));
263  break;
264 #endif
265 #ifdef HAVE_AMESOS_SUPERLU
266  case Thyra::Amesos::SUPERLU :
267  amesosSolver = Teuchos::rcp(new Amesos_Superlu(*epetraLP));
268  break;
269 #endif
270 #ifdef HAVE_AMESOS_DSCPACK
271  case Thyra::Amesos::DSCPACK :
272  amesosSolver = Teuchos::rcp(new Amesos_Dscpack(*epetraLP));
273  break;
274 #endif
275 #ifdef HAVE_AMESOS_PARDISO
276  case Thyra::Amesos::PARDISO :
277  amesosSolver = Teuchos::rcp(new Amesos_Pardiso(*epetraLP));
278  break;
279 #endif
280 #ifdef HAVE_AMESOS_TAUCS
281  case Thyra::Amesos::TAUCS :
282  amesosSolver = Teuchos::rcp(new Amesos_Taucs(*epetraLP));
283  break;
284 #endif
285 #ifdef HAVE_AMESOS_PARAKLETE
286  case Thyra::Amesos::PARAKLETE :
287  amesosSolver = Teuchos::rcp(new Amesos_Paraklete(*epetraLP));
288  break;
289 #endif
290  default:
292  true, std::logic_error
293  ,"Error, the solver type ID = " << solverType_ << " is invalid!"
294  );
295  }
296  }
297  // Set the parameters
298  if(paramList_.get()) amesosSolver->SetParameters(paramList_->sublist("Amesos Settings"));
299  // Do the initial factorization
300  {
301  THYRA_FUNC_TIME_MONITOR_DIFF("Stratimikos: AmesosLOWSF:Symbolic", Symbolic);
302  const int err = amesosSolver->SymbolicFactorization();
303  TEUCHOS_TEST_FOR_EXCEPTION( 0!=err, CatastrophicSolveFailure,
304  "Error, SymbolicFactorization() on amesos solver of type \'"<<Teuchos::typeName(*amesosSolver)<<"\'\n"
305  "returned error code "<<err<<"!" );
306  }
307  {
308  THYRA_FUNC_TIME_MONITOR_DIFF("Stratimikos: AmesosLOWSF:Factor", Factor);
309  const int err = amesosSolver->NumericFactorization();
310  TEUCHOS_TEST_FOR_EXCEPTION( 0!=err, CatastrophicSolveFailure,
311  "Error, NumericFactorization() on amesos solver of type \'"<<Teuchos::typeName(*amesosSolver)<<"\'\n"
312  "returned error code "<<err<<"!" );
313  }
314  // Initialize the LOWS object and we are done!
315  amesosOp->initialize(fwdOp,fwdOpSrc,epetraLP,amesosSolver,epetraFwdOpTransp,epetraFwdOpScalar);
316  }
317  else {
318  //
319  // This LOWS object has already be initialized once so we must just reset
320  // the matrix and refactor it.
321  //
322  // Get non-const pointers to the linear problem and the amesos solver.
323  // These const-casts are just fine since the amesosOp in non-const.
325  epetraLP = Teuchos::rcp_const_cast<Epetra_LinearProblem>(amesosOp->get_epetraLP());
327  amesosSolver = amesosOp->get_amesosSolver();
328  // Reset the forward operator with memory of RCP to Epetra_Operator view!
329  epetraLP->SetOperator(const_cast<Epetra_Operator*>(&*epetraFwdOp));
330  Teuchos::get_nonconst_extra_data<RCP<const Epetra_Operator> >(epetraLP,epetraFwdOp_str) = epetraFwdOp;
331  // Reset the parameters
332  if(paramList_.get()) amesosSolver->SetParameters(paramList_->sublist(Amesos_Settings_name));
333  // Repivot if asked
335  THYRA_FUNC_TIME_MONITOR_DIFF("Stratimikos: AmesosLOWSF:Symbolic", Symbolic);
336  const int err = amesosSolver->SymbolicFactorization();
337  TEUCHOS_TEST_FOR_EXCEPTION( 0!=err, CatastrophicSolveFailure,
338  "Error, SymbolicFactorization() on amesos solver of type \'"<<Teuchos::typeName(*amesosSolver)<<"\'\n"
339  "returned error code "<<err<<"!" );
340  }
341  {
342  THYRA_FUNC_TIME_MONITOR_DIFF("Stratimikos: AmesosLOWSF::Factor", Factor);
343  const int err = amesosSolver->NumericFactorization();
344  TEUCHOS_TEST_FOR_EXCEPTION( 0!=err, CatastrophicSolveFailure,
345  "Error, NumericFactorization() on amesos solver of type \'"<<Teuchos::typeName(*amesosSolver)<<"\'\n"
346  "returned error code "<<err<<"!" );
347  }
348  /* ToDo: Put this back in once PrintStatus accepts an std::ostream!
349  OsTab tab(out);
350  amesosSolver->PrintStatus()
351  */
352  // Reinitialize the LOWS object and we are done! (we must do this to get the
353  // possibly new transpose and scaling factors back in)
354  amesosOp->initialize(fwdOp,fwdOpSrc,epetraLP,amesosSolver,epetraFwdOpTransp,epetraFwdOpScalar);
355  }
356  amesosOp->setOStream(this->getOStream());
357  amesosOp->setVerbLevel(this->getVerbLevel());
358 }
359 
360 bool AmesosLinearOpWithSolveFactory::supportsPreconditionerInputType(const EPreconditionerInputType /* precOpType */) const
361 {
362  return false;
363 }
364 
366  const RCP<const LinearOpSourceBase<double> > &fwdOpSrc
367  ,const RCP<const PreconditionerBase<double> > &/* prec */
368  ,LinearOpWithSolveBase<double> *Op
369  ,const ESupportSolveUse supportSolveUse
370  ) const
371 {
373  this->throwOnPrecInput_, std::logic_error
374  ,"Error, the concrete implementation described as \'"<<this->description()<<"\' does not support preconditioners "
375  "and has been configured to throw this exception when the initializePreconditionedOp(...) function is called!"
376  );
377  this->initializeOp(fwdOpSrc,Op,supportSolveUse); // Ignore the preconditioner!
378 }
379 
381  const RCP<const LinearOpSourceBase<double> > &fwdOpSrc
382  ,const RCP<const LinearOpSourceBase<double> > &/* approxFwdOpSrc */
383  ,LinearOpWithSolveBase<double> *Op
384  ,const ESupportSolveUse supportSolveUse
385  ) const
386 {
388  this->throwOnPrecInput_, std::logic_error
389  ,"Error, the concrete implementation described as \'"<<this->description()<<"\' does not support preconditioners "
390  "and has been configured to throw this exception when the initializePreconditionedOp(...) function is called!"
391  );
392  this->initializeOp(fwdOpSrc,Op,supportSolveUse); // Ignore the preconditioner!
393 }
394 
396  LinearOpWithSolveBase<double> *Op
397  ,RCP<const LinearOpSourceBase<double> > *fwdOpSrc
398  ,RCP<const PreconditionerBase<double> > *prec
399  ,RCP<const LinearOpSourceBase<double> > *approxFwdOpSrc
400  ,ESupportSolveUse * /* supportSolveUse */
401  ) const
402 {
403 #ifdef TEUCHOS_DEBUG
404  TEUCHOS_TEST_FOR_EXCEPT(Op==NULL);
405 #endif
407  *amesosOp = &Teuchos::dyn_cast<AmesosLinearOpWithSolve>(*Op);
409  _fwdOpSrc = amesosOp->extract_fwdOpSrc(); // Will be null if uninitialized!
410  if(_fwdOpSrc.get()) {
411  // Erase the Epetra_Operator view of the forward operator!
412  RCP<Epetra_LinearProblem> epetraLP = amesosOp->get_epetraLP();
413  Teuchos::get_nonconst_extra_data< RCP<const Epetra_Operator> >(
414  epetraLP,epetraFwdOp_str
415  )
416  = Teuchos::null;
417  // Note, we did not erase the address of the operator in
418  // epetraLP->GetOperator() since it seems that the amesos solvers do not
419  // recheck the value of GetProblem()->GetOperator() so you had better not
420  // rest this!
421  }
422  if(fwdOpSrc) *fwdOpSrc = _fwdOpSrc; // It is fine if the client does not want this object back!
423  if(prec) *prec = Teuchos::null; // We never keep a preconditioner!
424  if(approxFwdOpSrc) *approxFwdOpSrc = Teuchos::null; // We never keep an approximate fwd operator!
425 }
426 
427 // Overridden from ParameterListAcceptor
428 
430  RCP<Teuchos::ParameterList> const& paramList
431  )
432 {
433  TEUCHOS_TEST_FOR_EXCEPT(paramList.get()==NULL);
434  paramList->validateParameters(*this->getValidParameters(),0); // Only validate this level for now!
435  paramList_ = paramList;
436  solverType_ =
438  paramList_->get(
441  )
443  );
446  paramList_->get(
448  ,Amesos::toString(refactorizationPolicy_)
449  )
451  );
453  Teuchos::readVerboseObjectSublist(&*paramList_,this);
454 }
455 
458 {
459  return paramList_;
460 }
461 
464 {
467  return _paramList;
468 }
469 
472 {
473  return paramList_;
474 }
475 
478 {
480 }
481 
482 // Public functions overridden from Teuchos::Describable
483 
485 {
486  std::ostringstream oss;
487  oss << "Thyra::AmesosLinearOpWithSolveFactory{";
488  oss << "solverType=" << toString(solverType_);
489  oss << "}";
490  return oss.str();
491 }
492 
493 // private
494 
497 {
498  static RCP<Teuchos::ParameterList> validParamList;
499  if(validParamList.get()==NULL) {
500  validParamList = Teuchos::rcp(new Teuchos::ParameterList("Amesos"));
501  validParamList->set(
503 #ifdef HAVE_AMESOS_KLU
504  ,Amesos::toString(Amesos::KLU)
505 #else
507 #endif
508  );
510  validParamList->set(ThrowOnPreconditionerInput_name,bool(true));
511  validParamList->sublist(Amesos_Settings_name).setParameters(::Amesos::GetValidParameters());
512  Teuchos::setupVerboseObjectSublist(&*validParamList);
513  }
514  return validParamList;
515 }
516 
517 } // namespace Thyra
518 
519 #endif // SUN_CXX
ERefactorizationPolicy
The policy used on refactoring a matrix.
const std::string & name() const
Teuchos::RCP< const LinearOpSourceBase< double > > extract_fwdOpSrc()
Extract the LinearOpSourceBase&lt;double&gt; object so that it can be modified.
std::string typeName(const T &t)
const std::string toString(const EAdjointEpetraOp adjointEpetraOp)
Teuchos::StringToIntMap refactorizationPolicyNameToEnumMap
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Returns false .
T & get(ParameterList &l, const std::string &name)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
Returns true if dynamic_cast&lt;const EpetraLinearOpBase*&gt;(fwdOpSrc)!=NULL .
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< Amesos_BaseSolver > get_amesosSolver() const
RCP< ParameterList > sublist(const RCP< ParameterList > &paramList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
T * get() const
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
int get(const std::string &option, const std::string &groupName="") const
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
EAdjointEpetraOp
T_To & dyn_cast(T_From &from)
void uninitializeOp(LinearOpWithSolveBase< double > *Op, Teuchos::RCP< const LinearOpSourceBase< double > > *fwdOpSrc, Teuchos::RCP< const PreconditionerBase< double > > *prec, Teuchos::RCP< const LinearOpSourceBase< double > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
Teuchos::StringToIntMap solverTypeNameToEnumMap
void initialize(const Teuchos::RCP< const LinearOpBase< double > > &fwdOp, const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< Epetra_LinearProblem > &epetraLP, const Teuchos::RCP< Amesos_BaseSolver > &amesosSolver, const EOpTransp amesosSolverTransp, const double amesosSolverScalar)
First initialization.
Concrete LinearOpWithSolveBase subclass that adapts any Amesos_BaseSolver object. ...
Completely new pivoting will be used on refactorizations!
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
static Teuchos::RCP< const Teuchos::ParameterList > generateAndGetValidParameters()
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< double > > &prec, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
Throws exception if this-&gt;throwOnPrecInput()==true and calls this-&gt;initializeOp(fwdOpSrc,Op) otherwise.
AmesosLinearOpWithSolveFactory(const Amesos::ESolverType solverType=Amesos::LAPACK, const Amesos::ERefactorizationPolicy refactorizationPolicy=Amesos::REPIVOT_ON_REFACTORIZATION, const bool throwOnPrecInput=true)
Constructor which sets the defaults.
EApplyEpetraOpAs
Teuchos::RCP< Epetra_LinearProblem > get_epetraLP() const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
const char * toString(const ESolverType solverType)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()