10 #ifndef BELOS_DETAILS_LINEARSOLVER_HPP
11 #define BELOS_DETAILS_LINEARSOLVER_HPP
43 template<
class MV,
class OP,
class ScalarType,
class NormType>
77 }
else if (A !=
problem_->getOperator ()) {
95 std::runtime_error,
"Belos::Details::LinearSolver::solve: "
96 "The matrix A in the linear system to solve has not yet been set. "
97 "Please call setMatrix() with a nonnull input before calling solve().");
121 solver_->setParameters (params);
130 std::runtime_error,
"Belos::Details::LinearSolver::symbolic: "
131 "The matrix A in the linear system to solve has not yet been set. "
132 "Please call setMatrix() with a nonnull input before calling this method.");
144 std::runtime_error,
"Belos::Details::LinearSolver::numeric: "
145 "The matrix A in the linear system to solve has not yet been set. "
146 "Please call setMatrix() with a nonnull input before calling this method.");
void solve(MV &X, const MV &B)
Solve the linear system AX=B for X.
std::string solverName_
The name of the Belos solver to create.
Teuchos::RCP< Teuchos::ParameterList > params_
The Belos solver's list of parameters.
Belos' implementation of Trilinos::Details::LinearSolver.
virtual ~LinearSolver()
Destructor (virtual for memory safety).
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void setMatrix(const Teuchos::RCP< const OP > &A)
Set the solver's matrix.
void symbolic()
Precompute for matrix structure changes.
void numeric()
Precompute for matrix values' changes.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
bool is_null(const RCP< T > &p)
Belos::LinearProblem< ScalarType, MV, OP > problem_type
Belos::LinearProblem specialization used by this class.
Teuchos::RCP< const OP > getMatrix() const
Get the solver's matrix.
A linear system to solve, and its associated information.
LinearSolver(const std::string &solverName)
Constructor.
The Belos::SolverManager is a templated virtual base class that defines the basic interface that any ...
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set the solver's parameters.
Teuchos::RCP< solver_type > solver_
The Belos solver (SolverManager instance).
Teuchos::RCP< problem_type > problem_
The LinearProblem instance to give to the Belos solver.
typename::Belos::Impl::SolverFactorySelector< SC, MV, OP >::type SolverFactory
Belos::SolverManager< ScalarType, MV, OP > solver_type
Belos' own solver type.