Thyra::EpetraLinearOp Class Reference
[Epetra to Thyra Operator/Vector Adapter Code]

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

#include <Thyra_EpetraLinearOp.hpp>

Inheritance diagram for Thyra::EpetraLinearOp:

Inheritance graph
[legend]
List of all members.

Public types

typedef double Scalar
 

Constructors / initializers / accessors

 EpetraLinearOp ()
 Construct to uninitialized.
 EpetraLinearOp (const Teuchos::RefCountPtr< Epetra_Operator > &op, ETransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &spmdRange=Teuchos::null, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &spmdDomain=Teuchos::null)
 Calls initialize().
void initialize (const Teuchos::RefCountPtr< Epetra_Operator > &op, ETransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &spmdRange=Teuchos::null, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &spmdDomain=Teuchos::null)
 Initialize.
void uninitialize (Teuchos::RefCountPtr< Epetra_Operator > *op=NULL, ETransp *opTrans=NULL, EApplyEpetraOpAs *applyAs=NULL, EAdjointEpetraOp *adjointSupport=NULL, Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > *spmdRange=NULL, Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > *spmdDomain=NULL)
 Set to uninitialized and optionally return the current state.
Teuchos::RefCountPtr< const
SpmdVectorSpaceBase< Scalar > > 
spmdRange () const
 Return a smart pointer to the SpmdVectorSpaceBase object for the range.
Teuchos::RefCountPtr< const
SpmdVectorSpaceBase< Scalar > > 
spmdDomain () const
 Return a smart pointer to the SpmdVectorSpaceBase object for the domain.
Teuchos::RefCountPtr< Epetra_Operatorepetra_op ()
 
Teuchos::RefCountPtr< const
Epetra_Operator
epetra_op () const
 

Overridden from EpetraLinearOpBase

void getEpetraOpView (Teuchos::RefCountPtr< Epetra_Operator > *epetraOp, ETransp *epetraOpTransp, EApplyEpetraOpAs *epetraOpApplyAs, EAdjointEpetraOp *epetraOpAdjointSupport)
 
void getEpetraOpView (Teuchos::RefCountPtr< const Epetra_Operator > *epetraOp, ETransp *epetraOpTransp, EApplyEpetraOpAs *epetraOpApplyAs, EAdjointEpetraOp *epetraOpAdjointSupport) const
 

Overridden from SingleScalarLinearOpBase

bool opSupported (ETransp M_trans) const
 

Overridden from EuclideanLinearOpBase

Teuchos::RefCountPtr< const
ScalarProdVectorSpaceBase<
Scalar > > 
rangeScalarProdVecSpc () const
 Returns this->spmdRange().
Teuchos::RefCountPtr< const
ScalarProdVectorSpaceBase<
Scalar > > 
domainScalarProdVecSpc () const
 Returns this->spmdDomain().
void euclideanApply (const ETransp M_trans, const MultiVectorBase< Scalar > &X, MultiVectorBase< Scalar > *Y, const Scalar alpha, const Scalar beta) const
 

Overridden from LinearOpBase

Teuchos::RefCountPtr< const
LinearOpBase< Scalar > > 
clone () const
 

Overridden from Teuchos::Describable

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

Allocators for domain and range spaces

virtual Teuchos::RefCountPtr<
const SpmdVectorSpaceBase<
Scalar > > 
allocateDomain (const Teuchos::RefCountPtr< Epetra_Operator > &op, ETransp op_trans) const
 Allocate the domain space of the operator.
virtual Teuchos::RefCountPtr<
const SpmdVectorSpaceBase<
Scalar > > 
allocateRange (const Teuchos::RefCountPtr< Epetra_Operator > &op, ETransp op_trans) const
 Allocate the range space of the operator.

Related Functions

(Note that these are not member functions.)

