10 #ifndef THYRA_DEFAULT_SCALED_ADJOINT_LINEAR_OP_DECL_HPP
11 #define THYRA_DEFAULT_SCALED_ADJOINT_LINEAR_OP_DECL_HPP
14 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
15 #include "Teuchos_ConstNonconstObjectContainer.hpp"
93 template<
class Scalar>
117 const Scalar &scalar,
129 const Scalar &scalar,
156 const Scalar &scalar,
309 template <
class Scalar2>
310 struct ScalarETransp {
315 ScalarETransp(
const Scalar2 &_scalar,
const EOpTransp &_transp )
316 : scalar(_scalar), transp(_transp)
320 typedef std::vector<ScalarETransp<Scalar> > allScalarETransp_t;
328 Scalar overallScalar_;
338 const Scalar &scalar,
343 CNLOC getOpImpl()
const;
344 void assertInitialized()
const;
368 template<
class Scalar>
371 const Scalar &scalar,
373 const std::string &label =
""
392 template<
class Scalar>
395 const Scalar &scalar,
397 const std::string &label =
""
416 template<
class Scalar>
420 const std::string &label =
""
439 template<
class Scalar>
443 const std::string &label =
""
462 template<
class Scalar>
466 const std::string &label =
""
485 template<
class Scalar>
489 const std::string &label =
""
509 template<
class Scalar>
511 nonconstScaleAndAdjoint(
512 const Scalar &scalar,
const EOpTransp &transp,
514 const std::string &label =
""
534 template<
class Scalar>
537 const Scalar &scalar,
const EOpTransp &transp,
539 const std::string &label =
""
547 template<
class Scalar>
556 template<
class Scalar>
570 template<
class Scalar>
584 template<
class Scalar>
601 template<
class Scalar>
inline
603 Thyra::nonconstScale(
604 const Scalar &scalar,
605 const RCP<LinearOpBase<Scalar> > &Op,
606 const std::string &label
609 RCP<Thyra::LinearOpBase<Scalar> >
611 new DefaultScaledAdjointLinearOp<Scalar>(
616 salo->setObjectLabel(label);
621 template<
class Scalar>
inline
624 const Scalar &scalar,
625 const RCP<
const LinearOpBase<Scalar> > &Op,
626 const std::string &label
629 RCP<Thyra::LinearOpBase<Scalar> >
631 new DefaultScaledAdjointLinearOp<Scalar>(scalar,
NOTRANS,Op)
634 salo->setObjectLabel(label);
639 template<
class Scalar>
inline
641 Thyra::nonconstAdjoint(
642 const RCP<LinearOpBase<Scalar> > &Op,
643 const std::string &label
646 RCP<Thyra::LinearOpBase<Scalar> >
648 new DefaultScaledAdjointLinearOp<Scalar>(
653 salo->setObjectLabel(label);
658 template<
class Scalar>
inline
661 const RCP<
const LinearOpBase<Scalar> > &Op,
662 const std::string &label
665 RCP<Thyra::LinearOpBase<Scalar> >
667 new DefaultScaledAdjointLinearOp<Scalar>(
672 salo->setObjectLabel(label);
677 template<
class Scalar>
inline
679 Thyra::nonconstTranspose(
680 const RCP<LinearOpBase<Scalar> > &Op,
681 const std::string &label
684 RCP<Thyra::LinearOpBase<Scalar> >
686 new DefaultScaledAdjointLinearOp<Scalar>(
691 salo->setObjectLabel(label);
696 template<
class Scalar>
inline
699 const RCP<
const LinearOpBase<Scalar> > &Op,
700 const std::string &label
703 RCP<Thyra::LinearOpBase<Scalar> >
705 new DefaultScaledAdjointLinearOp<Scalar>(
710 salo->setObjectLabel(label);
715 template<
class Scalar>
inline
717 Thyra::nonconstScaleAndAdjoint(
718 const Scalar &scalar,
720 const RCP<LinearOpBase<Scalar> > &Op,
721 const std::string &label
724 RCP<Thyra::LinearOpBase<Scalar> >
726 new DefaultScaledAdjointLinearOp<Scalar>(scalar,transp,Op)
729 salo->setObjectLabel(label);
734 template<
class Scalar>
inline
736 Thyra::scaleAndAdjoint(
737 const Scalar &scalar,
739 const RCP<
const LinearOpBase<Scalar> > &Op,
740 const std::string &label
743 RCP<Thyra::LinearOpBase<Scalar> >
745 new DefaultScaledAdjointLinearOp<Scalar>(
750 salo->setObjectLabel(label);
755 #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)