9 #ifndef Thyra_ScaledIdentityLinearOpWithSolve_hpp
10 #define Thyra_ScaledIdentityLinearOpWithSolve_hpp
12 #include "Thyra_LinearOpWithSolveBase.hpp"
13 #include "Thyra_MultiVectorStdOps.hpp"
21 template<
class Scalar>
23 virtual public LinearOpWithSolveBase<Scalar>
46 RCP< const VectorSpaceBase<Scalar> >
space()
const {
return space_; }
55 RCP< const VectorSpaceBase<Scalar> >
range()
const {
return space_; }
57 RCP< const VectorSpaceBase<Scalar> >
domain()
const {
return space_; }
59 RCP<const LinearOpBase<Scalar> >
clone()
const
61 RCP<ScaledIdentityLinearOpWithSolve<Scalar> > op =
75 const MultiVectorBase<Scalar>& X,
76 const Ptr<MultiVectorBase<Scalar> >& Y,
78 const Scalar beta)
const
80 typedef Teuchos::ScalarTraits<Scalar> ST;
81 Thyra::scale(beta, Y);
82 if (M_trans == CONJ || M_trans == CONJTRANS)
83 V_StVpV(Y, ST::conjugate(
s_)*alpha, X, *Y);
85 V_StVpV(Y,
s_*alpha, X, *Y);
95 const Ptr<
const SolveCriteria< Scalar > > )
const
100 const SolveMeasureType &)
const
104 const EOpTransp M_trans,
105 const MultiVectorBase<Scalar>& B,
106 const Ptr<MultiVectorBase<Scalar> >& X,
107 const Ptr<
const SolveCriteria< Scalar > > )
const
109 typedef Teuchos::ScalarTraits<Scalar> ST;
110 assign(X, ST::zero());
111 if (M_trans == CONJ || M_trans == CONJTRANS)
112 V_StVpV(X, ST::one()/ST::conjugate(
s_), B, *X);
114 V_StVpV(X, ST::one()/
s_, B, *X);
115 SolveStatus<Scalar> solveStatus;
116 solveStatus.solveStatus = SOLVE_STATUS_CONVERGED;
126 RCP<const VectorSpaceBase<Scalar> >
space_;
133 const RCP<
const VectorSpaceBase<Scalar> >&
space) {
135 TEUCHOS_TEST_FOR_EXCEPT(is_null(
space));
147 template<
class Scalar>
148 RCP<ScaledIdentityLinearOpWithSolve<Scalar> >
158 template<
class Scalar>
159 RCP<ScaledIdentityLinearOpWithSolve<Scalar> >
163 RCP<ScaledIdentityLinearOpWithSolve<Scalar> >
165 op->initialize(space, s);
bool solveSupportsImpl(EOpTransp) const
Implicit concrete LinearOpBase subclass that takes a flattended out multi-vector and performs a multi...
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
void setScale(const Scalar &s)
RCP< ScaledIdentityLinearOpWithSolve< Scalar > > scaledIdentity(const RCP< const VectorSpaceBase< Scalar > > &space, const Scalar &s)
Nonmember constructor function.
static void validateInitialize(const RCP< const VectorSpaceBase< Scalar > > &space)
ScaledIdentityLinearOpWithSolve()
Construct to uninitialized.
RCP< const VectorSpaceBase< Scalar > > space() const
bool solveSupportsNewImpl(EOpTransp, const Ptr< const SolveCriteria< Scalar > >) const
SolveStatus< Scalar > solveImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > >) const
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space, const Scalar &s)
RCP< const VectorSpaceBase< Scalar > > space_
RCP< const LinearOpBase< Scalar > > clone() const
bool solveSupportsSolveMeasureTypeImpl(EOpTransp, const SolveMeasureType &) const
RCP< const VectorSpaceBase< Scalar > > domain() const
RCP< const VectorSpaceBase< Scalar > > range() const
RCP< ScaledIdentityLinearOpWithSolve< Scalar > > scaledIdentity()
Nonmember constructor function.
bool opSupportedImpl(EOpTransp) const