Teuchos::RefCountPtr< EpetraLinearOpnonconstEpetraLinearOp (const Teuchos::RefCountPtr< Epetra_Operator > &op, ETransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdRange=Teuchos::null, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdDomain=Teuchos::null)
 Dynamically allocate an const EpetraLinearOp to wrap a const Epetra_Operator object.
Teuchos::RefCountPtr< const
EpetraLinearOp
epetraLinearOp (const Teuchos::RefCountPtr< const Epetra_Operator > &op, ETransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdRange=Teuchos::null, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdDomain=Teuchos::null)
 Dynamically allocate a nonconst EpetraLinearOp to wrap a const Epetra_Operator object.
Teuchos::RefCountPtr< EpetraLinearOpnonconstEpetraLinearOp (const Teuchos::RefCountPtr< Epetra_Operator > &op, const std::string &label, ETransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdRange=Teuchos::null, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdDomain=Teuchos::null)
 Dynamically allocate an const EpetraLinearOp to wrap a const Epetra_Operator object and give it a string label.
Teuchos::RefCountPtr< const
EpetraLinearOp
epetraLinearOp (const Teuchos::RefCountPtr< const Epetra_Operator > &op, const std::string &label, ETransp opTrans=NOTRANS, EApplyEpetraOpAs applyAs=EPETRA_OP_APPLY_APPLY, EAdjointEpetraOp adjointSupport=EPETRA_OP_ADJOINT_SUPPORTED, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdRange=Teuchos::null, const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &spmdDomain=Teuchos::null)
 Dynamically allocate a nonconst EpetraLinearOp to wrap a const Epetra_Operator object.

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.

Examples:

sillyCgSolve_epetra.cpp, sillyPowerMethod_epetra.cpp, and test_epetra_adapters.cpp.


Member Typedef Documentation

typedef double Thyra::EpetraLinearOp::Scalar
 


Constructor & Destructor Documentation

Thyra::EpetraLinearOp::EpetraLinearOp  ) 
 

Construct to uninitialized.

See the postconditions for uninitialize()

Thyra::EpetraLinearOp::EpetraLinearOp const Teuchos::RefCountPtr< Epetra_Operator > &  op,
ETransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &  spmdRange = Teuchos::null,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &  spmdDomain = Teuchos::null
 

Calls initialize().


Member Function Documentation

void Thyra::EpetraLinearOp::initialize const Teuchos::RefCountPtr< Epetra_Operator > &  op,
ETransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &  spmdRange = Teuchos::null,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > &  spmdDomain = Teuchos::null
 

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.
spmdRange [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.
spmdDomain [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:
  • op.get() != NULL (throw std::invalid_argument)

Postconditions:

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

void Thyra::EpetraLinearOp::uninitialize Teuchos::RefCountPtr< Epetra_Operator > *  op = NULL,
ETransp opTrans = NULL,
EApplyEpetraOpAs applyAs = NULL,
EAdjointEpetraOp adjointSupport = NULL,
Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > *  spmdRange = NULL,
Teuchos::RefCountPtr< const SpmdVectorSpaceBase< Scalar > > *  spmdDomain = NULL
 

Set to uninitialized and optionally return the current state.

Postconditions:

Teuchos::RefCountPtr< const SpmdVectorSpaceBase< EpetraLinearOp::Scalar > > 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

Teuchos::RefCountPtr< const SpmdVectorSpaceBase< EpetraLinearOp::Scalar > > 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

Teuchos::RefCountPtr< Epetra_Operator > Thyra::EpetraLinearOp::epetra_op  ) 
 

Teuchos::RefCountPtr< const Epetra_Operator > Thyra::EpetraLinearOp::epetra_op  )  const
 

void Thyra::EpetraLinearOp::getEpetraOpView Teuchos::RefCountPtr< Epetra_Operator > *  epetraOp,
ETransp epetraOpTransp,
EApplyEpetraOpAs epetraOpApplyAs,
EAdjointEpetraOp epetraOpAdjointSupport
[virtual]
 

