Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Related Functions | List of all members
Thyra::EpetraLinearOp Class Reference

Concrete LinearOpBase adapter subclass for Epetra_Operator object. More...

#include <Thyra_EpetraLinearOp.hpp>

Inheritance diagram for Thyra::EpetraLinearOp:
Inheritance graph
[legend]

Related Functions

(Note that these are not member functions.)

RCP< EpetraLinearOpnonconstEpetraLinearOp ()
 Default nonmember constructor. More...
 
RCP< EpetraLinearOppartialNonconstEpetraLinearOp (const RCP< const VectorSpaceBase< double > > &range, const RCP< const VectorSpaceBase< double > > &domain, const RCP< Epetra_Operator > &op, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED)
 Partially initialized EpetraLinearOp. More...
 
RCP< EpetraLinearOpnonconstEpetraLinearOp (const RCP< Epetra_Operator > &op, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const RCP< const VectorSpaceBase< double > > &range=Teuchos::null, const RCP< const VectorSpaceBase< double > > &domain=Teuchos::null)
 Dynamically allocate an const EpetraLinearOp to wrap a const Epetra_Operator object. More...
 
RCP< const EpetraLinearOpepetraLinearOp (const RCP< const Epetra_Operator > &op, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const RCP< const VectorSpaceBase< double > > &range=Teuchos::null, const RCP< const VectorSpaceBase< double > > &domain=Teuchos::null)
 Dynamically allocate a nonconst EpetraLinearOp to wrap a const Epetra_Operator object. More...
 
RCP< EpetraLinearOpnonconstEpetraLinearOp (const RCP< Epetra_Operator > &op, const std::string &label, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const RCP< const VectorSpaceBase< double > > &range=Teuchos::null, const RCP< const VectorSpaceBase< double > > &domain=Teuchos::null)
 Dynamically allocate an const EpetraLinearOp to wrap a const Epetra_Operator object and give it a string label. More...
 
RCP< const EpetraLinearOpepetraLinearOp (const RCP< const Epetra_Operator > &op, const std::string &label, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const RCP< const SpmdVectorSpaceBase< double > > &range=Teuchos::null, const RCP< const SpmdVectorSpaceBase< double > > &domain=Teuchos::null)
 Dynamically allocate a nonconst EpetraLinearOp to wrap a const Epetra_Operator object. More...
 

Constructors / initializers / accessors

 EpetraLinearOp ()
 Construct to uninitialized. More...
 
void initialize (const RCP< Epetra_Operator > &op, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const RCP< const VectorSpaceBase< double > > &range=Teuchos::null, const RCP< const VectorSpaceBase< double > > &domain=Teuchos::null)
 Fully initialize. More...
 
void partiallyInitialize (const RCP< const VectorSpaceBase< double > > &range, const RCP< const VectorSpaceBase< double > > &domain, const RCP< Epetra_Operator > &op, EOpTransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED)
 Partially initialize. More...
 
void setFullyInitialized (bool isFullyInitialized=true)
 Set to fully initialized. More...
 
void uninitialize (RCP< Epetra_Operator > *op=NULL, EOpTransp *opTrans=NULL, EApplyEpetraOpAs *applyAs=NULL, EAdjointEpetraOp *adjointSupport=NULL, RCP< const VectorSpaceBase< double > > *range=NULL, RCP< const VectorSpaceBase< double > > *domain=NULL)
 Set to uninitialized and optionally return the current state. More...
 
RCP< const SpmdVectorSpaceBase
< double > > 
spmdRange () const
 Return a smart pointer to the SpmdVectorSpaceBase object for the range. More...
 
RCP< const SpmdVectorSpaceBase
< double > > 
spmdDomain () const
 Return a smart pointer to the SpmdVectorSpaceBase object for the domain. More...
 
RCP< Epetra_Operatorepetra_op ()
 
RCP< const Epetra_Operatorepetra_op () const
 

Overridden from EpetraLinearOpBase

void getNonconstEpetraOpView (const Ptr< RCP< Epetra_Operator > > &epetraOp, const Ptr< EOpTransp > &epetraOpTransp, const Ptr< EApplyEpetraOpAs > &epetraOpApplyAs, const Ptr< EAdjointEpetraOp > &epetraOpAdjointSupport)
 
