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,
227 RCP<const LinearOpBase<Scalar> >
getOp()
const;
257 Teuchos::FancyOStream &out,
258 const Teuchos::EVerbosityLevel verbLevel
273 RCP<const VectorSpaceBase<Scalar> >
range()
const;
282 RCP<const VectorSpaceBase<Scalar> >
domain()
const;
285 RCP<const LinearOpBase<Scalar> >
clone()
const;
299 RCP<const LinearOpBase<Scalar> >
getOrigOp()
const;
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;
354 typedef Teuchos::ConstNonconstObjectContainer<LinearOpBase<Scalar> > CNLOC;
360 Scalar overallScalar_;
364 RCP<allScalarETransp_t> allScalarETransp_;
370 const Scalar &scalar,
375 CNLOC getOpImpl()
const;
376 void assertInitialized()
const;
400 template<
class Scalar>
401 RCP<LinearOpBase<Scalar> >
403 const Scalar &scalar,
405 const std::string &label =
"" 424 template<
class Scalar>
425 RCP<const LinearOpBase<Scalar> >
427 const Scalar &scalar,
429 const std::string &label =
"" 448 template<
class Scalar>
449 RCP<LinearOpBase<Scalar> >
452 const std::string &label =
"" 471 template<
class Scalar>
472 RCP<const LinearOpBase<Scalar> >
475 const std::string &label =
"" 494 template<
class Scalar>
495 RCP<LinearOpBase<Scalar> >
498 const std::string &label =
"" 517 template<
class Scalar>
518 RCP<const LinearOpBase<Scalar> >
521 const std::string &label =
"" 541 template<
class Scalar>
542 RCP<LinearOpBase<Scalar> >
543 nonconstScaleAndAdjoint(
544 const Scalar &scalar,
const EOpTransp &transp,
546 const std::string &label =
"" 566 template<
class Scalar>
567 RCP<const LinearOpBase<Scalar> >
569 const Scalar &scalar,
const EOpTransp &transp,
571 const std::string &label =
"" 579 template<
class Scalar>
582 :overallScalar_(
Teuchos::ScalarTraits<Scalar>::zero())
588 template<
class Scalar>
595 :overallScalar_(
Teuchos::ScalarTraits<Scalar>::zero())
602 template<
class Scalar>
609 :overallScalar_(
Teuchos::ScalarTraits<Scalar>::zero())
616 template<
class Scalar>
621 TEUCHOS_TEST_FOR_EXCEPT( origOp_.getConstObj().get() == NULL );
633 template<
class Scalar>
inline 634 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
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 654 Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >
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 672 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
673 Thyra::nonconstAdjoint(
674 const RCP<LinearOpBase<Scalar> > &Op,
675 const std::string &label
678 RCP<Thyra::LinearOpBase<Scalar> >
680 new DefaultScaledAdjointLinearOp<Scalar>(
681 Teuchos::ScalarTraits<Scalar>::one(),
CONJTRANS,Op
685 salo->setObjectLabel(label);
690 template<
class Scalar>
inline 691 Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >
693 const RCP<
const LinearOpBase<Scalar> > &Op,
694 const std::string &label
697 RCP<Thyra::LinearOpBase<Scalar> >
699 new DefaultScaledAdjointLinearOp<Scalar>(
700 Teuchos::ScalarTraits<Scalar>::one(),
CONJTRANS,Op
704 salo->setObjectLabel(label);
709 template<
class Scalar>
inline 710 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
711 Thyra::nonconstTranspose(
712 const RCP<LinearOpBase<Scalar> > &Op,
713 const std::string &label
716 RCP<Thyra::LinearOpBase<Scalar> >
718 new DefaultScaledAdjointLinearOp<Scalar>(
719 Teuchos::ScalarTraits<Scalar>::one(),
TRANS,Op
723 salo->setObjectLabel(label);
728 template<
class Scalar>
inline 729 Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >
731 const RCP<
const LinearOpBase<Scalar> > &Op,
732 const std::string &label
735 RCP<Thyra::LinearOpBase<Scalar> >
737 new DefaultScaledAdjointLinearOp<Scalar>(
738 Teuchos::ScalarTraits<Scalar>::one(),
TRANS,Op
742 salo->setObjectLabel(label);
747 template<
class Scalar>
inline 748 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
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 767 Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >
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.
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
RCP< const LinearOpBase< Scalar > > getOrigOp() const
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 ...
bool opSupportedImpl(EOpTransp M_trans) const
Return if the operation is supported on the logical linear operator.
Use the non-transposed operator.
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types)...
RCP< const LinearOpBase< Scalar > > clone() const
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.
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...
std::string description() const
Outputs DefaultScaledAdjointLinearOp<Scalar>{this->getOrigOp().description()) along with the dimensio...
RCP< const LinearOpBase< Scalar > > getOp() const
Return the const linear operator passed into initialize().
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().
Base class for all linear operators.
RCP< const VectorSpaceBase< Scalar > > domain() const
Return the domain space of the logical linear operator.
Scalar overallScalar() const
RCP< LinearOpBase< Scalar > > getNonconstOrigOp()
EOpTransp overallTransp() const
RCP< const VectorSpaceBase< Scalar > > range() const
Return the range space of the logical linear operator.
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...