15 template<
class MV,
class OP,
class NormType>
18 std::string
name ()
const {
26 std::cout << this->
name () <<
"::solve START" << std::endl;
27 std::cout << this->
name () <<
"::solve END" << std::endl;
34 template<
class MV,
class OP,
class NormType>
37 std::string
name ()
const {
45 std::cout << this->
name () <<
"::solve START" << std::endl;
48 Trilinos::Details::getLinearSolver<MV, OP, NormType> (
"A",
"1");
49 if (solverA1.
get () == NULL) {
50 std::runtime_error (
"Solver1 from package A has not been registered!");
52 solverA1->solve (X, B);
54 std::cout << this->
name () <<
"::solve END" << std::endl;
61 template<
class MV,
class OP,
class NormType>
69 if (solverName ==
"3") {
72 else if (solverName ==
"4") {
76 std::ostringstream err;
77 err <<
"B::FactoryB::getLinearSolver: Invalid solver name \""
78 << solverName <<
"\"";
79 throw std::invalid_argument (err.str ());
86 #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.