24 template<
class MV,
class OP,
class NormType>
27 std::string
name ()
const {
35 std::cout << this->
name () <<
"::solve START" << std::endl;
36 std::cout << this->
name () <<
"::solve END" << std::endl;
43 template<
class MV,
class OP,
class NormType>
46 std::string
name ()
const {
54 std::cout << this->
name () <<
"::solve START" << std::endl;
57 Trilinos::Details::getLinearSolver<MV, OP, NormType> (
"A",
"1");
58 if (solverA1.
get () == NULL) {
59 std::runtime_error (
"Solver1 from package A has not been registered!");
61 solverA1->solve (X, B);
63 std::cout << this->
name () <<
"::solve END" << std::endl;
70 template<
class MV,
class OP,
class NormType>
78 if (solverName ==
"3") {
81 else if (solverName ==
"4") {
85 std::ostringstream err;
86 err <<
"B::FactoryB::getLinearSolver: Invalid solver name \""
87 << solverName <<
"\"";
88 throw std::invalid_argument (err.str ());
95 #endif // PACKAGE_B_HPP
void solve(MV &, const MV &)
Solve the linear system(s) AX=B.
Interface for a method for solving linear system(s) AX=B.
T * get() const
Get the raw C++ pointer to the underlying object.
Interface for a "factory" that creates solvers.
void solve(MV &X, const MV &B)
Solve the linear system(s) AX=B.
Teuchos::RCP< Trilinos::Details::LinearSolver< MV, OP, NormType > > getLinearSolver(const std::string &solverName)
Get an instance of a solver from a particular package.
Smart reference counting pointer class for automatic garbage collection.