void getEpetraOpView (const Ptr< RCP< const Epetra_Operator > > &epetraOp, const Ptr< EOpTransp > &epetraOpTransp, const Ptr< EApplyEpetraOpAs > &epetraOpApplyAs, const Ptr< EAdjointEpetraOp > &epetraOpAdjointSupport) const
 

Overridden from LinearOpBase

RCP< const VectorSpaceBase
< double > > 
range () const
 
RCP< const VectorSpaceBase
< double > > 
domain () const
 
RCP< const LinearOpBase< double > > clone () const
 

Overridden from Teuchos::Describable

std::string description () const
 
void describe (FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
 

Protected member functions overridden from LinearOpBase.

bool opSupportedImpl (EOpTransp M_trans) const
 
void applyImpl (const EOpTransp M_trans, const MultiVectorBase< double > &X, const Ptr< MultiVectorBase< double > > &Y, const double alpha, const double beta) const
 

Protected member functions overridden from ScaledLinearOpBase.

virtual bool supportsScaleLeftImpl () const
 
virtual bool supportsScaleRightImpl () const
 
virtual void scaleLeftImpl (const VectorBase< double > &row_scaling)
 
virtual void scaleRightImpl (const VectorBase< double > &col_scaling)
 

Protected member functions overridden from RowStatLinearOpBase.

virtual bool rowStatIsSupportedImpl (const RowStatLinearOpBaseUtils::ERowStat rowStat) const
 
virtual void getRowStatImpl (const RowStatLinearOpBaseUtils::ERowStat rowStat, const Ptr< VectorBase< double > > &rowStatVec) const
 

Allocators for domain and range spaces

virtual RCP< const
SpmdVectorSpaceBase< double > > 
allocateDomain (const RCP< Epetra_Operator > &op, EOpTransp op_trans) const
 Allocate the domain space of the operator. More...
 
virtual RCP< const
SpmdVectorSpaceBase< double > > 
allocateRange (const RCP< Epetra_Operator > &op, EOpTransp op_trans) const
 Allocate the range space of the operator. More...
 

Detailed Description

Concrete LinearOpBase adapter subclass for Epetra_Operator object.

This subclass can be used to represent the non-transposed operator or transposed operator defined by an Epetra_Operator object. This class can implement apply() using either Epetra_Operator::Apply() or Epetra_Operator::ApplyInverse(). In addition, the user can specify whether adjoints are supported or not.

Partial Automatic Change Propagation: This class shall maintain no state with respect to the values of the internally stored Epetra_Operator object. Therefore, as long as the domain and range maps do not change, the the Epetra_Operator can be changed and this will automatically update *this object. This simplifies some types of update operations. Since this is a simple concrete class, this is harmless. However, if the range and domain maps change, then one must call the this->initialize() function.

Definition at line 78 of file Thyra_EpetraLinearOp.hpp.

Constructor & Destructor Documentation

Thyra::EpetraLinearOp::EpetraLinearOp ( )

Construct to uninitialized.

See the postconditions for uninitialize()

Definition at line 65 of file Thyra_EpetraLinearOp.cpp.

Member Function Documentation

void Thyra::EpetraLinearOp::initialize ( const RCP< Epetra_Operator > &  op,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const RCP< const VectorSpaceBase< double > > &  range = Teuchos::null,
const RCP< const VectorSpaceBase< double > > &  domain = Teuchos::null 
)

Fully initialize.

Parameters
op[in] The Epetra_Operator this *this will wrap.
opTrans[in] If opTrans==NOTRANS then op will be viewed as op and if opTrans==TRANS then op will be viewed as its transpose op' for the behavior of apply().
applyAs[in] If applyAs==APPLY_APPLY then op->Apply() will be used and if applyAs==APPLY_APPLY_INVERSE then op->ApplyInverse() is used instead.
adjointSupport[in] Determines if it is to be assumed that adjoints are supported on the underlying Epetra_Operator object op. If adjointSupport==EPETRA_OP_ADJOINT_SUPPORTED then this->opSupported(TRANS) will return true. If adjointSupport==EPETRA_OP_ADJOINT_UNSUPPORTED then this->opSupported(TRANS) will return false.
range[in] Smart pointer to the range space for the Epetra_Operator. The default value is Teuchos::null in which case *this will allocate a new SpmdVectorSpace given range map from op. A client may only bother to specify this space if one wants to override the defintion of the scalar product.
domain[in] Smart pointer to the domain space for the Epetra_Operator. The default value is Teuchos::null in which case *this will allocate a new DefaultSpmdVectorSpace given map from op. A client may only bother to specify this space if one wants to override the defintion of the scalar product.

Preconditions:

  • !is_null(op)

Postconditions:

  • this->epetra_op().get() == op.get()
  • [range.get() != NULL] this->range().get() == range.get()
  • [domain.get() != NULL] this->domain().get() == domain.get()
  • [range.get() == NULL] this->range().get() != NULL
  • [domain.get() == NULL] this->domain().get() != NULL
  • this->opSupported(NOTRANS) == true
  • this->opSupported(TRNAS) == adjointSupport==EPETRA_OP_ADJOINT_SUPPORTED

After this function is called, this will be fully initialized and ready to go.

Definition at line 73 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::partiallyInitialize ( const RCP< const VectorSpaceBase< double > > &  range,
const RCP< const VectorSpaceBase< double > > &  domain,
const RCP< Epetra_Operator > &  op,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED 
)

Partially initialize.

Parameters
range[in] Smart pointer to the range space for the Epetra_Operator.
domain[in] Smart pointer to the domain space for the Epetra_Operator.
op[in] The Epetra_Operator this *this will wrap. This object is assumed to not be fully unitialized.
opTrans[in] If opTrans==NOTRANS then op will be viewed as op and if opTrans==TRANS then op will be viewed as its transpose op' for the behavior of apply().
applyAs[in] If applyAs==APPLY_APPLY then op->Apply() will be used and if applyAs==APPLY_APPLY_INVERSE then op->ApplyInverse() is used instead.
adjointSupport[in] Determines if it is to be assumed that adjoints are supported on the underlying Epetra_Operator object op. If adjointSupport==EPETRA_OP_ADJOINT_SUPPORTED then this->opSupported(TRANS) will return true. If adjointSupport==EPETRA_OP_ADJOINT_UNSUPPORTED then this->opSupported(TRANS) will return false.

Preconditions:

  • !is_null(range)
  • !is_null(domain)
  • !is_null(op)

Postconditions:

  • this->epetra_op().get() == op.get()
  • [range.get() != NULL] this->range().get() == range.get()
  • [domain.get() != NULL] this->domain().get() == domain.get()
  • [range.get() == NULL] this->range().get() != NULL
  • [domain.get() == NULL] this->domain().get() != NULL
  • this->opSupported(NOTRANS) == true
  • this->opSupported(TRNAS) == adjointSupport==EPETRA_OP_ADJOINT_SUPPORTED

After this function is called, only the range and domain spaces will be supported and this must be followed up by a call to setFullyInitialized().

Definition at line 120 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::setFullyInitialized ( bool  isFullyInitialized = true)

Set to fully initialized.

In debug mode, asserts will be performed to ensure that everything matches up as it should.

The functions initialize() ore partiallyInitialize() must have been called prior to calling this function.

Definition at line 161 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::uninitialize ( RCP< Epetra_Operator > *  op = NULL,
EOpTransp opTrans = NULL,
EApplyEpetraOpAs applyAs = NULL,
EAdjointEpetraOp adjointSupport = NULL,
RCP< const VectorSpaceBase< double > > *  range = NULL,
RCP< const VectorSpaceBase< double > > *  domain = NULL 
)

Set to uninitialized and optionally return the current state.

Postconditions:

Definition at line 168 of file Thyra_EpetraLinearOp.cpp.

RCP< const SpmdVectorSpaceBase< double > > Thyra::EpetraLinearOp::spmdRange ( ) const

Return a smart pointer to the SpmdVectorSpaceBase object for the range.

Postconditions:

  • [this->range().get() != NULL] return.get() != NULL
  • [this->range().get() == NULL] return.get() == NULL

Definition at line 198 of file Thyra_EpetraLinearOp.cpp.

RCP< const SpmdVectorSpaceBase< double > > Thyra::EpetraLinearOp::spmdDomain ( ) const

Return a smart pointer to the SpmdVectorSpaceBase object for the domain.

Postconditions:

  • [this->domain().get() != NULL] return.get() != NULL
  • [this->domain().get() == NULL] return.get() == NULL

Definition at line 205 of file Thyra_EpetraLinearOp.cpp.

RCP< Epetra_Operator > Thyra::EpetraLinearOp::epetra_op ( )

Definition at line 212 of file Thyra_EpetraLinearOp.cpp.

RCP< const Epetra_Operator > Thyra::EpetraLinearOp::epetra_op ( ) const

Definition at line 219 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::getNonconstEpetraOpView ( const Ptr< RCP< Epetra_Operator > > &  epetraOp,
const Ptr< EOpTransp > &  epetraOpTransp,
const Ptr< EApplyEpetraOpAs > &  epetraOpApplyAs,
const Ptr< EAdjointEpetraOp > &  epetraOpAdjointSupport 
)
virtual

Implements Thyra::EpetraLinearOpBase.

Definition at line 228 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::getEpetraOpView ( const Ptr< RCP< const Epetra_Operator > > &  epetraOp,
const Ptr< EOpTransp > &  epetraOpTransp,
const Ptr< EApplyEpetraOpAs > &  epetraOpApplyAs,
const Ptr< EAdjointEpetraOp > &  epetraOpAdjointSupport 
) const
virtual

Implements Thyra::EpetraLinearOpBase.

Definition at line 242 of file Thyra_EpetraLinearOp.cpp.

RCP< const VectorSpaceBase< double > > Thyra::EpetraLinearOp::range ( ) const
virtual

Implements Thyra::LinearOpBase< double >.

Definition at line 260 of file Thyra_EpetraLinearOp.cpp.

RCP< const VectorSpaceBase< double > > Thyra::EpetraLinearOp::domain ( ) const
virtual

Implements Thyra::LinearOpBase< double >.

Definition at line 267 of file Thyra_EpetraLinearOp.cpp.

RCP< const LinearOpBase< double > > Thyra::EpetraLinearOp::clone ( ) const
virtual

Reimplemented from Thyra::LinearOpBase< double >.

Definition at line 274 of file Thyra_EpetraLinearOp.cpp.

std::string Thyra::EpetraLinearOp::description ( ) const
virtual

Reimplemented from Teuchos::Describable.

Definition at line 284 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::describe ( FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel 
) const

Definition at line 301 of file Thyra_EpetraLinearOp.cpp.

bool Thyra::EpetraLinearOp::opSupportedImpl ( EOpTransp  M_trans) const
protectedvirtual

Implements Thyra::LinearOpBase< double >.

Definition at line 352 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::applyImpl ( const EOpTransp  M_trans,
const MultiVectorBase< double > &  X,
const Ptr< MultiVectorBase< double > > &  Y,
const double  alpha,
const double  beta 
) const
protectedvirtual

Implements Thyra::LinearOpBase< double >.

Definition at line 361 of file Thyra_EpetraLinearOp.cpp.

bool Thyra::EpetraLinearOp::supportsScaleLeftImpl ( ) const
protectedvirtual

Implements Thyra::ScaledLinearOpBase< double >.

Definition at line 524 of file Thyra_EpetraLinearOp.cpp.

bool Thyra::EpetraLinearOp::supportsScaleRightImpl ( ) const
protectedvirtual

Implements Thyra::ScaledLinearOpBase< double >.

Definition at line 530 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::scaleLeftImpl ( const VectorBase< double > &  row_scaling)
protectedvirtual

Implements Thyra::ScaledLinearOpBase< double >.

Definition at line 536 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::scaleRightImpl ( const VectorBase< double > &  col_scaling)
protectedvirtual

Implements Thyra::ScaledLinearOpBase< double >.

Definition at line 545 of file Thyra_EpetraLinearOp.cpp.

bool Thyra::EpetraLinearOp::rowStatIsSupportedImpl ( const RowStatLinearOpBaseUtils::ERowStat  rowStat) const
protectedvirtual

Implements Thyra::RowStatLinearOpBase< double >.

Definition at line 557 of file Thyra_EpetraLinearOp.cpp.

void Thyra::EpetraLinearOp::getRowStatImpl ( const RowStatLinearOpBaseUtils::ERowStat  rowStat,
const Ptr< VectorBase< double > > &  rowStatVec 
) const
protectedvirtual

Implements Thyra::RowStatLinearOpBase< double >.

Definition at line 574 of file Thyra_EpetraLinearOp.cpp.

RCP< const SpmdVectorSpaceBase< double > > Thyra::EpetraLinearOp::allocateDomain ( const RCP< Epetra_Operator > &  op,
EOpTransp  op_trans 
) const
protectedvirtual

Allocate the domain space of the operator.

Purpose: In TSFExtended, both EpetraLinearOp and EpetraVectorSpace are extended from the Thyra versions by inheritance, and the TSFExtended operator subclasses expect to work with an extended vector space subclass. Thus, it is necessary for the base operator class to never directly allocate vector space objects, and allocation is delegated to a virtual allocator function.

Definition at line 600 of file Thyra_EpetraLinearOp.cpp.

RCP< const SpmdVectorSpaceBase< double > > Thyra::EpetraLinearOp::allocateRange ( const RCP< Epetra_Operator > &  op,
EOpTransp  op_trans 
) const
protectedvirtual

Allocate the range space of the operator.

Purpose: In TSFExtended, both EpetraLinearOp and EpetraVectorSpace are extended from the Thyra versions by inheritance, and the TSFExtended operator subclasses expect to work with an extended vector space subclass. Thus, it is necessary for the base operator class to never directly allocate vector space objects, and allocation is delegated to a virtual allocator function.

Definition at line 613 of file Thyra_EpetraLinearOp.cpp.

Friends And Related Function Documentation

RCP< EpetraLinearOp > nonconstEpetraLinearOp ( )
related

Default nonmember constructor.

RCP< EpetraLinearOp > partialNonconstEpetraLinearOp ( const RCP< const VectorSpaceBase< double > > &  range,
const RCP< const VectorSpaceBase< double > > &  domain,
const RCP< Epetra_Operator > &  op,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED 
)
related

Partially initialized EpetraLinearOp.

RCP< EpetraLinearOp > nonconstEpetraLinearOp ( const RCP< Epetra_Operator > &  op,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const RCP< const VectorSpaceBase< double > > &  range = Teuchos::null,
const RCP< const VectorSpaceBase< double > > &  domain = Teuchos::null 
)
related

Dynamically allocate an const EpetraLinearOp to wrap a const Epetra_Operator object.

RCP< const EpetraLinearOp > epetraLinearOp ( const RCP< const Epetra_Operator > &  op,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const RCP< const VectorSpaceBase< double > > &  range = Teuchos::null,
const RCP< const VectorSpaceBase< double > > &  domain = Teuchos::null 
)
related

Dynamically allocate a nonconst EpetraLinearOp to wrap a const Epetra_Operator object.

RCP< EpetraLinearOp > nonconstEpetraLinearOp ( const RCP< Epetra_Operator > &  op,
const std::string &  label,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const RCP< const VectorSpaceBase< double > > &  range = Teuchos::null,
const RCP< const VectorSpaceBase< double > > &  domain = Teuchos::null 
)
related

Dynamically allocate an const EpetraLinearOp to wrap a const Epetra_Operator object and give it a string label.

RCP< const EpetraLinearOp > epetraLinearOp ( const RCP< const Epetra_Operator > &  op,
const std::string &  label,
EOpTransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const RCP< const SpmdVectorSpaceBase< double > > &  range = Teuchos::null,
const RCP< const SpmdVectorSpaceBase< double > > &  domain = Teuchos::null 
)
related

Dynamically allocate a nonconst EpetraLinearOp to wrap a const Epetra_Operator object.


The documentation for this class was generated from the following files: