42 #ifndef THYRA_DIAGONAL_LINEAR_OP_WITH_SOLVE_HPP 43 #define THYRA_DIAGONAL_LINEAR_OP_WITH_SOLVE_HPP 45 #include "Thyra_DefaultDiagonalLinearOpWithSolve_decl.hpp" 46 #include "Thyra_DefaultDiagonalLinearOp.hpp" 47 #include "Thyra_MultiVectorStdOps.hpp" 48 #include "Thyra_VectorBase.hpp" 49 #include "Thyra_TestingTools.hpp" 50 #include "Teuchos_Assert.hpp" 59 template<
class Scalar>
64 template<
class Scalar>
69 this->initialize(diag);
79 template<
class Scalar>
84 typedef Teuchos::ScalarTraits<Scalar> ST;
85 return (ST::isComplex ? M_trans==
NOTRANS || M_trans==
TRANS :
true);
89 template<
class Scalar>
94 return this->solveSupportsImpl(M_trans);
98 template<
class Scalar>
109 TEUCHOS_ASSERT(this->solveSupportsImpl(transp));
112 typedef Teuchos::ScalarTraits<Scalar> ST;
114 assign(X, ST::zero());
119 for (
Ordinal col_j = 0; col_j < numCols; ++col_j) {
121 const RCP<const VectorBase<Scalar> > b = B.
col(col_j);
122 const RCP<VectorBase<Scalar> > x = X->col(col_j);
124 ele_wise_divide( ST::one(), *b, *this->getDiag(), x.ptr() );
130 (nonnull(solveCriteria) && !solveCriteria->solveMeasureType.useDefault()
141 #endif // THYRA_DIAGONAL_LINEAR_OP_WITH_SOLVE_HPP bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
bool solveSupportsImpl(EOpTransp M_trans) const
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
Use the non-transposed operator.
The final solution status is unknown but he solve did not totally fail.
Use the transposed operator.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
Interface for a collection of column vectors called a multi-vector.
RCP< const VectorBase< Scalar > > col(Ordinal j) const
Calls colImpl().
DefaultDiagonalLinearOpWithSolve()
Constructs to uninitialized.
static ScalarMag unknownTolerance()
Abstract interface for finite-dimensional dense vectors.
Simple struct for the return status from a solve.
ESolveStatus solveStatus
The return status of the solve.
virtual RCP< const VectorSpaceBase< Scalar > > domain() const =0
Return a smart pointer for the domain space for this operator.
ScalarMag achievedTol
The maximum final tolerance actually achieved by the (block) linear solve. A value of unknownToleranc...
The requested solution criteria has likely been achieved.
Simple struct that defines the requested solution criteria for a solve.