Implements Thyra::EpetraLinearOpBase.

void Thyra::EpetraLinearOp::getEpetraOpView Teuchos::RefCountPtr< const Epetra_Operator > *  epetraOp,
ETransp epetraOpTransp,
EApplyEpetraOpAs epetraOpApplyAs,
EAdjointEpetraOp epetraOpAdjointSupport
const [virtual]
 

Implements Thyra::EpetraLinearOpBase.

bool Thyra::EpetraLinearOp::opSupported ETransp  M_trans  )  const [virtual]
 

Implements Thyra::SingleScalarEuclideanLinearOpBase< double >.

Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase< EpetraLinearOp::Scalar > > Thyra::EpetraLinearOp::rangeScalarProdVecSpc  )  const [virtual]
 

Returns this->spmdRange().

Implements Thyra::EuclideanLinearOpBase< double >.

Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase< EpetraLinearOp::Scalar > > Thyra::EpetraLinearOp::domainScalarProdVecSpc  )  const [virtual]
 

Returns this->spmdDomain().

Implements Thyra::EuclideanLinearOpBase< double >.

void Thyra::EpetraLinearOp::euclideanApply const ETransp  M_trans,
const MultiVectorBase< Scalar > &  X,
MultiVectorBase< Scalar > *  Y,
const Scalar  alpha,
const Scalar  beta
const
 

Teuchos::RefCountPtr< const LinearOpBase< EpetraLinearOp::Scalar > > Thyra::EpetraLinearOp::clone  )  const
 

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

Reimplemented from Thyra::LinearOpDefaultBase< RangeScalar, DomainScalar >.

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

Reimplemented from Thyra::LinearOpDefaultBase< RangeScalar, DomainScalar >.

Teuchos::RefCountPtr< const SpmdVectorSpaceBase< EpetraLinearOp::Scalar > > Thyra::EpetraLinearOp::allocateDomain const Teuchos::RefCountPtr< Epetra_Operator > &  op,
ETransp  op_trans
const [protected, virtual]
 

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.

Teuchos::RefCountPtr< const SpmdVectorSpaceBase< EpetraLinearOp::Scalar > > Thyra::EpetraLinearOp::allocateRange const Teuchos::RefCountPtr< Epetra_Operator > &  op,
ETransp  op_trans
const [protected, virtual]
 

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.


Friends And Related Function Documentation

Teuchos::RefCountPtr< EpetraLinearOp > nonconstEpetraLinearOp const Teuchos::RefCountPtr< Epetra_Operator > &  op,
ETransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdRange = Teuchos::null,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdDomain = Teuchos::null
[related]
 

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

Teuchos::RefCountPtr< const EpetraLinearOp > epetraLinearOp const Teuchos::RefCountPtr< const Epetra_Operator > &  op,
ETransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdRange = Teuchos::null,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdDomain = Teuchos::null
[related]
 

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

Teuchos::RefCountPtr< EpetraLinearOp > nonconstEpetraLinearOp const Teuchos::RefCountPtr< Epetra_Operator > &  op,
const std::string &  label,
ETransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdRange = Teuchos::null,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdDomain = Teuchos::null
[related]
 

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

Teuchos::RefCountPtr< const EpetraLinearOp > epetraLinearOp const Teuchos::RefCountPtr< const Epetra_Operator > &  op,
const std::string &  label,
ETransp  opTrans = NOTRANS,
EApplyEpetraOpAs  applyAs = EPETRA_OP_APPLY_APPLY,
EAdjointEpetraOp  adjointSupport = EPETRA_OP_ADJOINT_SUPPORTED,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdRange = Teuchos::null,
const Teuchos::RefCountPtr< const SpmdVectorSpaceBase< double > > &  spmdDomain = 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:
Generated on Sun May 20 13:06:11 2007 for Epetra to Thyra Adapter Software by doxygen 1.3.9.1