42 #ifndef THYRA_DEFAULT_SCALED_ADJOINT_LINEAR_OP_DECL_HPP
43 #define THYRA_DEFAULT_SCALED_ADJOINT_LINEAR_OP_DECL_HPP
46 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
47 #include "Teuchos_ConstNonconstObjectContainer.hpp"
125 template<
class Scalar>
149 const Scalar &scalar,
161 const Scalar &scalar,
188 const Scalar &scalar,
341 template <
class Scalar2>
342 struct ScalarETransp {
347 ScalarETransp(
const Scalar2 &_scalar,
const EOpTransp &_transp )
348 : scalar(_scalar), transp(_transp)
352 typedef std::vector<ScalarETransp<Scalar> > allScalarETransp_t;
360 Scalar overallScalar_;
370 const Scalar &scalar,
375 CNLOC getOpImpl()
const;
376 void assertInitialized()
const;
400 template<
class Scalar>
403 const Scalar &scalar,
405 const std::string &label =
""
424 template<
class Scalar>
427 const Scalar &scalar,
429 const std::string &label =
""
448 template<
class Scalar>
452 const std::string &label =
""
471 template<
class Scalar>
475 const std::string &label =
""
494 template<
class Scalar>
498 const std::string &label =
""
517 template<
class Scalar>
521 const std::string &label =
""
541 template<
class Scalar>
544 const Scalar &scalar,
const EOpTransp &transp,
546 const std::string &label =
""
566 template<
class Scalar>
569 const Scalar &scalar,
const EOpTransp &transp,
571 const std::string &label =
""
579 template<
class Scalar>
588 template<
class Scalar>
602 template<
class Scalar>
616 template<
class Scalar>
633 template<
class Scalar>
inline
635 Thyra::nonconstScale(
636 const Scalar &scalar,
637 const RCP<LinearOpBase<Scalar> > &Op,
638 const std::string &label
641 RCP<Thyra::LinearOpBase<Scalar> >
643 new DefaultScaledAdjointLinearOp<Scalar>(
648 salo->setObjectLabel(label);
653 template<
class Scalar>
inline
656 const Scalar &scalar,
657 const RCP<
const LinearOpBase<Scalar> > &Op,
658 const std::string &label
661 RCP<Thyra::LinearOpBase<Scalar> >
663 new DefaultScaledAdjointLinearOp<Scalar>(scalar,
NOTRANS,Op)
666 salo->setObjectLabel(label);
671 template<
class Scalar>
inline
673 Thyra::nonconstAdjoint(
674 const RCP<LinearOpBase<Scalar> > &Op,
675 const std::string &label
678 RCP<Thyra::LinearOpBase<Scalar> >
680 new DefaultScaledAdjointLinearOp<Scalar>(
685 salo->setObjectLabel(label);
690 template<
class Scalar>
inline
693 const RCP<
const LinearOpBase<Scalar> > &Op,
694 const std::string &label
697 RCP<Thyra::LinearOpBase<Scalar> >
699 new DefaultScaledAdjointLinearOp<Scalar>(
704 salo->setObjectLabel(label);
709 template<
class Scalar>
inline
711 Thyra::nonconstTranspose(
712 const RCP<LinearOpBase<Scalar> > &Op,
713 const std::string &label
716 RCP<Thyra::LinearOpBase<Scalar> >
718 new DefaultScaledAdjointLinearOp<Scalar>(
723 salo->setObjectLabel(label);
728 template<
class Scalar>
inline
731 const RCP<
const LinearOpBase<Scalar> > &Op,
732 const std::string &label
735 RCP<Thyra::LinearOpBase<Scalar> >
737 new DefaultScaledAdjointLinearOp<Scalar>(
742 salo->setObjectLabel(label);
747 template<
class Scalar>
inline
749 Thyra::nonconstScaleAndAdjoint(
750 const Scalar &scalar,
752 const RCP<LinearOpBase<Scalar> > &Op,
753 const std::string &label
756 RCP<Thyra::LinearOpBase<Scalar> >
758 new DefaultScaledAdjointLinearOp<Scalar>(scalar,transp,Op)
761 salo->setObjectLabel(label);
766 template<
class Scalar>
inline
768 Thyra::scaleAndAdjoint(
769 const Scalar &scalar,
771 const RCP<
const LinearOpBase<Scalar> > &Op,
772 const std::string &label
775 RCP<Thyra::LinearOpBase<Scalar> >
777 new DefaultScaledAdjointLinearOp<Scalar>(
782 salo->setObjectLabel(label);
Concrete decorator LinearOpBase subclass that wraps a LinearOpBase object and adds on an extra scalin...
RCP< LinearOpBase< Scalar > > getNonconstOp()
Return the non-const linear operator passed into initialize().
RCP< LinearOpBase< Scalar > > getNonconstOrigOp()
bool opSupportedImpl(EOpTransp M_trans) const
Return if the operation is supported on the logical linear operator.
std::string description() const
Outputs DefaultScaledAdjointLinearOp<Scalar>{this->getOrigOp().description()) along with the dimensio...
RCP< const LinearOpBase< Scalar > > scale(const Scalar &scalar, const RCP< const LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit const scaled linear operator.
RCP< const VectorSpaceBase< Scalar > > domain() const
Return the domain space of the logical linear operator.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints out the original operator as well as all of the scalings and transpositions in the order that ...
void uninitialize()
Set to uninitialized and (optionally) extract the objects passed into initialize().
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
Apply the linear operator (or its transpose) to a multi-vector : Y = alpha*op(M)*X + beta*Y.
RCP< const LinearOpBase< Scalar > > transpose(const RCP< const LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit const transposed linear operator.
RCP< LinearOpBase< Scalar > > nonconstAdjoint(const RCP< LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit non-const adjoined linear operator.
RCP< const LinearOpBase< Scalar > > clone() const
RCP< LinearOpBase< Scalar > > nonconstScale(const Scalar &scalar, const RCP< LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit non-const scaled linear operator.
RCP< const LinearOpBase< Scalar > > getOrigOp() const
RCP< const VectorSpaceBase< Scalar > > range() const
Return the range space of the logical linear operator.
void initialize(const Scalar &scalar, const EOpTransp &transp, const RCP< LinearOpBase< Scalar > > &Op)
Initialize with an operator with by defining adjoint (transpose) and scaling arguments.
DefaultScaledAdjointLinearOp()
Constructs to uninitialized.
Scalar overallScalar() const
RCP< LinearOpBase< Scalar > > nonconstTranspose(const RCP< LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit non-const transposed linear operator.
RCP< const LinearOpBase< Scalar > > scaleAndAdjoint(const Scalar &scalar, const EOpTransp &transp, const RCP< const LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit const scaled and/or adjoined (transposed) linear operator.
RCP< const LinearOpBase< Scalar > > adjoint(const RCP< const LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit const adjoined linear operator.
RCP< LinearOpBase< Scalar > > nonconstScaleAndAdjoint(const Scalar &scalar, const EOpTransp &transp, const RCP< LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit non-const scaled and/or adjoined (transposed) linear operator.
EOpTransp overallTransp() const
RCP< const LinearOpBase< Scalar > > getOp() const
Return the const linear operator passed into initialize().
Base class for all linear operators.
Interface for a collection of column vectors called a multi-vector.
Base class for LinearOpBase decorator subclasses that wrap a LinearOpBase object and adds on an extra...
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
@ TRANS
Use the transposed operator.
@ NOTRANS
Use the non-transposed operator.
@ CONJTRANS
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types).
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)