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>
543 nonconstScaleAndAdjoint(
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);
787 #endif // THYRA_DEFAULT_SCALED_ADJOINT_LINEAR_OP_DECL_HPP
DefaultScaledAdjointLinearOp()
Constructs to uninitialized.
RCP< const VectorSpaceBase< Scalar > > range() const
Return the range space of the logical linear operator.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
EOpTransp overallTransp() const
Scalar overallScalar() const
RCP< const LinearOpBase< Scalar > > getOrigOp() const
std::string description() const
Outputs DefaultScaledAdjointLinearOp<Scalar>{this->getOrigOp().description()) along with the dimensio...
Use the non-transposed operator.
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types)...
RCP< LinearOpBase< Scalar > > getNonconstOp()
Return the non-const linear operator passed into initialize().
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.
Use the transposed operator.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< const LinearOpBase< Scalar > > getOp() const
Return the const linear operator passed into initialize().
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...
Concrete decorator LinearOpBase subclass that wraps a LinearOpBase object and adds on an extra scalin...
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...
Base class for all linear operators.
RCP< const LinearOpBase< Scalar > > clone() const
RCP< LinearOpBase< Scalar > > getNonconstOrigOp()
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 ...
RCP< const VectorSpaceBase< Scalar > > domain() const
Return the domain space of the logical linear operator.
bool opSupportedImpl(EOpTransp M_trans) const
Return if the operation is supported on the logical linear operator.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)