42 #ifndef THYRA_DIAGONAL_LINEAR_OP_DEF_HPP
43 #define THYRA_DIAGONAL_LINEAR_OP_DEF_HPP
46 #include "Thyra_DefaultDiagonalLinearOp_decl.hpp"
47 #include "Thyra_MultiVectorStdOps.hpp"
48 #include "Thyra_VectorStdOps.hpp"
49 #include "Thyra_VectorBase.hpp"
50 #include "Thyra_AssertOp.hpp"
59 template<
class Scalar>
64 template<
class Scalar>
73 template<
class Scalar>
82 template<
class Scalar>
91 template<
class Scalar>
99 initialize(createMember(space));
103 template<
class Scalar>
108 diag_.initialize(diag);
112 template<
class Scalar>
117 diag_.initialize(diag);
121 template<
class Scalar>
124 diag_.uninitialize();
131 template<
class Scalar>
134 return diag_.isConst();
138 template<
class Scalar>
142 return diag_.getNonconstObj();
146 template<
class Scalar>
150 return diag_.getConstObj();
157 template<
class Scalar>
161 return diag_.getConstObj()->space();
165 template<
class Scalar>
169 return diag_.getConstObj()->space();
173 template<
class Scalar>
187 template<
class Scalar>
194 template<
class Scalar>
207 "DefaultDiagonalLinearOp<Scalar>::apply(...)",*
this, M_trans, X, &*Y
209 #endif // TEUCHOS_DEBUG
213 if( beta != ST::one() ) scale<Scalar>(beta, Y);
219 for (
Ordinal col_j = 0; col_j < m; ++col_j) {
224 ele_wise_prod( alpha, *diag_.getConstObj(), *x, y.
ptr() );
227 ele_wise_conj_prod( alpha, *diag_.getConstObj(), *x, y.
ptr() );
231 ele_wise_prod( alpha, *diag_.getConstObj(), *x, y.
ptr() );
241 #endif // THYRA_DIAGONAL_LINEAR_OP_DEF_HPP
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
RCP< const VectorSpaceBase< Scalar > > domain() const
Returns this->getDiag()->space().
#define THYRA_ASSERT_LINEAR_OP_MULTIVEC_APPLY_SPACES(FUNC_NAME, M, M_T, X, Y)
This is a very useful macro that should be used to validate that the spaces for the multi-vector vers...
RCP< const VectorBase< Scalar > > getDiag() const
bool opSupportedImpl(EOpTransp M_trans) const
Use the non-transposed operator.
Abstract interface for objects that represent a space for vectors.
Use the transposed operator.
RCP< const LinearOpBase< Scalar > > clone() const
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space)
Initialize given a vector space which allocates a vector internally.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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().
Abstract interface for finite-dimensional dense vectors.
DefaultDiagonalLinearOp()
Constructs to uninitialized.
virtual RCP< const VectorSpaceBase< Scalar > > domain() const =0
Return a smart pointer for the domain space for this operator.
RCP< const VectorSpaceBase< Scalar > > range() const
Returns this->getDiag()->space().
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
RCP< VectorBase< Scalar > > getNonconstDiag()
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Default concrete LinearOpBase subclass for diagonal linear operators.
void uninitialize()
Uninitialize.