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:

[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.

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.

Definition at line 58 of file Thyra_EpetraLinearOp.hpp.


Member Typedef Documentation

typedef double Thyra::EpetraLinearOp::Scalar
 

Definition at line 68 of file Thyra_EpetraLinearOp.hpp.


Constructor & Destructor Documentation

Thyra::EpetraLinearOp::EpetraLinearOp  ) 
 

Construct to uninitialized.

See the postconditions for uninitialize()

Definition at line 43 of file Thyra_EpetraLinearOp.cpp.

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().

Definition at line 46 of file Thyra_EpetraLinearOp.cpp.


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

Definition at line 58 of file Thyra_EpetraLinearOp.cpp.

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:

Definition at line 94 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 123 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 129 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 135 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 141 of file Thyra_EpetraLinearOp.cpp.

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

Implements Thyra::EpetraLinearOpBase.

Definition at line 148 of file Thyra_EpetraLinearOp.cpp.

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

Implements Thyra::EpetraLinearOpBase.

Definition at line 167 of file Thyra_EpetraLinearOp.cpp.

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

Implements Thyra::SingleScalarEuclideanLinearOpBase< double >.

Definition at line 188 of file Thyra_EpetraLinearOp.cpp.

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

Returns this->spmdRange().

Implements Thyra::EuclideanLinearOpBase< double >.

Definition at line 196 of file Thyra_EpetraLinearOp.cpp.

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

Returns this->spmdDomain().

Implements Thyra::EuclideanLinearOpBase< double >.

Definition at line 202 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 207 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 297 of file Thyra_EpetraLinearOp.cpp.

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

Definition at line 305 of file Thyra_EpetraLinearOp.cpp.

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

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

Definition at line 320 of file Thyra_EpetraLinearOp.cpp.

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.

Definition at line 366 of file Thyra_EpetraLinearOp.cpp.

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.

Definition at line 376 of file Thyra_EpetraLinearOp.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:37:49 2008 for Epetra to Thyra Adapter Software by doxygen 1.3.9.1