10 #ifndef THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_SUBCLASS_HELPERS_HPP
11 #define THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_SUBCLASS_HELPERS_HPP
14 #include "Thyra_LinearOpWithSolveBase.hpp"
15 #include "Teuchos_toString.hpp"
28 template<
class Scalar>
29 void assertSolveSupports(
30 const LinearOpWithSolveBase<Scalar> &lows,
32 const Ptr<
const SolveCriteria<Scalar> > solveCriteria = Teuchos::null
42 template<
class Scalar>
43 void assertSupportsSolveMeasureType(
44 const LinearOpWithSolveBase<Scalar> &lows,
46 const SolveMeasureType &solveMeasureType
58 template<
class Scalar>
59 void Thyra::assertSolveSupports(
60 const LinearOpWithSolveBase<Scalar> &lows,
62 const Ptr<
const SolveCriteria<Scalar> > solveCriteria
67 !lows.solveSupports(M_trans, solveCriteria),
69 "Error, the LinearOpWithSolve object \"" << lows.description() <<
"\"\n"
70 "for M_trans = " <<
toString(M_trans) <<
" does not support the solve"
72 << (
nonnull(solveCriteria) ?
toString(*solveCriteria) : std::string(
"null") )
79 template<
class Scalar>
80 void Thyra::assertSupportsSolveMeasureType(
81 const LinearOpWithSolveBase<Scalar> &lows,
83 const SolveMeasureType &solveMeasureType
89 "Error, the LinearOpWithSolve object \"" << lows.description() <<
"\"\n"
90 "for M_trans = " <<
toString(M_trans) <<
" does not support the solve"
92 <<
toString(solveMeasureType.numerator)
94 <<
toString(solveMeasureType.denominator)
99 #endif // THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_SUBCLASS_HELPERS_HPP
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
std::string toString(ModelEvaluatorBase::EInArgsMembers)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool solveSupportsSolveMeasureType(const LinearOpWithSolveBase< Scalar > &A, const EOpTransp transp, const SolveMeasureType &solveMeasureType)
Call solveSupportsSolveMeasureType() as a non-member function.
bool nonnull(const boost::shared_ptr< T > &p)
std::string toString(const T &t)