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 {
53 void solve (MV& X,
const MV& Y) {
54 std::cout << this->
name () <<
"::solve START" << std::endl;
57 Trilinos::Details::getLinearSolver<MV, OP, NormType> (
"B",
"4");
58 if (solverB4.
get () == NULL) {
59 throw std::runtime_error (
"Solver4 from package B has not been registered!");
63 solverB4->solve (X, Y);
64 std::cout << this->
name () <<
"::solve END" << std::endl;
71 template<
class MV,
class OP,
class NormType>
80 if (solverName ==
"1") {
83 else if (solverName ==
"2") {
87 std::ostringstream err;
88 err <<
"A::FactoryA::getLinearSolver: Invalid solver name \"" << solverName <<
"\"";
89 throw std::invalid_argument (err.str ());
96 #endif // PACKAGE_A_HPP
Teuchos::RCP< Trilinos::Details::LinearSolver< MV, OP, NormType > > getLinearSolver(const std::string &solverName)
Get an instance of a solver from a particular package.
Interface for a method for solving linear system(s) AX=B.
T * get() const
Get the raw C++ pointer to the underlying object.
void solve(MV &, const MV &)
Solve the linear system(s) AX=B.
Interface for a "factory" that creates solvers.
Smart reference counting pointer class for automatic garbage collection.
void solve(MV &X, const MV &Y)
Solve the linear system(s) AX=B.