10 #ifndef THYRA_DIAGONAL_LINEAR_OP_DEF_HPP
11 #define THYRA_DIAGONAL_LINEAR_OP_DEF_HPP
14 #include "Thyra_DefaultDiagonalLinearOp_decl.hpp"
15 #include "Thyra_MultiVectorStdOps.hpp"
16 #include "Thyra_VectorStdOps.hpp"
17 #include "Thyra_VectorBase.hpp"
18 #include "Thyra_AssertOp.hpp"
27 template<
class Scalar>
32 template<
class Scalar>
41 template<
class Scalar>
50 template<
class Scalar>
59 template<
class Scalar>
71 template<
class Scalar>
76 diag_.initialize(diag);
80 template<
class Scalar>
85 diag_.initialize(diag);
89 template<
class Scalar>
99 template<
class Scalar>
102 return diag_.isConst();
106 template<
class Scalar>
110 return diag_.getNonconstObj();
114 template<
class Scalar>
118 return diag_.getConstObj();
125 template<
class Scalar>
129 return diag_.getConstObj()->space();
133 template<
class Scalar>
137 return diag_.getConstObj()->space();
141 template<
class Scalar>
155 template<
class Scalar>
162 template<
class Scalar>
175 "DefaultDiagonalLinearOp<Scalar>::apply(...)",*
this, M_trans, X, &*Y
177 #endif // TEUCHOS_DEBUG
181 if( beta != ST::one() ) scale<Scalar>(beta, Y);
187 for (
Ordinal col_j = 0; col_j < m; ++col_j) {
192 ele_wise_prod( alpha, *diag_.getConstObj(), *x, y.
ptr() );
195 ele_wise_conj_prod( alpha, *diag_.getConstObj(), *x, y.
ptr() );
199 ele_wise_prod( alpha, *diag_.getConstObj(), *x, y.
ptr() );
209 #endif // THYRA_DIAGONAL_LINEAR_OP_DEF_HPP
void initialize(int *argc, char ***argv)
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.